m4-patches
[Top][All Lists]
Advanced

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

FYI: 32-gary-inter-module-symbols.patch


From: Gary V. Vaughan
Subject: FYI: 32-gary-inter-module-symbols.patch
Date: Thu, 24 Jul 2003 15:25:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030718

Applied to HEAD.
--
  ())_.  Gary V. Vaughan    gary@(oranda.demon.co.uk|gnu.org)
  ( '/   Research Scientist http://www.oranda.demon.co.uk       ,_())____
  / )=   GNU Hacker         http://www.gnu.org/software/libtool  \'      `&
`(_~)_   Tech' Author       http://sources.redhat.com/autobook   =`---d__/
Index: ChangeLog
from  Gary V. Vaughan  <address@hidden>
        Create an export table in modules/m4.c in readiness for beefing up
        the module loader to track module exports and imports.

        * m4/m4module.h (m4_debug_flush_files): Removed prototype.
        * m4/debug.c (m4_debug_flush_files): Moved...
        * modules/m4.c (m4_sysval_flush): ...to here and renamed.
        * modules/gnu.c (builtin_esysval): Use it.
        * m4/m4module.h (m4_export): New type for declaring module symbols
        for export.
        * modules/m4.c (m4_export_table): List symbols exported from this
        module for use by other modules.

2003-07-24  Gary V. Vaughan  <address@hidden>

Index: m4/debug.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/debug.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 debug.c
--- m4/debug.c 23 Jul 2003 11:51:26 -0000 1.16
+++ m4/debug.c 24 Jul 2003 12:16:10 -0000
@@ -134,22 +134,6 @@ set_debug_file (m4 *context, FILE *fp)
     }
 }
 
-/* Serialize files.  Used before executing a system command.  */
-void
-m4_debug_flush_files (m4 *context)
-{
-  FILE *debug_file;
-
-  assert (context);
-
-  debug_file = m4_get_debug_file (context);
-
-  fflush (stdout);
-  fflush (stderr);
-  if (debug_file != NULL && debug_file != stdout && debug_file != stderr)
-    fflush (debug_file);
-}
-
 /* Change the debug output to file NAME.  If NAME is NULL, debug output is
    reverted to stderr, and if empty debug output is discarded.  Return TRUE
    iff the output stream was changed.  */
Index: m4/m4module.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4module.h,v
retrieving revision 1.59
diff -u -p -u -r1.59 m4module.h
--- m4/m4module.h 24 Jul 2003 11:37:44 -0000 1.59
+++ m4/m4module.h 24 Jul 2003 12:16:10 -0000
@@ -55,6 +55,8 @@ typedef struct {
     size_t length;             /* length of the string */
 } m4_string;
 
+typedef lt_dlsymlist m4_export;
+
 
 #define M4BUILTIN(name)                                        \
   static void CONC(builtin_, name)                             \
@@ -262,7 +264,6 @@ enum {
 #define m4_is_debug_bit(C,B)   (BIT_TEST (m4_get_debug_level_opt (C), (B)))
 
 extern int     m4_debug_decode         (m4 *, const char *);
-extern void    m4_debug_flush_files    (m4 *);
 extern boolean m4_debug_set_output     (m4 *, const char *);
 extern void    m4_debug_message_prefix (m4 *);
 
Index: modules/gnu.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/gnu.c,v
retrieving revision 1.27
diff -u -p -u -r1.27 gnu.c
--- modules/gnu.c 24 Jul 2003 11:37:44 -0000 1.27
+++ modules/gnu.c 24 Jul 2003 12:16:10 -0000
@@ -504,14 +504,16 @@ M4BUILTIN_HANDLER (syncoutput)
  * esyscmd(SHELL-COMMAND)
  **/
 
-extern int m4_sysval;
+/* TODO:  Import these through the m4_export list of m4 module.  */
+extern int  m4_sysval;
+extern void m4_sysval_flush (m4 *);
 
 M4BUILTIN_HANDLER (esyscmd)
 {
   FILE *pin;
   int ch;
 
-  m4_debug_flush_files (context);
+  m4_sysval_flush (context);
   pin = popen (M4ARG (1), "r");
   if (pin == NULL)
     {
Index: modules/m4.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/m4.c,v
retrieving revision 1.49
diff -u -p -u -r1.49 m4.c
--- modules/m4.c 24 Jul 2003 11:37:44 -0000 1.49
+++ modules/m4.c 24 Jul 2003 12:16:11 -0000
@@ -45,13 +45,25 @@ extern int errno;
 #endif
 
 /* Rename exported symbols for dlpreload()ing.  */
+#define m4_export_table                m4_LTX_m4_export_table
 #define m4_builtin_table       m4_LTX_m4_builtin_table
 
+/* Exit code from last "syscmd" command.  */
+int m4_sysval = 0;
+void m4_sysval_flush (m4 *context);
+
+m4_export m4_export_table[] = {
+  { "m4_sysval",               &m4_sysval },
+  { "m4_sysval_flush",         &m4_sysval_flush },
+
+  { NULL,                      NULL }
+};
+
 /* Maintain each of the builtins implemented in this modules along
    with their details in a single table for easy maintenance.
 
                function        macros  blind minargs maxargs */
-#define builtin_functions                      \
+#define builtin_functions                                      \
        BUILTIN(changecom,      FALSE,  FALSE,  1,      3  )    \
        BUILTIN(changequote,    FALSE,  FALSE,  1,      3  )    \
        BUILTIN(decr,           FALSE,  TRUE,   2,      2  )    \
@@ -338,12 +350,19 @@ M4BUILTIN_HANDLER (defn)
 /* This section contains macros to handle the builtins "syscmd"
    and "sysval".  */
 
-/* Exit code from last "syscmd" command (also used by gnu module).  */
-int m4_sysval = 0;
+void
+m4_sysval_flush (m4 *context)
+{
+  FILE *debug_file = m4_get_debug_file (context);
+
+  if (debug_file != stdout) fflush (stdout);
+  if (debug_file != stderr) fflush (stderr);
+  if (debug_file != NULL)   fflush (debug_file);
+}
 
 M4BUILTIN_HANDLER (syscmd)
 {
-  m4_debug_flush_files (context);
+  m4_sysval_flush (context);
   m4_sysval = system (M4ARG (1));
 }
 

reply via email to

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