modules: remove support for module unload and refcount.
[m4/ericb.git] / modules / shadow.c
blob529425c43b40b8f869c3081b3b534e0677896838
1 /* GNU m4 -- A simple macro processor
2 Copyright (C) 1999-2000, 2006-2008, 2010, 2013 Free Software
3 Foundation, Inc.
5 This file is part of GNU M4.
7 GNU M4 is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 GNU M4 is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <config.h>
23 /* Build using only the exported interfaces, unless NDEBUG is set, in
24 which case use private symbols to speed things up as much as possible. */
25 #ifndef NDEBUG
26 # include <m4/m4module.h>
27 #else
28 # include "m4private.h"
29 #endif
31 /* Rename exported symbols for dlpreload()ing. */
32 #define m4_builtin_table shadow_LTX_m4_builtin_table
33 #define m4_macro_table shadow_LTX_m4_macro_table
35 /* function macros blind side minargs maxargs */
36 #define builtin_functions \
37 BUILTIN (shadow, false, false, false, 0, -1 ) \
38 BUILTIN (test, false, false, false, 0, -1 ) \
41 #define BUILTIN(handler, macros, blind, side, min, max) M4BUILTIN (handler)
42 builtin_functions
43 #undef BUILTIN
45 const m4_builtin m4_builtin_table[] =
47 #define BUILTIN(handler, macros, blind, side, min, max) \
48 M4BUILTIN_ENTRY (handler, #handler, macros, blind, side, min, max)
50 builtin_functions
51 #undef BUILTIN
53 { NULL, NULL, 0, 0, 0 },
56 const m4_macro m4_macro_table[] =
58 /* name text min max */
59 { "__test__", "`shadow'", 0, 0 },
60 { NULL, NULL, 0, 0 },
65 M4INIT_HANDLER (shadow)
67 static bool loaded = false;
69 const char *s = "Shadow module loaded.";
71 /* Only display the message on first load. */
72 if (obs && !loaded)
74 loaded = true;
75 obstack_grow (obs, s, strlen (s));
81 /**
82 * shadow()
83 **/
84 M4BUILTIN_HANDLER (shadow)
86 const char *s = "Shadow::`shadow' called.";
87 obstack_grow (obs, s, strlen (s));
90 /**
91 * test()
92 **/
93 M4BUILTIN_HANDLER (test)
95 const char *s = "Shadow::`test' called.";
96 obstack_grow (obs, s, strlen (s));