| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Rarely will you write a module that only contains functions. It is common to also provide variables which can be used to control the behavior of the function, or store the results of the function being executed. The actual C variable types are the same for modules and internal XEmacs primitives, and the declaration of the variables is identical.
See (internals)Adding Global Lisp Variables section ‘Adding Global Lisp Variables’ in XEmacs Internals Manual, for more information on variables and naming conventions.
Once your variables are defined, you need to initialize them and make
the Lisp reader aware of them. This is done in the
vars_of_module initialization function using special XEmacs
macros such as DEFVAR_LISP, DEFVAR_BOOL, DEFVAR_INT
etc. The best way to see how to use these macros is to look at existing
source code, or read the internals manual.
Below is a small example which declares and initializes two variables. You will note that this code takes into account the fact that this module may very well be compiled into XEmacs itself. This is a prudent thing to do.
|
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on September 26, 2026 using texi2html 1.82.