1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 15:43:13 +02:00

BUILD : 1.7.5 (351) BUGS : N/A NOTES : Rewrote the internals of moduleData, this will save _lots_ of memory especially on larger networks. The downside is modules using it need to make a tiny, tiny change... :/

git-svn-id: svn://svn.anope.org/anope/trunk@351 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@227 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b
2004-09-19 10:28:02 +00:00
parent aa896a87ac
commit fe0992a6ab
16 changed files with 217 additions and 233 deletions
+1 -1
View File
@@ -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 ****/
+7 -5
View File
@@ -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 */
/*************************************************************************/
+10 -16
View File
@@ -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? */
+10 -11
View File
@@ -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