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

Diff of /m4/m4/utility.c

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

revision 1.5 by akim, Mon Aug 20 15:52:50 2001 UTC revision 1.6 by gary, Mon Aug 20 19:42:38 2001 UTC
# Line 24  Line 24 
24  #include "m4.h"  #include "m4.h"
25  #include "m4private.h"  #include "m4private.h"
26    
27  static int dumpdef_cmp M4_PARAMS((const VOID *s1, const VOID *s2));  static int dumpdef_cmp (const void *s1, const void *s2);
28    
29  /* The name this program was run with. */  /* The name this program was run with. */
30  M4_GLOBAL_DATA const char *program_name;  M4_GLOBAL_DATA const char *program_name;
# Line 80  M4_GLOBAL_DATA m4_string bcomm; Line 80  M4_GLOBAL_DATA m4_string bcomm;
80  M4_GLOBAL_DATA m4_string ecomm;  M4_GLOBAL_DATA m4_string ecomm;
81    
82    
   
83  /* Addressable function versions of the macros defined in m4private.h.  /* Addressable function versions of the macros defined in m4private.h.
84     Since they are functions the caller does not need access to the     Since they are functions the caller does not need access to the
85     internal data structure, so they are safe to export for use in     internal data structure, so they are safe to export for use in
# Line 178  m4_numeric_arg (m4_token_data *macro, co Line 177  m4_numeric_arg (m4_token_data *macro, co
177  /* Print ARGC arguments from the table ARGV to obstack OBS, separated by  /* Print ARGC arguments from the table ARGV to obstack OBS, separated by
178     SEP, and quoted by the current quotes, if QUOTED is TRUE.  */     SEP, and quoted by the current quotes, if QUOTED is TRUE.  */
179  void  void
180  m4_dump_args (obs, argc, argv, sep, quoted)  m4_dump_args (struct obstack *obs, int argc, m4_token_data **argv,
181       struct obstack *obs;                const char *sep, boolean quoted)
      int argc;  
      m4_token_data **argv;  
      const char *sep;  
      boolean quoted;  
182  {  {
183    int i;    int i;
184    size_t len = strlen (sep);    size_t len = strlen (sep);
# Line 193  m4_dump_args (obs, argc, argv, sep, quot Line 188  m4_dump_args (obs, argc, argv, sep, quot
188        if (i > 1)        if (i > 1)
189          obstack_grow (obs, sep, len);          obstack_grow (obs, sep, len);
190    
191        m4_shipout_string(obs, M4_TOKEN_DATA_TEXT (argv[i]), 0, quoted);        m4_shipout_string (obs, M4_TOKEN_DATA_TEXT (argv[i]), 0, quoted);
192      }      }
193  }  }
194    
# Line 241  m4_expand_ranges (const char *s, struct Line 236  m4_expand_ranges (const char *s, struct
236    
237  /* qsort comparison routine, for sorting the table made in m4_dumpdef ().  */  /* qsort comparison routine, for sorting the table made in m4_dumpdef ().  */
238  static int  static int
239  dumpdef_cmp (s1, s2)  dumpdef_cmp (const void *s1, const void *s2)
      const VOID *s1;  
      const VOID *s2;  
240  {  {
241    return strcmp (SYMBOL_NAME (* (m4_symbol *const *) s1),    return strcmp (SYMBOL_NAME (* (m4_symbol *const *) s1),
242                   SYMBOL_NAME (* (m4_symbol *const *) s2));                   SYMBOL_NAME (* (m4_symbol *const *) s2));
# Line 252  dumpdef_cmp (s1, s2) Line 245  dumpdef_cmp (s1, s2)
245  /* The function dump_symbol () is for use by "dumpdef".  It builds up a  /* The function dump_symbol () is for use by "dumpdef".  It builds up a
246     table of all defined, un-shadowed, symbols.  */     table of all defined, un-shadowed, symbols.  */
247  void  void
248  m4_dump_symbol (symbol, data)  m4_dump_symbol (m4_symbol *symbol, struct m4_dump_symbol_data *data)
      m4_symbol *symbol;  
      struct m4_dump_symbol_data *data;  
249  {  {
250    if (!SYMBOL_SHADOWED (symbol) && SYMBOL_TYPE (symbol) != M4_TOKEN_VOID)    if (!SYMBOL_SHADOWED (symbol) && SYMBOL_TYPE (symbol) != M4_TOKEN_VOID)
251      {      {
# Line 267  m4_dump_symbol (symbol, data) Line 258  m4_dump_symbol (symbol, data)
258  /* If there are no arguments, build a sorted list of all defined,  /* If there are no arguments, build a sorted list of all defined,
259     un-shadowed, symbols, otherwise, only the specified symbols.  */     un-shadowed, symbols, otherwise, only the specified symbols.  */
260  void  void
261  m4_dump_symbols (data, argc, argv, complain)  m4_dump_symbols (struct m4_dump_symbol_data *data, int argc,
262       struct m4_dump_symbol_data *data;                   m4_token_data **argv, boolean complain)
      int argc;  
      m4_token_data **argv;  
      boolean complain;  
263  {  {
264    data->base = (m4_symbol **) obstack_base (data->obs);    data->base = (m4_symbol **) obstack_base (data->obs);
265    data->size = 0;    data->size = 0;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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