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

Diff of /m4/modules/m4.c

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

revision 1.23 by gary, Thu Sep 20 22:01:34 2001 UTC revision 1.24 by gary, Sun Sep 30 14:43:38 2001 UTC
# Line 92  typedef unsigned long int unumber; Line 92  typedef unsigned long int unumber;
92  #endif  #endif
93    
94    
95  static void     include         (int argc, m4_symbol **argv, boolean silent);  static void     include         (int argc, m4_token_data **argv,
96                                     boolean silent);
97  static int      set_trace       (const char *name, m4_symbol *symbol,  static int      set_trace       (const char *name, m4_symbol *symbol,
98                                   void *data);                                   void *data);
99  static const char *ntoa         (number value, int radix);  static const char *ntoa         (number value, int radix);
# Line 150  M4BUILTIN_HANDLER (define) Line 151  M4BUILTIN_HANDLER (define)
151    if (m4_bad_argc (argv[0], argc, 2, 3))    if (m4_bad_argc (argv[0], argc, 2, 3))
152      return;      return;
153    
154    if (M4_SYMBOL_TYPE (argv[1]) != M4_TOKEN_TEXT)    if (M4_TOKEN_DATA_TYPE (argv[1]) != M4_TOKEN_TEXT)
155      return;      return;
156    
157    if (argc == 2)    if (argc == 2)
# Line 159  M4BUILTIN_HANDLER (define) Line 160  M4BUILTIN_HANDLER (define)
160        return;        return;
161      }      }
162    
163    switch (M4_SYMBOL_TYPE (argv[2]))    switch (M4_TOKEN_DATA_TYPE (argv[2]))
164      {      {
165      case M4_TOKEN_TEXT:      case M4_TOKEN_TEXT:
166        m4_macro_define (M4ARG (1), NULL, M4ARG (2));        m4_macro_define (M4ARG (1), NULL, M4ARG (2));
# Line 167  M4BUILTIN_HANDLER (define) Line 168  M4BUILTIN_HANDLER (define)
168    
169      case M4_TOKEN_FUNC:      case M4_TOKEN_FUNC:
170        {        {
171          lt_dlhandle        handle  = M4_SYMBOL_HANDLE (argv[2]);          lt_dlhandle  handle  = M4_TOKEN_DATA_HANDLE (argv[2]);
172          const m4_builtin * builtin = 0;          const m4_builtin  *builtin = 0;
173          m4_symbol *        symbol  = 0;          m4_symbol *symbol = 0;
174    
175          /* If we find a TOKEN_FUNC with no defining module, then          /* If we find a TOKEN_FUNC with no defining module, then
176             somewhere along the way we have lost the module handle.  */             somewhere along the way we have lost the module handle.  */
# Line 179  M4BUILTIN_HANDLER (define) Line 180  M4BUILTIN_HANDLER (define)
180             and blind_no_args flags?  May as well carry these around with             and blind_no_args flags?  May as well carry these around with
181             the traced flag, and save a _lot_ of lookup time.  */             the traced flag, and save a _lot_ of lookup time.  */
182          builtin = m4_builtin_find_by_func (m4_module_builtins (handle),          builtin = m4_builtin_find_by_func (m4_module_builtins (handle),
183                                             M4_SYMBOL_FUNC (argv[2]));                                             M4_TOKEN_DATA_FUNC (argv[2]));
184    
185          symbol  = m4_builtin_define (M4ARG (1), handle, builtin);          symbol = m4_builtin_define (M4ARG (1), handle, builtin);
186    
187          /* Be sure to propogate the flags from the TOKEN_FUNC.  */          /* Be sure to propogate the flags from the TOKEN_FUNC.  */
188          M4_SYMBOL_TRACED (symbol) = M4_SYMBOL_TRACED (argv[2]);          M4_SYMBOL_TRACED (symbol) = M4_TOKEN_TRACED (argv[2]);
189        }        }
190        return;        return;
191      }      }
# Line 210  M4BUILTIN_HANDLER (pushdef) Line 211  M4BUILTIN_HANDLER (pushdef)
211    if (m4_bad_argc (argv[0], argc, 2, 3))    if (m4_bad_argc (argv[0], argc, 2, 3))
212      return;      return;
213    
214    if (M4_SYMBOL_TYPE (argv[1]) != M4_TOKEN_TEXT)    if (M4_TOKEN_DATA_TYPE (argv[1]) != M4_TOKEN_TEXT)
215      return;      return;
216    
217    if (argc == 2)    if (argc == 2)
# Line 219  M4BUILTIN_HANDLER (pushdef) Line 220  M4BUILTIN_HANDLER (pushdef)
220        return;        return;
221      }      }
222    
223    switch (M4_SYMBOL_TYPE (argv[2]))    switch (M4_TOKEN_DATA_TYPE (argv[2]))
224      {      {
225      case M4_TOKEN_TEXT:      case M4_TOKEN_TEXT:
226        m4_macro_pushdef (M4ARG (1), NULL, M4ARG (2));        m4_macro_pushdef (M4ARG (1), NULL, M4ARG (2));
# Line 227  M4BUILTIN_HANDLER (pushdef) Line 228  M4BUILTIN_HANDLER (pushdef)
228    
229      case M4_TOKEN_FUNC:      case M4_TOKEN_FUNC:
230        {        {
231          lt_dlhandle        handle  = M4_SYMBOL_HANDLE (argv[2]);          lt_dlhandle  handle  = M4_TOKEN_DATA_HANDLE (argv[2]);
232          const m4_builtin * builtin = 0;          const m4_builtin  *builtin = 0;
233    
234          /* If we find a TOKEN_FUNC with no defining module, then          /* If we find a TOKEN_FUNC with no defining module, then
235             somewhere along the way we have lost the module handle.  */             somewhere along the way we have lost the module handle.  */
236          assert (handle);          assert (handle);
237    
238          builtin = m4_builtin_find_by_func (m4_module_builtins (handle),          builtin = m4_builtin_find_by_func (m4_module_builtins (handle),
239                                             M4_SYMBOL_FUNC (argv[2]));                                             M4_TOKEN_DATA_FUNC (argv[2]));
240    
241          m4_builtin_pushdef (M4ARG (1), handle, builtin);          m4_builtin_pushdef (M4ARG (1), handle, builtin);
242        }        }
# Line 535  M4BUILTIN_HANDLER (changequote) Line 536  M4BUILTIN_HANDLER (changequote)
536    if (m4_bad_argc (argv[0], argc, 1, 3))    if (m4_bad_argc (argv[0], argc, 1, 3))
537      return;      return;
538    
539    m4_set_quotes ((argc >= 2) ? M4_SYMBOL_TEXT (argv[1]) : NULL,    m4_set_quotes ((argc >= 2) ? M4_TOKEN_DATA_TEXT (argv[1]) : NULL,
540               (argc >= 3) ? M4_SYMBOL_TEXT (argv[2]) : NULL);               (argc >= 3) ? M4_TOKEN_DATA_TEXT (argv[2]) : NULL);
541  }  }
542    
543  /* Change the current comment delimiters.  The function set_comment ()  /* Change the current comment delimiters.  The function set_comment ()
# Line 549  M4BUILTIN_HANDLER (changecom) Line 550  M4BUILTIN_HANDLER (changecom)
550    if (argc == 1)    if (argc == 1)
551      m4_set_comment ("", "");    /* disable comments */      m4_set_comment ("", "");    /* disable comments */
552    else    else
553      m4_set_comment (M4_SYMBOL_TEXT (argv[1]),      m4_set_comment (M4_TOKEN_DATA_TEXT (argv[1]),
554                      (argc >= 3) ? M4_SYMBOL_TEXT (argv[2]) : NULL);                      (argc >= 3) ? M4_TOKEN_DATA_TEXT (argv[2]) : NULL);
555  }  }
556    
557    
# Line 561  M4BUILTIN_HANDLER (changecom) Line 562  M4BUILTIN_HANDLER (changecom)
562  /* Generic include function.  Include the file given by the first argument,  /* Generic include function.  Include the file given by the first argument,
563     if it exists.  Complain about inaccesible files iff SILENT is FALSE.  */     if it exists.  Complain about inaccesible files iff SILENT is FALSE.  */
564  static void  static void
565  include (int argc, m4_symbol **argv, boolean silent)  include (int argc, m4_token_data **argv, boolean silent)
566  {  {
567    FILE *fp;    FILE *fp;
568    char *name = NULL;    char *name = NULL;

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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