diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/extern.h | 2 | ||||
| -rw-r--r-- | include/modules.h | 12 | ||||
| -rw-r--r-- | include/services.h | 26 | ||||
| -rw-r--r-- | include/version.sh | 21 |
4 files changed, 28 insertions, 33 deletions
diff --git a/include/extern.h b/include/extern.h index 68d94efe6..0261abfdf 100644 --- a/include/extern.h +++ b/include/extern.h @@ -653,7 +653,7 @@ E u_int32_t getrandom32(void); /**** modules.c ****/ E void moduleCallBackRun(void); -E void moduleCleanStruct(ModuleData * moduleData[]); +E void moduleCleanStruct(ModuleData **moduleData); /**** news.c ****/ diff --git a/include/modules.h b/include/modules.h index d240ab79b..500d5e025 100644 --- a/include/modules.h +++ b/include/modules.h @@ -220,12 +220,14 @@ int moduleAddCallback(char *name,time_t when,int (*func)(int argc, char *argv[]) void moduleDelCallback(char *name); void moduleCallBackRun(void); -char *moduleGetData(ModuleData *md[], char *key); /* Get the value for this key from this struct */ -int moduleAddData(ModuleData *md[], char *key, char *value); /* Set the value for this key for this struct */ -void moduleDelData(ModuleData *md[], char *key); /* Delete this key/value pair */ -void moduleDelAllData(ModuleData *md[]); /* Delete all key/value pairs for this module for this struct */ -void moduleCleanStruct(ModuleData * moduleData[]); /* Clean a moduleData hash */ +char *moduleGetData(ModuleData **md, char *key); /* Get the value for this key from this struct */ +int moduleAddData(ModuleData **md, char *key, char *value); /* Set the value for this key for this struct */ +void moduleDelData(ModuleData **md, char *key); /* Delete this key/value pair */ +void moduleDelAllData(ModuleData **md); /* Delete all key/value pairs for this module for this struct */ +void moduleCleanStruct(ModuleData **moduleData); /* Clean a moduleData hash */ void moduleDelAllDataMod(Module *m); /* remove all module data from all structs for this module */ +int moduleDataDebug(ModuleData **md); /* Allow for debug output of a moduleData struct */ +boolean moduleMinVersion(int major,int minor,int patch,int build); /* Checks if the current version of anope is before or after a given verison */ /*************************************************************************/ diff --git a/include/services.h b/include/services.h index c63fd8d81..726bc2a7c 100644 --- a/include/services.h +++ b/include/services.h @@ -129,7 +129,6 @@ typedef struct server_ Server; typedef struct user_ User; typedef struct channel_ Channel; typedef struct ModuleData_ ModuleData; /* ModuleData struct */ -typedef struct ModuleDataItem_ ModuleDataItem; /* A Module Data Item struct */ typedef struct memo_ Memo; typedef struct nickrequest_ NickRequest; typedef struct nickalias_ NickAlias; @@ -301,19 +300,14 @@ struct ircdcapab_ { * ModuleData strucs used to allow modules to add / delete module Data from existing structs */ -struct ModuleDataItem_ { - char *key; /* The key */ - char *value; /* The Value */ - ModuleDataItem *next; /* The next ModuleDataItem in this list */ -}; - -struct ModuleData_ { +struct ModuleData_ { char *moduleName; /* Which module we belong to */ - ModuleDataItem *di; /* The first Item they own */ + char *key; /* The key */ + char *value; /* The Value */ ModuleData *next; /* The next ModuleData record */ }; - -/*************************************************************************/ + + /*************************************************************************/ /* Memo info structures. Since both nicknames and channels can have memos, * we encapsulate memo data in a MemoList to make it easier to handle. */ @@ -324,7 +318,7 @@ struct memo_ { time_t time; /* When it was sent */ char sender[NICKMAX]; char *text; - ModuleData *moduleData[1024]; /* Module saved data attached to the Memo */ + ModuleData *moduleData; /* Module saved data attached to the Memo */ }; typedef struct { @@ -358,7 +352,7 @@ struct nickalias_ { int16 status; /* See NS_* below */ NickCore *nc; /* I'm an alias of this */ /* Not saved */ - ModuleData *moduleData[1024]; /* Module saved data attached to the nick alias */ + ModuleData *moduleData; /* Module saved data attached to the nick alias */ User *u; /* Current online user that has me */ }; @@ -380,7 +374,7 @@ struct nickcore_ { uint16 channelmax; /* Maximum number of channels allowed */ /* Unsaved data */ - ModuleData *moduleData[1024]; /* Module saved data attached to the NickCore */ + ModuleData *moduleData; /* Module saved data attached to the NickCore */ time_t lastmail; /* Last time this nick record got a mail */ SList aliases; /* List of aliases */ }; @@ -514,7 +508,7 @@ struct chaninfo_ { struct channel_ *c; /* Pointer to channel record (if * * channel is currently in use) */ - ModuleData *moduleData[1024]; /* Module saved data attached to the ChannelInfo */ + ModuleData *moduleData; /* Module saved data attached to the ChannelInfo */ /* For BotServ */ @@ -695,7 +689,7 @@ struct user_ { NickAlias *na; - ModuleData *moduleData[1024]; /* defined for it, it should allow the module Add/Get */ + ModuleData *moduleData; /* defined for it, it should allow the module Add/Get */ int isSuperAdmin; /* is SuperAdmin on or off? */ diff --git a/include/version.sh b/include/version.sh index 2ff3bb5a3..4070a52a1 100644 --- a/include/version.sh +++ b/include/version.sh @@ -38,17 +38,17 @@ cat >version.h <<EOF * */ -#define VERSION_MAJOR "$VERSION_MAJOR" -#define VERSION_MINOR "$VERSION_MINOR" -#define VERSION_PATCH "$VERSION_PATCH" -#define VERSION_EXTRA "$VERSION_EXTRA" -#define VERSION_BUILD "$VERSION_BUILD" + #ifndef VERSION_H + #define VERSION_H + +#define VERSION_MAJOR $VERSION_MAJOR +#define VERSION_MINOR $VERSION_MINOR +#define VERSION_PATCH $VERSION_PATCH +#define VERSION_EXTRA $VERSION_EXTRA +#define VERSION_BUILD $VERSION_BUILD #define BUILD "$BUILD" - -const char version_number[] = "$VERSION"; -const char version_build[] = - "build #" BUILD ", compiled " __DATE__ " " __TIME__; +#define VERSION_STRING "$VERSION" #ifdef DEBUG_COMMANDS # define VER_DEBUG "D" @@ -106,8 +106,7 @@ const char version_build[] = # define VER_MODULE #endif -/* the space is needed cause if you build with nothing it will complain */ -const char version_flags[] = " " VER_DEBUG VER_ENCRYPTION VER_THREAD VER_OS VER_GHBNR VER_MYSQL VER_MODULE; +#endif EOF |
