source: branches/ithildin-1.1/doc/module.txt @ 490

Revision 490, 1.7 KB checked in by wd, 8 years ago (diff)

Add Id/Rev? keywords.

  • Property svn:keywords set to Id Rev
Line 
1###############################################################################
2#
3# module.txt: basic instructions on creating modules
4#
5# Copyright 2002 the Ithildin Project.
6# See the COPYING file for more information on licensing and use.
7#
8# $Id$
9#
10###############################################################################
11
12Basic information for setting up a module:
13In the module's main file you need two global variables of name 'mheader'
14and 'mdepends'.  Additionally you may have functions to be called at load
15time and at unload time.
16
17You will need to include 'ithildin.h' in your module, then do the following:
18
19MODULE_REGISTER("your module version", "your load function",
20"your unload function);
21
22the first value is optional and specifies the version of your module.  if it
23is empty it should be the empty string ""
24the second and third values are also optional, and specify the symbol names
25of functions to call when the module is loaded and unloaded.  They may be
26empty if no such functions exist.  You must *NOT* use init() and fini() for
27this!
28
29Following that, if your module has any dependencies, you should place them
30in a comment that looks like this:
31/*
32@DEPENDENCIES@: module1 module2 module3 ...
33*/
34Several lines of that form are acceptable.
35
36If you need to find a module symbol, you can either use 'module_symbol(mod,
37name)' if you have the module's structure, or 'lookup_module_symbol(modname,
38symname)' if you don't have it.
39
40The initialization function should return an integer value of non-zero if
41loading was successful, otherwise a value of 0 indicating that the module
42was NOT successful loading (the module will be closed and dropped in this
43case, and the unloader *WILL NOT* be called)
Note: See TracBrowser for help on using the repository browser.