CVSROOT: /sources/m4
Module name: m4
Changes by: Eric Blake <ericb> 07/09/07 22:37:47
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- doc/m4.texinfo 10 Aug 2007 15:09:46 -0000 1.110
+++ doc/m4.texinfo 7 Sep 2007 22:37:46 -0000 1.111
@@ -236,6 +236,7 @@
* M4modules:: Listing loaded modules
* Load:: Loading additional modules
* Unload:: Removing loaded modules
+* Refcount:: Tracking module references
* Standard Modules:: Standard bundled modules
Macros for text handling
@@ -5485,6 +5486,7 @@
* M4modules:: Listing loaded modules
* Load:: Loading additional modules
* Unload:: Removing loaded modules
+* Refcount:: Tracking module references
* Standard Modules:: Standard bundled modules
@end menu
@@ -5542,7 +5544,7 @@
@section Removing loaded modules
@deffn {Builtin (load)} unload (@var{module-name})
-Any loaded modules that can be listed by the @code{modules} macro can be
+Any loaded modules that can be listed by the @code{m4modules} macro can be
removed by naming them as the @var{module-name} parameter of the
@code{unload} macro. Unloading a module consists of removing all of the
macros it provides from the internal table of visible macros, and
@@ -5562,6 +5564,49 @@
@result{}load,gnu,m4
@end example
[EMAIL PROTECTED] Refcount
[EMAIL PROTECTED] Tracking module references
+
[EMAIL PROTECTED] {Builtin (load)} refcount (@var{module-name})
+This macro expands to an integer representing the number of times
[EMAIL PROTECTED] has been loaded but not yet unloaded. No warning is
+issued, even if @var{module-name} does not represent a valid module.
+
+The macro @code{refcount} is recognized only with parameters.
[EMAIL PROTECTED] deffn
+
+This example demonstrates tracking the reference count of the gnu
+module.
+
[EMAIL PROTECTED] options: -m load
[EMAIL PROTECTED]
+$ @kbd{m4 -m load}
+m4modules
[EMAIL PROTECTED],gnu,m4
+refcount(`gnu')
[EMAIL PROTECTED]
+m4modules
[EMAIL PROTECTED],gnu,m4
+load(`gnu')
[EMAIL PROTECTED]
+refcount(`gnu')
[EMAIL PROTECTED]
+unload(`gnu')
[EMAIL PROTECTED]
+m4modules
[EMAIL PROTECTED],gnu,m4
+refcount(`gnu')
[EMAIL PROTECTED]
+unload(`gnu')
[EMAIL PROTECTED]
+m4modules
[EMAIL PROTECTED],m4
+refcount(`gnu')
[EMAIL PROTECTED]
+refcount(`NoSuchModule')
[EMAIL PROTECTED]
[EMAIL PROTECTED] example
+
@node Standard Modules
@section Standard bundled modules