m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/modules/load.c,v


From: Eric Blake
Subject: Changes to m4/modules/load.c,v
Date: Fri, 07 Sep 2007 22:37:48 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      07/09/07 22:37:47

Index: modules/load.c
===================================================================
RCS file: /sources/m4/m4/modules/load.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- modules/load.c      6 Sep 2007 22:58:26 -0000       1.25
+++ modules/load.c      7 Sep 2007 22:37:47 -0000       1.26
@@ -34,8 +34,9 @@
 
           function     macros  blind   side    minargs maxargs */
 #define builtin_functions                                      \
-  BUILTIN (m4modules,  false,  false,  false,  0,      0  )    \
   BUILTIN (load,       false,  true,   false,  1,      1  )    \
+  BUILTIN (m4modules,  false,  false,  false,  0,      0  )    \
+  BUILTIN (refcount,   false,  true,   false,  1,      1  )    \
   BUILTIN (unload,     false,  true,   false,  1,      1  )    \
 
 
@@ -94,7 +95,7 @@
 {
   /* The expansion of this builtin is a comma separated list of
      loaded modules.  */
-  lt_dlhandle handle = m4__module_next (NULL);
+  m4_module *handle = m4__module_next (NULL);
 
   if (handle)
     do
@@ -108,6 +109,15 @@
 }
 
 /**
+ * refcount(module)
+ **/
+M4BUILTIN_HANDLER (refcount)
+{
+  m4_module *handle = m4__module_find (M4ARG (1));
+  m4_shipout_int (obs, handle ? m4_module_refcount (handle) : 0);
+}
+
+/**
  * load(MODULE-NAME)
  **/
 M4BUILTIN_HANDLER (load)




reply via email to

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