diff options
Diffstat (limited to 'examples/WWW/modules.htm')
-rw-r--r-- | examples/WWW/modules.htm | 347 |
1 files changed, 347 insertions, 0 deletions
diff --git a/examples/WWW/modules.htm b/examples/WWW/modules.htm new file mode 100644 index 00000000..ee668972 --- /dev/null +++ b/examples/WWW/modules.htm @@ -0,0 +1,347 @@ +<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> +<HTML> +<HEAD> +<TITLE>GNU m4 - Modules</TITLE> +<META NAME="AUTHOR" CONTENT="René Seindal"> +<META NAME="GENERATOR" CONTENT="GNU m4 1.4l"> +</HEAD> + <BODY text="#000000" bgcolor="#FFCC99" link="#0000EF" alink="#FF0000" vlink="#51188E"> +<TABLE cellpadding=5 width="100%"> +<TR align=left valign=bottom> +<TD align=center valign=center colspan="3" width="100%" bgcolor="#FF9900"> + +<H1>GNU m4</H1> + +<H2>Modules</H2> + +</TD> + +</TR> + <TR > +<TD align=left valign=top width="15%" bgcolor="#FF9900"> + + + +<TABLE align=left valign=top columns=1> +<TR> +<TD bgcolor="#CC6600"> +<P> +<B>Generel info</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="whatis.htm">What is m4</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="features.htm">Features</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="uses.htm">Uses of m4</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Documentation</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="man/m4_toc.html">Manual</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Source files</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="readme.htm">README</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="todo.htm">TODO</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="news.htm">NEWS</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="changelog.htm">ChangeLog</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="thanks.htm">Contributors</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="m4/">Browse it</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>The Future</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="modules.htm">Modules</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="visions.htm">Visions</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Development</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="lists.htm">Mailing-lists</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="feedback.htm">Feedback</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="download.htm">Download</A></B> +</P> +</FONT> + +</TD> + +</TR> + <TR> +<TD bgcolor="#CC6600"> +<P> +<B>Examples</B> +</P> + +</TD> + +</TR> + <TR> +<TD> + +<FONT size=-1><P> +<B><A HREF="thissite.htm">This site</A></B> +</P> +</FONT> + +</TD> + +</TR> + +</TABLE> + + + + + +</TD> + <TD align=left valign=top width="90%"> + + +<PRE>This directory contains demonstration modules for GNU m4. + +Nothing in this directory is built by default. + +Dynamic modules is a experimental feature of GNU m4. Currently it has +only been certified to work under Linux 2.0. + +Dynamic modules are only available if GNU m4 was configured with +--with-modules and if the dlopen(3) interface is available in the +operating system. + +Implementation details are in ../src/module.c + +A module is a compiled shared object, i.e., modules are written in C and +then compiled. The compiled file can then be loaded into a running m4 +process by calling the builtin "loadmodule". This will give GNU m4 +access to any system feature with a C interface. + +Modules are searched for in M4MODPATH, if set, and in a module directory +defined at configure time, default /usr/local/libexec/m4. + +A module extends GNU m4 by defining new builtins, It can define builtins +with the same names as existing builtins, which will then be +unavailable. A module cannot redefine internal functions of GNU m4, +such as the input parser or argument handling. + +The infrastructure for writing and compiling modules is still a bit +wanting. + +Each module should include the two header files ../src/m4.h and +../src/builtin.h. These will include <ctype.h>, <stdio.h>, +../lib/obstack.h and ../config.h. + +Each module *must* define the symbol "m4_macro_table" as a pointer to a +table of "struct builtin" (defined in m4.h). The table ends with an +entry with name == NULL. The builtins described in the table will be +defined by GNU m4 as were they normal builtins. + +If a module defines the symbol "m4_init_module", it is supposed to be a +function with a prototype of "void m4_init_module(struct obstack *obs)", +and it will be called as soon as the module is loaded. Any non-finished +object left on the obstack will be the expansion of the call of the +builtin "loadmodule". The obstack pointer might be NULL (in the future). + +If a module defines the symbol "m4_finish_module", it is supposed to be +a function with a prototype of "void m4_finish_module(void)", and it +will be called just before GNU m4 exits. This will allow a module to +clean up before exit. There is no way of communicating information to +the user, as GNU m4 exits immeidately afterwards. + +No other symbols will be used by GNU m4. Other external symbols within +the module are private and will not be accessible to GNU m4 or to other +modules. + +Modules are allowed to call external functions already defined within +the GNU m4 sources. Some of these have prototypes in builtin.h. + + +A complete, though silly, example is found in test.c. A more +interesting example is in time.c. + +To try the demos, compile with `make' and run them with the commands as: + + M4MODPATH=`pwd` ../src/m4 time.m4 + + +</PRE> + + +</TD> + +</TR> + +</TABLE> + +</BODY> + + +</HTML> + + |