m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: use-module-vs-handle-consistently.diff


From: Gary V. Vaughan
Subject: FYI: use-module-vs-handle-consistently.diff
Date: Wed, 12 Sep 2007 02:15:09 +0100 (BST)
User-agent: mailnotify/0.9

Applied to HEAD.

  Index: ChangeLog
  from  Gary V. Vaughan  <address@hidden>
  
        Be consistent about using 'module' for m4_module types and
        'handle' for lt_dlhandle types:
  
        * m4/m4private.h (m4_symbol_value): Rename handle element to
        method.  Changed all references.
        (VALUE_MODULE, SYMBOL_MODULE): Renamed from VALUE_HANDLE and
        SYMBOL_HANDLE respectively.  Changed all references.
        * m4/m4module.h (M4INIT_HANDLER, M4FINISH_HANDLER): Ditto.
        * m4/builtin.c (m4_builtin_find_by_name)
        (m4_builtin_find_by_func): Use module as the parameter name for
        pointers of type 'm4_module'.
        * m4/module.c (module_remove, m4_get_module_name)
        (install_builtin_table, install_macro_table)
        (m4_module_make_resident, m4__module_next, m4_module_refcount):
        Ditto.
        * src/freeze.c (produce_module_dump): Ditto.
        * m4/input.c (m4_input_block): Rename handle element to method.
        Changed all references.
        * m4/symtab.c (m4__symtab_remove_module_references): Ditto.
        * modules/load.c: Use module as the variable name for pointers
        of type 'm4_module'.
        * modules/m4.c: Ditto.
        * modules/perl.c: Ditto.
        * modules/shadow.c: Ditto.
  
  Index: m4/builtin.c
  ===================================================================
  RCS file: /sources/m4/m4/m4/builtin.c,v
  retrieving revision 1.30
  diff -u -u -r1.30 builtin.c
  --- m4/builtin.c 6 Sep 2007 22:58:26 -0000 1.30
  +++ m4/builtin.c 12 Sep 2007 01:14:13 -0000
  @@ -25,14 +25,14 @@
   
   #include "m4private.h"
   
  -/* Find the builtin which has NAME.  If HANDLE is not NULL, then
  -   search only in HANDLE's builtin table.  The result is a malloc'd
  +/* Find the builtin which has NAME.  If MODULE is not NULL, then
  +   search only in MODULE's builtin table.  The result is a malloc'd
      symbol value, suitable for use in the symbol table or for an
      argument to m4_push_builtin.  */
   m4_symbol_value *
  -m4_builtin_find_by_name (m4_module *handle, const char *name)
  +m4_builtin_find_by_name (m4_module *module, const char *name)
   {
  -  m4_module *cur = handle ? handle : m4__module_next (NULL);
  +  m4_module *cur = module ? module : m4__module_next (NULL);
   
     do
       {
  @@ -47,7 +47,7 @@
                m4_symbol_value *token = xzalloc (sizeof *token);
   
                m4_set_symbol_value_builtin (token, builtin);
  -             VALUE_HANDLE (token) = cur;
  +             VALUE_MODULE (token) = cur;
                VALUE_FLAGS (token) = builtin->flags;
                VALUE_MIN_ARGS (token) = builtin->min_args;
                VALUE_MAX_ARGS (token) = builtin->max_args;
  @@ -55,17 +55,17 @@
              }
        }
       }
  -  while (!handle && (cur = m4__module_next (cur)));
  +  while (!module && (cur = m4__module_next (cur)));
   
     return NULL;
   }
   
  -/* Find the builtin which has FUNC.  If HANDLE argument is supplied
  -   then search only in HANDLE's builtin table.  */
  +/* Find the builtin which has FUNC.  If MODULE argument is supplied
  +   then search only in MODULE's builtin table.  */
   const m4_builtin *
  -m4_builtin_find_by_func (m4_module *handle, m4_builtin_func *func)
  +m4_builtin_find_by_func (m4_module *module, m4_builtin_func *func)
   {
  -  m4_module *cur = handle ? handle : m4__module_next (NULL);
  +  m4_module *cur = module ? module : m4__module_next (NULL);
   
     do
       {
  @@ -79,7 +79,7 @@
              return builtin;
        }
       }
  -  while (!handle && (cur = m4__module_next (cur)));
  +  while (!module && (cur = m4__module_next (cur)));
   
     return 0;
   }
  Index: m4/input.c
  ===================================================================
  RCS file: /sources/m4/m4/m4/input.c,v
  retrieving revision 1.69
  diff -u -u -r1.69 input.c
  --- m4/input.c 7 Sep 2007 20:59:36 -0000 1.69
  +++ m4/input.c 12 Sep 2007 01:14:13 -0000
  @@ -163,7 +163,7 @@
         struct
        {
          const m4_builtin *builtin;  /* pointer to builtin's function. */
  -       m4_module *handle;      /* originating module. */
  +       m4_module *module;      /* originating module. */
          int flags;              /* flags associated with the builtin. */
          m4_hash *arg_signature; /* argument signature for builtin.  */
          unsigned int min_args;  /* argv minima for the builtin. */
  @@ -396,7 +396,7 @@
     obstack_1grow (obs, '>');
     if (m4_is_debug_bit (context, M4_DEBUG_TRACE_MODULE))
       {
  -      text = m4_get_module_name (me->u.u_b.handle);
  +      text = m4_get_module_name (me->u.u_b.module);
         obstack_1grow (obs, '{');
         obstack_grow (obs, text, strlen (text));
         obstack_1grow (obs, '}');
  @@ -428,7 +428,7 @@
     i->line = m4_get_current_line (context);
   
     i->u.u_b.builtin   = m4_get_symbol_value_builtin (token);
  -  i->u.u_b.handle    = VALUE_HANDLE (token);
  +  i->u.u_b.module    = VALUE_MODULE (token);
     i->u.u_b.arg_signature = VALUE_ARG_SIGNATURE (token);
     i->u.u_b.min_args  = VALUE_MIN_ARGS (token);
     i->u.u_b.max_args  = VALUE_MAX_ARGS (token);
  @@ -743,7 +743,7 @@
     assert (block->funcs->read_func == builtin_read && ! block->u.u_b.read);
   
     m4_set_symbol_value_builtin (token, block->u.u_b.builtin);
  -  VALUE_HANDLE (token)               = block->u.u_b.handle;
  +  VALUE_MODULE (token)               = block->u.u_b.module;
     VALUE_FLAGS (token)                = block->u.u_b.flags;
     VALUE_ARG_SIGNATURE (token)        = block->u.u_b.arg_signature;
     VALUE_MIN_ARGS (token)     = block->u.u_b.min_args;
  @@ -1285,7 +1285,7 @@
        bp = m4_builtin_find_by_func (NULL, m4_get_symbol_value_func (token));
        assert (bp);
        fprintf (stderr, "builtin\t<%s>{%s}\n", bp->name,
  -              m4_get_module_name (VALUE_HANDLE (token)));
  +              m4_get_module_name (VALUE_MODULE (token)));
         }
         break;
       }
  Index: m4/m4module.h
  ===================================================================
  RCS file: /sources/m4/m4/m4/m4module.h,v
  retrieving revision 1.111
  diff -u -u -r1.111 m4module.h
  --- m4/m4module.h 6 Sep 2007 22:58:26 -0000 1.111
  +++ m4/m4module.h 12 Sep 2007 01:14:14 -0000
  @@ -86,15 +86,15 @@
   
   #define M4INIT_HANDLER(name)                                 \
     void CONC(name, CONC(_LTX_, m4_init_module))                       \
  -     (m4 *context, m4_module *handle, m4_obstack *obs);      \
  +     (m4 *context, m4_module *module, m4_obstack *obs);      \
     void CONC(name, CONC(_LTX_, m4_init_module))                       \
  -     (m4 *context, m4_module *handle, m4_obstack *obs)
  +     (m4 *context, m4_module *module, m4_obstack *obs)
   
   #define M4FINISH_HANDLER(name)                                       \
     void CONC(name, CONC(_LTX_, m4_finish_module))             \
  -     (m4 *context, m4_module *handle, m4_obstack *obs);      \
  +     (m4 *context, m4_module *module, m4_obstack *obs);      \
     void CONC(name, CONC(_LTX_, m4_finish_module))             \
  -     (m4 *context, m4_module *handle, m4_obstack *obs)
  +     (m4 *context, m4_module *module, m4_obstack *obs)
   
   #define M4_MODULE_IMPORT(M, S)                                       \
     CONC(S, _func) *S = (CONC(S, _func) *)                     \
  Index: m4/m4private.h
  ===================================================================
  RCS file: /sources/m4/m4/m4/m4private.h,v
  retrieving revision 1.84
  diff -u -u -r1.84 m4private.h
  --- m4/m4private.h 7 Sep 2007 22:37:47 -0000 1.84
  +++ m4/m4private.h 12 Sep 2007 01:14:14 -0000
  @@ -179,7 +179,7 @@
   
   struct m4_symbol_value {
     m4_symbol_value *  next;
  -  m4_module *                handle;
  +  m4_module *                module;
     unsigned int               flags;
   
     m4_hash *          arg_signature;
  @@ -195,7 +195,7 @@
   };
   
   #define VALUE_NEXT(T)                ((T)->next)
  -#define VALUE_HANDLE(T)              ((T)->handle)
  +#define VALUE_MODULE(T)              ((T)->module)
   #define VALUE_FLAGS(T)               ((T)->flags)
   #define VALUE_ARG_SIGNATURE(T)       ((T)->arg_signature)
   #define VALUE_MIN_ARGS(T)    ((T)->min_args)
  @@ -203,7 +203,7 @@
   #define VALUE_PENDING(T)     ((T)->pending_expansions)
   
   #define SYMBOL_NEXT(S)               (VALUE_NEXT          ((S)->value))
  -#define SYMBOL_HANDLE(S)     (VALUE_HANDLE        ((S)->value))
  +#define SYMBOL_MODULE(S)     (VALUE_MODULE        ((S)->value))
   #define SYMBOL_FLAGS(S)              (VALUE_FLAGS         ((S)->value))
   #define SYMBOL_ARG_SIGNATURE(S)      (VALUE_ARG_SIGNATURE ((S)->value))
   #define SYMBOL_MIN_ARGS(S)   (VALUE_MIN_ARGS      ((S)->value))
  Index: m4/macro.c
  ===================================================================
  RCS file: /sources/m4/m4/m4/macro.c,v
  retrieving revision 1.70
  diff -u -u -r1.70 macro.c
  --- m4/macro.c 7 Aug 2007 03:15:27 -0000 1.70
  +++ m4/macro.c 12 Sep 2007 01:14:14 -0000
  @@ -185,7 +185,7 @@
   
              if (argp->type == M4_SYMBOL_VOID)
                {
  -               VALUE_HANDLE (argp) = NULL;
  +               VALUE_MODULE (argp) = NULL;
                  m4_set_symbol_value_text (argp, text);
                }
              return type == M4_TOKEN_COMMA;
  @@ -361,7 +361,7 @@
   
          if (!groks_macro_args && m4_is_symbol_value_func (&token))
            {
  -           VALUE_HANDLE (&token) = NULL;
  +           VALUE_MODULE (&token) = NULL;
              m4_set_symbol_value_text (&token, "");
            }
          tokenp = (m4_symbol_value *) obstack_copy (arguments, &token,
  Index: m4/module.c
  ===================================================================
  RCS file: /sources/m4/m4/m4/module.c,v
  retrieving revision 1.54
  diff -u -u -r1.54 module.c
  --- m4/module.c 7 Sep 2007 22:37:47 -0000 1.54
  +++ m4/module.c 12 Sep 2007 01:14:14 -0000
  @@ -82,7 +82,7 @@
   #define MODULE_SELF_NAME     "!myself!"
   
   static const char*  module_dlerror (void);
  -static int       module_remove  (m4 *context, m4_module *handle,
  +static int       module_remove  (m4 *context, m4_module *module,
                                    m4_obstack *obs);
   
   static void      install_builtin_table (m4*, m4_module *);
  @@ -94,13 +94,13 @@
   static lt_dlinterface_id iface_id = NULL;
   
   const char *
  -m4_get_module_name (const m4_module *m4_handle)
  +m4_get_module_name (const m4_module *module)
   {
     const lt_dlinfo *info;
   
  -  assert (m4_handle && m4_handle->handle);
  +  assert (module && module->handle);
   
  -  info = lt_dlgetinfo (m4_handle->handle);
  +  info = lt_dlgetinfo (module->handle);
   
     return info ? info->name : NULL;
   }
  @@ -109,19 +109,19 @@
   m4_module_import (m4 *context, const char *module_name,
                  const char *symbol_name, m4_obstack *obs)
   {
  -  m4_module *        handle          = m4__module_find (module_name);
  +  m4_module *        module          = m4__module_find (module_name);
     void *     symbol_address  = NULL;
   
     /* Try to load the module if it is not yet available (errors are
        diagnosed by m4_module_load).  */
     /* FIXME - should this use m4__module_open instead, to avoid
        polluting the symbol table when importing a function?  */
  -  if (!handle)
  -    handle = m4_module_load (context, module_name, obs);
  +  if (!module)
  +    module = m4_module_load (context, module_name, obs);
   
  -  if (handle)
  +  if (module)
       {
  -      symbol_address = lt_dlsym (handle->handle, symbol_name);
  +      symbol_address = lt_dlsym (module->handle, symbol_name);
   
         if (!symbol_address)
        m4_error (context, 0, 0, _("cannot load symbol `%s' from module `%s'"),
  @@ -132,14 +132,14 @@
   }
   
   static void
  -install_builtin_table (m4 *context, m4_module *handle)
  +install_builtin_table (m4 *context, m4_module *module)
   {
     const m4_builtin *bp;
   
     assert (context);
  -  assert (handle);
  +  assert (module);
   
  -  bp = (m4_builtin *) lt_dlsym (handle->handle, BUILTIN_SYMBOL);
  +  bp = (m4_builtin *) lt_dlsym (module->handle, BUILTIN_SYMBOL);
     if (bp)
       {
         for (; bp->name != NULL; bp++)
  @@ -155,7 +155,7 @@
          assert ((bp->flags & ~M4_BUILTIN_FLAGS_MASK) == 0);
   
          m4_set_symbol_value_builtin (value, bp);
  -       VALUE_HANDLE   (value)        = handle;
  +       VALUE_MODULE   (value)        = module;
          VALUE_FLAGS    (value)        = bp->flags;
          VALUE_MIN_ARGS (value)        = bp->min_args;
          VALUE_MAX_ARGS (value)        = bp->max_args;
  @@ -173,19 +173,19 @@
   
         m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                        _("module %s: builtins loaded"),
  -                     m4_get_module_name (handle));
  +                     m4_get_module_name (module));
       }
   }
   
   static void
  -install_macro_table (m4 *context, m4_module *handle)
  +install_macro_table (m4 *context, m4_module *module)
   {
     const m4_macro *mp;
   
     assert (context);
  -  assert (handle);
  +  assert (module);
   
  -  mp = (const m4_macro *) lt_dlsym (handle->handle, MACRO_SYMBOL);
  +  mp = (const m4_macro *) lt_dlsym (module->handle, MACRO_SYMBOL);
   
     if (mp)
       {
  @@ -194,53 +194,53 @@
          m4_symbol_value *value = m4_symbol_value_create ();
   
          m4_set_symbol_value_text (value, xstrdup (mp->value));
  -       VALUE_HANDLE (value) = handle;
  +       VALUE_MODULE (value) = module;
   
          m4_symbol_pushdef (M4SYMTAB, mp->name, value);
        }
   
         m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                        _("module %s: macros loaded"),
  -                     m4_get_module_name (handle));
  +                     m4_get_module_name (module));
       }
   }
   
   m4_module *
   m4_module_load (m4 *context, const char *name, m4_obstack *obs)
   {
  -  m4_module *handle = m4__module_open (context, name, obs);
  +  m4_module *module = m4__module_open (context, name, obs);
   
  -  if (handle && handle->refcount == 1)
  +  if (module && module->refcount == 1)
       {
  -      install_builtin_table (context, handle);
  -      install_macro_table (context, handle);
  +      install_builtin_table (context, module);
  +      install_macro_table (context, module);
       }
   
  -  return handle;
  +  return module;
   }
   
  -/* Make the module HANDLE resident.  Return NULL on success, or a
  +/* Make the module MODULE resident.  Return NULL on success, or a
      pre-translated error string on failure.  */
   const char *
  -m4_module_makeresident (m4_module *m4_handle)
  +m4_module_makeresident (m4_module *module)
   {
  -  assert (m4_handle);
  -  return lt_dlmakeresident (m4_handle->handle) ? module_dlerror () : NULL;
  +  assert (module);
  +  return lt_dlmakeresident (module->handle) ? module_dlerror () : NULL;
   }
   
   /* Unload a module.  */
   void
   m4_module_unload (m4 *context, const char *name, m4_obstack *obs)
   {
  -  m4_module *        handle  = NULL;
  +  m4_module *        module  = NULL;
     int                errors  = 0;
   
     assert (context);
   
     if (name)
  -    handle = m4__module_find (name);
  +    module = m4__module_find (name);
   
  -  if (!handle)
  +  if (!module)
       {
         const char *error_msg = _("module not loaded");
   
  @@ -248,7 +248,7 @@
         ++errors;
       }
     else
  -    errors = module_remove (context, handle, obs);
  +    errors = module_remove (context, module, obs);
   
     if (errors)
       {
  @@ -266,8 +266,8 @@
     /* Shortcut.  If we've already associated our wrapper with this
        handle, then we've validated the handle in the past, and don't
        need to waste any time on additional lt_dlsym calls.  */
  -  m4_module *m4_handle = (m4_module *) lt_dlcaller_get_data (iface_id, 
handle);
  -  if (m4_handle)
  +  m4_module *module = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  +  if (module)
       return 0;
   
     /* A valid m4 module must provide at least one of these symbols.  */
  @@ -281,9 +281,9 @@
   /* Return successive loaded modules that pass the interface test registered
      with the interface id.  */
   m4_module *
  -m4__module_next (m4_module *m4_handle)
  +m4__module_next (m4_module *module)
   {
  -  lt_dlhandle handle = m4_handle ? m4_handle->handle : NULL;
  +  lt_dlhandle handle = module ? module->handle : NULL;
     assert (iface_id);
   
     /* Resident modules still show up in the lt_dlhandle_iterate loop
  @@ -293,11 +293,11 @@
         handle = lt_dlhandle_iterate (iface_id, handle);
         if (!handle)
        return NULL;
  -      m4_handle = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  +      module = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
       }
  -  while (!m4_handle);
  -  assert (m4_handle->handle == handle);
  -  return m4_handle;
  +  while (!module);
  +  assert (module->handle == handle);
  +  return module;
   }
   
   /* Return the first loaded module that passes the registered interface test
  @@ -306,16 +306,16 @@
   m4__module_find (const char *name)
   {
     lt_dlhandle handle;
  -  m4_module *m4_handle;
  +  m4_module *module;
     assert (iface_id);
   
     handle = lt_dlhandle_fetch (iface_id, name);
     if (!handle)
       return NULL;
  -  m4_handle = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  -  if (m4_handle)
  -    assert (m4_handle->handle == handle);
  -  return m4_handle;
  +  module = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  +  if (module)
  +    assert (module->handle == handle);
  +  return module;
   }
   
   
  @@ -389,7 +389,7 @@
   m4__module_open (m4 *context, const char *name, m4_obstack *obs)
   {
     lt_dlhandle                handle          = lt_dlopenext (name);
  -  m4_module *                m4_handle       = NULL;
  +  m4_module *                module          = NULL;
     m4_module_init_func *      init_func       = NULL;
   
     assert (context);
  @@ -414,22 +414,22 @@
                        _("module %s: opening file `%s'"),
                        name ? name : MODULE_SELF_NAME, info->filename);
   
  -      /* Provide the m4_module correpsonding to the lt_dlhandle, if
  +      /* Provide the m4_module corresponding to the lt_dlhandle, if
         not yet created.  */
  -      m4_handle = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  -      if (!m4_handle)
  +      module = (m4_module *) lt_dlcaller_get_data (iface_id, handle);
  +      if (!module)
        {
          void *old;
          const char *err;
   
  -       m4_handle = (m4_module *) xzalloc (sizeof *m4_handle);
  -       m4_handle->handle = handle;
  +       module = (m4_module *) xzalloc (sizeof *module);
  +       module->handle = handle;
   
          /* clear out any stale errors, since we have to use
             lt_dlerror to distinguish between success and
             failure.  */
          lt_dlerror ();
  -       old = lt_dlcaller_set_data (iface_id, handle, m4_handle);
  +       old = lt_dlcaller_set_data (iface_id, handle, module);
          assert (!old);
          err = lt_dlerror ();
          if (err)
  @@ -439,11 +439,11 @@
   
         /* Find and run any initializing function in the opened module,
         each time the module is opened.  */
  -      m4_handle->refcount++;
  +      module->refcount++;
         init_func = (m4_module_init_func *) lt_dlsym (handle, INIT_SYMBOL);
         if (init_func)
        {
  -       init_func (context, m4_handle, obs);
  +       init_func (context, module, obs);
   
          m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                            _("module %s: init hook called"), name);
  @@ -466,23 +466,23 @@
                name, module_dlerror ());
       }
   
  -  return m4_handle;
  +  return module;
   }
   
   void
   m4__module_exit (m4 *context)
   {
  -  m4_module *        handle  = m4__module_next (NULL);
  +  m4_module *        module  = m4__module_next (NULL);
     int                errors  = 0;
   
  -  while (handle && !errors)
  +  while (module && !errors)
       {
  -      m4_module *      pending       = handle;
  +      m4_module *      pending       = module;
   
         /* If we are about to unload the final reference, move on to the
  -      next handle before we unload the current one.  */
  +      next module before we unload the current one.  */
         if (pending->refcount <= 1)
  -     handle = m4__module_next (handle);
  +     module = m4__module_next (module);
   
         errors = module_remove (context, pending, NULL);
       }
  @@ -515,12 +515,12 @@
     return dlerror;
   }
   
  -/* Close one reference to the module M4_HANDLE, and output to OBS any
  +/* Close one reference to the module MODULE, and output to OBS any
      information from the finish hook of the module.  If no references
  -   to M4_HANDLE remain, also remove all symbols and other memory
  +   to MODULE remain, also remove all symbols and other memory
      associated with the module.  */
   static int
  -module_remove (m4 *context, m4_module *m4_handle, m4_obstack *obs)
  +module_remove (m4 *context, m4_module *module, m4_obstack *obs)
   {
     const lt_dlinfo *          info;
     int                                errors  = 0;
  @@ -530,11 +530,11 @@
     bool                               resident = false;
     m4_module_finish_func *    finish_func;
   
  -  assert (m4_handle && m4_handle->handle);
  +  assert (module && module->handle);
   
     /* Be careful when closing myself.  */
  -  handle = m4_handle->handle;
  -  name = m4_get_module_name (m4_handle);
  +  handle = module->handle;
  +  name = m4_get_module_name (module);
     name = xstrdup (name ? name : MODULE_SELF_NAME);
   
     info = lt_dlgetinfo (handle);
  @@ -550,13 +550,13 @@
       }
   #endif /* DEBUG_MODULES */
   
  -  if (m4_handle->refcount-- == 1)
  +  if (module->refcount-- == 1)
       {
         /* Remove the table references only when ref_count is *exactly*
         equal to 1.  If module_close is called again on a
         resident module after the references have already been
         removed, we needn't try to remove them again!  */
  -      m4__symtab_remove_module_references (M4SYMTAB, m4_handle);
  +      m4__symtab_remove_module_references (M4SYMTAB, module);
   
         m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                        _("module %s: symbols unloaded"), name);
  @@ -566,7 +566,7 @@
     finish_func = (m4_module_finish_func *) lt_dlsym (handle, FINISH_SYMBOL);
     if (finish_func)
       {
  -      finish_func (context, m4_handle, obs);
  +      finish_func (context, module, obs);
   
         m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                        _("module %s: finish hook called"), name);
  @@ -585,7 +585,7 @@
        m4_error (context, EXIT_FAILURE, 0,
                  _("unable to close module `%s': %s"), name,
                  module_dlerror());
  -      assert (old == m4_handle);
  +      assert (old == module);
         lt_dlclose (handle);
         m4_debug_message (context, M4_DEBUG_TRACE_MODULE,
                        _("module %s: resident module not closed"), name);
  @@ -607,7 +607,7 @@
       m4_error (context, EXIT_FAILURE, 0, _("cannot close module `%s': %s"),
              name, module_dlerror ());
     if (last_reference)
  -    free (m4_handle);
  +    free (module);
   
     DELETE (name);
   
  @@ -618,16 +618,16 @@
   /* Below here are the accessor functions behind fast macros.  Declare
      them last, so the rest of the file can use the macros.  */
   
  -/* Return the current refcount, or times that module HANDLE has been
  +/* Return the current refcount, or times that module MODULE has been
      opened.  */
   #undef m4_module_refcount
   int
  -m4_module_refcount (const m4_module *handle)
  +m4_module_refcount (const m4_module *module)
   {
     const lt_dlinfo *info;
  -  assert (handle);
  -  info = lt_dlgetinfo (handle->handle);
  +  assert (module);
  +  info = lt_dlgetinfo (module->handle);
     assert (info);
  -  assert (handle->refcount <= info->ref_count);
  -  return handle->refcount;
  +  assert (module->refcount <= info->ref_count);
  +  return module->refcount;
   }
  Index: m4/symtab.c
  ===================================================================
  RCS file: /sources/m4/m4/m4/symtab.c,v
  retrieving revision 1.76
  diff -u -u -r1.76 symtab.c
  --- m4/symtab.c 7 Sep 2007 20:59:36 -0000 1.76
  +++ m4/symtab.c 12 Sep 2007 01:14:14 -0000
  @@ -139,15 +139,15 @@
     return symbol;
   }
   
  -/* Remove every symbol that references the given module handle from
  +/* Remove every symbol that references the given module from
      the symbol table.  */
   void
   m4__symtab_remove_module_references (m4_symbol_table *symtab,
  -                                  m4_module *handle)
  +                                  m4_module *module)
   {
     m4_hash_iterator *place = 0;
   
  -  assert (handle);
  +  assert (module);
   
      /* Traverse each symbol name in the hash table.  */
     while ((place = m4_get_hash_iterator_next (symtab->table, place)))
  @@ -163,7 +163,7 @@
            {
              m4_symbol_value *next = VALUE_NEXT (data);
   
  -           if (VALUE_HANDLE (next) == handle)
  +           if (VALUE_MODULE (next) == module)
                {
                  VALUE_NEXT (data) = VALUE_NEXT (next);
   
  @@ -175,7 +175,7 @@
            }
   
          /* Purge the live reference if necessary.  */
  -       if (SYMBOL_HANDLE (symbol) == handle)
  +       if (SYMBOL_MODULE (symbol) == module)
            m4_symbol_popdef (symtab, m4_get_hash_iterator_key (place));
        }
       }
  @@ -509,10 +509,10 @@
       obstack_grow (obs, "...", 3);
     if (quote)
       obstack_grow (obs, rquote, strlen (rquote));
  -  if (module && VALUE_HANDLE (value))
  +  if (module && VALUE_MODULE (value))
       {
         obstack_1grow (obs, '{');
  -      text = m4_get_module_name (VALUE_HANDLE (value));
  +      text = m4_get_module_name (VALUE_MODULE (value));
         obstack_grow (obs, text, strlen (text));
         obstack_1grow (obs, '}');
       }
  @@ -709,8 +709,8 @@
   {
     m4_symbol_value *value     = m4_get_symbol_value (symbol);
     int                   flags        = value ? SYMBOL_FLAGS (symbol) : 0;
  -  m4_module *      handle    = value ? SYMBOL_HANDLE (symbol) : NULL;
  -  const char *     module_name       = handle ? m4_get_module_name (handle) 
: "NONE";
  +  m4_module *      module    = value ? SYMBOL_MODULE (symbol) : NULL;
  +  const char *     module_name       = module ? m4_get_module_name (module) 
: "NONE";
   
     fprintf (stderr, "%10s: (%d%s) %s=", module_name, flags,
           m4_get_symbol_traced (symbol) ? "!" : "", name);
  Index: modules/load.c
  ===================================================================
  RCS file: /sources/m4/m4/modules/load.c,v
  retrieving revision 1.26
  diff -u -u -r1.26 load.c
  --- modules/load.c 7 Sep 2007 22:37:47 -0000 1.26
  +++ modules/load.c 12 Sep 2007 01:14:14 -0000
  @@ -76,10 +76,10 @@
      unload is in progress.  */
   M4INIT_HANDLER (load)
   {
  -  const char *err = m4_module_makeresident (handle);
  +  const char *err = m4_module_makeresident (module);
     if (err)
       m4_error (context, 0, 0, _("cannot make module `%s' resident: %s"),
  -           m4_get_module_name (handle), err);
  +           m4_get_module_name (module), err);
   }
   
   
  @@ -95,17 +95,17 @@
   {
     /* The expansion of this builtin is a comma separated list of
        loaded modules.  */
  -  m4_module *handle = m4__module_next (NULL);
  +  m4_module *module = m4__module_next (NULL);
   
  -  if (handle)
  +  if (module)
       do
         {
  -     m4_shipout_string (context, obs, m4_get_module_name (handle), 0, true);
  +     m4_shipout_string (context, obs, m4_get_module_name (module), 0, true);
   
  -     if ((handle = m4__module_next (handle)))
  +     if ((module = m4__module_next (module)))
          obstack_1grow (obs, ',');
         }
  -    while (handle);
  +    while (module);
   }
   
   /**
  @@ -113,8 +113,8 @@
    **/
   M4BUILTIN_HANDLER (refcount)
   {
  -  m4_module *handle = m4__module_find (M4ARG (1));
  -  m4_shipout_int (obs, handle ? m4_module_refcount (handle) : 0);
  +  m4_module *module = m4__module_find (M4ARG (1));
  +  m4_shipout_int (obs, module ? m4_module_refcount (module) : 0);
   }
   
   /**
  Index: modules/m4.c
  ===================================================================
  RCS file: /sources/m4/m4/modules/m4.c,v
  retrieving revision 1.113
  diff -u -u -r1.113 m4.c
  --- modules/m4.c 6 Sep 2007 22:58:26 -0000 1.113
  +++ modules/m4.c 12 Sep 2007 01:14:14 -0000
  @@ -140,10 +140,10 @@
      progress.  */
   M4INIT_HANDLER (m4)
   {
  -  const char *err = m4_module_makeresident (handle);
  +  const char *err = m4_module_makeresident (module);
     if (err)
       m4_error (context, 0, 0, _("cannot make module `%s' resident: %s"),
  -           m4_get_module_name (handle), err);
  +           m4_get_module_name (module), err);
   }
   
   
  Index: modules/perl.c
  ===================================================================
  RCS file: /sources/m4/m4/modules/perl.c,v
  retrieving revision 1.19
  diff -u -u -r1.19 perl.c
  --- modules/perl.c 7 Aug 2007 03:15:29 -0000 1.19
  +++ modules/perl.c 12 Sep 2007 01:14:14 -0000
  @@ -77,8 +77,8 @@
     const lt_dlinfo *info = 0;
     char *embedding[] = { "", "-e", "0" };
   
  -  if (handle)
  -    info = lt_dlgetinfo (handle);
  +  if (module)
  +    info = lt_dlgetinfo (module);
   
     /* Start up a perl parser, when loaded for the first time.  */
     if (info && (info->ref_count == 1))
  @@ -95,8 +95,8 @@
   {
     const lt_dlinfo *info = 0;
   
  -  if (handle)
  -    info = lt_dlgetinfo (handle);
  +  if (module)
  +    info = lt_dlgetinfo (module);
   
     /* Recycle the perl parser, when unloaded for the last time.  */
     if (info && (info->ref_count == 1))
  Index: modules/shadow.c
  ===================================================================
  RCS file: /sources/m4/m4/modules/shadow.c,v
  retrieving revision 1.18
  diff -u -u -r1.18 shadow.c
  --- modules/shadow.c 6 Sep 2007 22:58:26 -0000 1.18
  +++ modules/shadow.c 12 Sep 2007 01:14:14 -0000
  @@ -68,7 +68,7 @@
   M4INIT_HANDLER (shadow)
   {
     const char *s = "Shadow module loaded.";
  -  int refcount = m4_module_refcount (handle);
  +  int refcount = m4_module_refcount (module);
   
     /* Only display the message on first load.  */
     if (obs && refcount == 1)
  Index: src/freeze.c
  ===================================================================
  RCS file: /sources/m4/m4/src/freeze.c,v
  retrieving revision 1.70
  diff -u -u -r1.70 freeze.c
  --- src/freeze.c 7 Sep 2007 20:59:36 -0000 1.70
  +++ src/freeze.c 12 Sep 2007 01:14:14 -0000
  @@ -131,14 +131,14 @@
      reloaded from the frozen file.  libltdl stores handles in a push
      down stack, so we need to dump them in the reverse order to that.  */
   static void
  -produce_module_dump (FILE *file, m4_module *handle)
  +produce_module_dump (FILE *file, m4_module *module)
   {
  -  const char *name = m4_get_module_name (handle);
  +  const char *name = m4_get_module_name (module);
     size_t len = strlen (name);
   
  -  handle = m4__module_next (handle);
  -  if (handle)
  -    produce_module_dump (file, handle);
  +  module = m4__module_next (module);
  +  if (module)
  +    produce_module_dump (file, module);
   
     fprintf (file, "M%zu\n", len);
     produce_mem_dump (file, name, len);
  @@ -159,8 +159,8 @@
   dump_symbol_CB (m4_symbol_table *symtab, const char *symbol_name,
                m4_symbol *symbol, void *userdata)
   {
  -  m4_module *   handle               = SYMBOL_HANDLE (symbol);
  -  const char   *module_name  = handle ? m4_get_module_name (handle) : NULL;
  +  m4_module *   module               = SYMBOL_MODULE (symbol);
  +  const char   *module_name  = module ? m4_get_module_name (module) : NULL;
     FILE *     file            = (FILE *) userdata;
     size_t     symbol_len      = strlen (symbol_name);
     size_t     module_len      = module_name ? strlen (module_name) : 0;
  @@ -170,13 +170,13 @@
         const char *text = m4_get_symbol_text (symbol);
         size_t text_len = strlen (text);
         fprintf (file, "T%zu,%zu", symbol_len, text_len);
  -      if (handle)
  +      if (module)
        fprintf (file, ",%zu", module_len);
         fputc ('\n', file);
   
         produce_mem_dump (file, symbol_name, symbol_len);
         produce_mem_dump (file, text, text_len);
  -      if (handle)
  +      if (module)
        produce_mem_dump (file, module_name, module_len);
         fputc ('\n', file);
       }
  @@ -189,13 +189,13 @@
         bp_len = strlen (bp->name);
   
         fprintf (file, "F%zu,%zu", symbol_len, bp_len);
  -      if (handle)
  +      if (module)
        fprintf (file, ",%zu", module_len);
         fputc ('\n', file);
   
         produce_mem_dump (file, symbol_name, symbol_len);
         produce_mem_dump (file, bp->name, bp_len);
  -      if (handle)
  +      if (module)
        produce_mem_dump (file, module_name, module_len);
         fputc ('\n', file);
       }
  @@ -549,18 +549,18 @@
   
          /* Enter a macro having a builtin function as a definition.  */
          {
  -         m4_module *handle = NULL;
  +         m4_module *module = NULL;
            m4_symbol_value *token;
   
            if (number[2] > 0)
  -           handle = m4__module_find (string[2]);
  -         token = m4_builtin_find_by_name (handle, string[1]);
  +           module = m4__module_find (string[2]);
  +         token = m4_builtin_find_by_name (module, string[1]);
   
            if (token == NULL)
              {
                token = xzalloc (sizeof *token);
                m4_set_symbol_value_placeholder (token, xstrdup (string[1]));
  -             VALUE_HANDLE (token) = handle;
  +             VALUE_MODULE (token) = module;
                VALUE_MIN_ARGS (token) = 0;
                VALUE_MAX_ARGS (token) = -1;
              }
  @@ -750,13 +750,13 @@
          /* Enter a macro having an expansion text as a definition.  */
          {
            m4_symbol_value *token = xzalloc (sizeof *token);
  -         m4_module *handle = NULL;
  +         m4_module *module = NULL;
   
            if (number[2] > 0)
  -           handle = m4__module_find (string[2]);
  +           module = m4__module_find (string[2]);
   
            m4_set_symbol_value_text (token, xstrdup (string[1]));
  -         VALUE_HANDLE (token) = handle;
  +         VALUE_MODULE (token) = module;
            VALUE_MAX_ARGS (token) = -1;
   
            m4_symbol_pushdef (M4SYMTAB, string[0], token);
-- 
  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912 
_________________________________________________________
This patch notification generated by vcsapply version 1.0
http://savannah.gnu.org/projects/cvs-utils

Attachment: pgpWSjl_o3TAk.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]