// filename.h: short description MACRO GUARD STRUCTURE DECLARATIONS, INCLUDING: struct ModName_State; typedef struct ModName_State ModName_State; INCLUDES NEEDED FOR PROTOTYPES MACRO INVOCATIONS AND DEFINITIONS STRUCTURE DEFINITIONS (or see implementation file) METHODS, INCLUDING: ModName_State *ModName_Initialize(AI_State *ai, /* ... */); void ModName_Finalize(ModName_State *bla); #endif // FILENAME_HFurther, all modules that define types should have the following macro invocation for each type:
DECLARE_ADATA_CONVERTERS(...)And optionally (if the type is to be lua-accessible):
DECLARE_LUA_STACKOPS(...)Plus the following method:
int ModName_ConvertType(lua_State *L)Methods are of the form Type_MethodName(ModName_State * bla, /* ... */). If the module defines an update function, it should be of the form void ModName_Update(ModName_State *bla). Header files (should) only be included in other headers if they declare types that are referred to in those files.
// filename.c
#include "filename.h"
OTHER INCLUDES
STRUCTURE DEFINITIONS (if not in header)
int ModName_ConvertType(lua_State *L)
{}
TAG METHODS
CLASS/LUA METHODS
INITIALIZE/FINALIZE
PUBLIC METHODS
Tag methods are of the form "static int Type_LuaBlaTagMethod(lua_State *L)".
Class Tag methods are of the form "static int Type_BlaClassTagMethod(...)".
Lua methods are of the form "static int Type_MethodName(lua_State *L)".
Class methods are of the form "static int Type_MethodNameMethod(...)".
| Topic StyleConventions . { Edit | Attach | Ref-By | Printable | Diffs | r1.3 | > | r1.2 | > | r1.1 | More } |
|
Revision r1.3 - 06 Sep 2004 - 19:09 GMT - ElminI Parents: WebHome |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding EgoWiki? Send feedback. |