/[m4]/m4/modules/load.c
ViewVC logotype

Diff of /m4/modules/load.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by gary, Sun Aug 19 10:53:56 2001 UTC revision 1.8 by gary, Fri Oct 12 19:57:29 2001 UTC
# Line 32  Line 32 
32  /* Maintain each of the builtins implemented in this modules along  /* Maintain each of the builtins implemented in this modules along
33     with their details in a single table for easy maintenance.     with their details in a single table for easy maintenance.
34    
35                  function        macros  blind */                  function        macros  blind minargs maxargs */
36  #define builtin_functions                       \  #define builtin_functions                       \
37          BUILTIN(modules,        FALSE,  FALSE ) \          BUILTIN(modules,        FALSE,  FALSE,  1,      1  )    \
38          BUILTIN(load,           FALSE,  TRUE  ) \          BUILTIN(load,           FALSE,  TRUE,   2,      2  )    \
39          BUILTIN(unload,         FALSE,  TRUE  )          BUILTIN(unload,         FALSE,  TRUE,   2,      2  )    \
40    
41    
42  /* Generate prototypes for each builtin handler function. */  /* Generate prototypes for each builtin handler function. */
43  #define BUILTIN(handler, macros,  blind)        M4BUILTIN(handler)  #define BUILTIN(handler, macros,  blind, min, max) M4BUILTIN(handler)
44    builtin_functions    builtin_functions
45  #undef BUILTIN  #undef BUILTIN
46    
# Line 48  Line 48 
48  /* Generate a table for mapping m4 symbol names to handler functions. */  /* Generate a table for mapping m4 symbol names to handler functions. */
49  m4_builtin m4_builtin_table[] =  m4_builtin m4_builtin_table[] =
50  {  {
51  #define BUILTIN(handler, macros, blind)         \  #define BUILTIN(handler, macros, blind, min, max)               \
52          { STR(handler), CONC(builtin_, handler), macros, blind },          { STR(handler), CONC(builtin_, handler), macros, blind, min, max },
53    builtin_functions    builtin_functions
54  #undef BUILTIN  #undef BUILTIN
55    
56    { 0, 0, FALSE, FALSE },    { 0, 0, FALSE, FALSE, 0, 0 },
57  };  };
58    
59    
# Line 95  M4BUILTIN_HANDLER (modules) Line 95  M4BUILTIN_HANDLER (modules)
95       loaded modules.  */       loaded modules.  */
96    lt_dlhandle handle = lt_dlhandle_next (NULL);    lt_dlhandle handle = lt_dlhandle_next (NULL);
97    
   if (m4_bad_argc (argv[0], argc, 1, 1))  
     return;  
   
98    if (handle)    if (handle)
99      do      do
100        {        {
# Line 114  M4BUILTIN_HANDLER (modules) Line 111  M4BUILTIN_HANDLER (modules)
111   **/   **/
112  M4BUILTIN_HANDLER (load)  M4BUILTIN_HANDLER (load)
113  {  {
   if (m4_bad_argc (argv[0], argc, 2, 2))  
     return;  
   
114    /* Load the named module and install the builtins and macros    /* Load the named module and install the builtins and macros
115       exported by that module.  */       exported by that module.  */
116    m4_module_load (M4ARG(1), obs);    m4_module_load (M4ARG(1), obs);
# Line 127  M4BUILTIN_HANDLER (load) Line 121  M4BUILTIN_HANDLER (load)
121   **/   **/
122  M4BUILTIN_HANDLER (unload)  M4BUILTIN_HANDLER (unload)
123  {  {
   if (m4_bad_argc (argv[0], argc, 2, 2))  
     return;  
   
124    /* Remove all builtins and macros installed by the named module,    /* Remove all builtins and macros installed by the named module,
125       and then unload the module from memory entirely.  */       and then unload the module from memory entirely.  */
126    m4_module_unload (M4ARG(1), obs);    m4_module_unload (M4ARG(1), obs);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26