| 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 | |
|---|
| 12 | Basic information for setting up a module: |
|---|
| 13 | In the module's main file you need two global variables of name 'mheader' |
|---|
| 14 | and 'mdepends'. Additionally you may have functions to be called at load |
|---|
| 15 | time and at unload time. |
|---|
| 16 | |
|---|
| 17 | You will need to include 'ithildin.h' in your module, then do the following: |
|---|
| 18 | |
|---|
| 19 | MODULE_REGISTER("your module version", "your load function", |
|---|
| 20 | "your unload function); |
|---|
| 21 | |
|---|
| 22 | the first value is optional and specifies the version of your module. if it |
|---|
| 23 | is empty it should be the empty string "" |
|---|
| 24 | the second and third values are also optional, and specify the symbol names |
|---|
| 25 | of functions to call when the module is loaded and unloaded. They may be |
|---|
| 26 | empty if no such functions exist. You must *NOT* use init() and fini() for |
|---|
| 27 | this! |
|---|
| 28 | |
|---|
| 29 | Following that, if your module has any dependencies, you should place them |
|---|
| 30 | in a comment that looks like this: |
|---|
| 31 | /* |
|---|
| 32 | @DEPENDENCIES@: module1 module2 module3 ... |
|---|
| 33 | */ |
|---|
| 34 | Several lines of that form are acceptable. |
|---|
| 35 | |
|---|
| 36 | If you need to find a module symbol, you can either use 'module_symbol(mod, |
|---|
| 37 | name)' if you have the module's structure, or 'lookup_module_symbol(modname, |
|---|
| 38 | symname)' if you don't have it. |
|---|
| 39 | |
|---|
| 40 | The initialization function should return an integer value of non-zero if |
|---|
| 41 | loading was successful, otherwise a value of 0 indicating that the module |
|---|
| 42 | was NOT successful loading (the module will be closed and dropped in this |
|---|
| 43 | case, and the unloader *WILL NOT* be called) |
|---|