1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 16:13:13 +02:00

ModData: moddata_localvar -> moddata_local_variable,

moddata_globalvar -> moddata_global_variable,
and the just-added moddata_localclient -> moddata_local_client
..all this so it's more consistent
This commit is contained in:
Bram Matthys
2019-09-15 09:47:54 +02:00
parent b2f32c1746
commit ffe5abe30b
9 changed files with 92 additions and 92 deletions
+3 -3
View File
@@ -236,12 +236,12 @@
* UnrealIRCd 5.0.0 : 12, 8, 8, 4, 4, 500, 500
*/
#define MODDATA_MAX_CLIENT 12
#define MODDATA_MAX_LOCALCLIENT 8
#define MODDATA_MAX_LOCAL_CLIENT 8
#define MODDATA_MAX_CHANNEL 8
#define MODDATA_MAX_MEMBER 4
#define MODDATA_MAX_MEMBERSHIP 4
#define MODDATA_MAX_LOCALVAR 500
#define MODDATA_MAX_GLOBALVAR 500
#define MODDATA_MAX_LOCAL_VARIABLE 500
#define MODDATA_MAX_GLOBAL_VARIABLE 500
/* If EXPERIMENTAL is #define'd then all users will receive a notice about
* this when they connect, along with a pointer to bugs.unrealircd.org where
+2 -2
View File
@@ -38,8 +38,8 @@ extern MODVAR Member *freemember;
extern MODVAR Membership *freemembership;
extern MODVAR Client me;
extern MODVAR Channel *channel;
extern MODVAR ModData localvar_moddata[MODDATA_MAX_LOCALVAR];
extern MODVAR ModData globalvar_moddata[MODDATA_MAX_GLOBALVAR];
extern MODVAR ModData local_variable_moddata[MODDATA_MAX_LOCAL_VARIABLE];
extern MODVAR ModData global_variable_moddata[MODDATA_MAX_GLOBAL_VARIABLE];
extern MODVAR struct stats *ircstp;
extern MODVAR int bootopt;
extern MODVAR time_t timeofday;
+18 -18
View File
@@ -129,13 +129,13 @@ typedef struct {
} Snomask;
typedef enum ModDataType {
MODDATATYPE_LOCALVAR = 1,
MODDATATYPE_GLOBALVAR = 2,
MODDATATYPE_CLIENT = 3,
MODDATATYPE_LOCALCLIENT = 4,
MODDATATYPE_CHANNEL = 5,
MODDATATYPE_MEMBER = 6,
MODDATATYPE_MEMBERSHIP = 7,
MODDATATYPE_LOCAL_VARIABLE = 1,
MODDATATYPE_GLOBAL_VARIABLE = 2,
MODDATATYPE_CLIENT = 3,
MODDATATYPE_LOCAL_CLIENT = 4,
MODDATATYPE_CHANNEL = 5,
MODDATATYPE_MEMBER = 6,
MODDATATYPE_MEMBERSHIP = 7,
} ModDataType;
typedef struct ModDataInfo ModDataInfo;
@@ -154,16 +154,16 @@ struct ModDataInfo {
};
#define moddata_client(acptr, md) acptr->moddata[md->slot]
#define moddata_localclient(acptr, md) acptr->local->moddata[md->slot]
#define moddata_local_client(acptr, md) acptr->local->moddata[md->slot]
#define moddata_channel(chptr, md) chptr->moddata[md->slot]
#define moddata_member(m, md) m->moddata[md->slot]
#define moddata_membership(m, md) m->moddata[md->slot]
#define moddata_localvar(md) localvar_moddata[md->slot]
#define moddata_globalvar(md) globalvar_moddata[md->slot]
#define moddata_local_variable(md) local_variable_moddata[md->slot]
#define moddata_global_variable(md) global_variable_moddata[md->slot]
#define EXCHK_ACCESS 0 /* Check access */
#define EXCHK_ACCESS_ERR 1 /* Check access and send error if needed */
#define EXCHK_PARAM 2 /* Check parameter and send error if needed */
#define EXCHK_PARAM 2 /* Check parameter and send error if needed */
/* Can bypass message restriction - Types */
typedef enum BypassChannelMessageRestrictionType {
@@ -174,14 +174,14 @@ typedef enum BypassChannelMessageRestrictionType {
BYPASS_CHANMSG_NOTICE = 5,
} BypassChannelMessageRestrictionType;
#define EXSJ_SAME 0 /* Parameters are the same */
#define EXSJ_WEWON 1 /* We won! w00t */
#define EXSJ_SAME 0 /* Parameters are the same */
#define EXSJ_WEWON 1 /* We won! w00t */
#define EXSJ_THEYWON 2 /* They won :( */
#define EXSJ_MERGE 3 /* Merging of modes.. neither won nor lost (merged params are in 'our' on return) */
/* return values for EXCHK_ACCESS*: */
#define EX_DENY 0 /* Disallowed, except in case of operoverride */
#define EX_ALLOW 1 /* Allowed */
#define EX_DENY 0 /* Disallowed, except in case of operoverride */
#define EX_ALLOW 1 /* Allowed */
#define EX_ALWAYS_DENY -1 /* Disallowed, even in case of operoverride
* (eg: for operlevel modes like +A)
*/
@@ -804,15 +804,15 @@ extern void CommandOverrideDel(CommandOverride *ovr);
extern int CallCommandOverride(CommandOverride *ovr, Client *cptr, Client *sptr, MessageTag *mtags, int parc, char *parv[]);
extern void moddata_free_client(Client *acptr);
extern void moddata_free_localclient(Client *acptr);
extern void moddata_free_local_client(Client *acptr);
extern void moddata_free_channel(Channel *chptr);
extern void moddata_free_member(Member *m);
extern void moddata_free_membership(Membership *m);
extern ModDataInfo *findmoddata_byname(char *name, ModDataType type);
extern int moddata_client_set(Client *acptr, char *varname, char *value);
extern char *moddata_client_get(Client *acptr, char *varname);
extern int moddata_localclient_set(Client *acptr, char *varname, char *value);
extern char *moddata_localclient_get(Client *acptr, char *varname);
extern int moddata_local_client_set(Client *acptr, char *varname, char *value);
extern char *moddata_local_client_get(Client *acptr, char *varname);
extern int LoadPersistentPointerX(ModuleInfo *modinfo, char *varshortname, void **var, void (*free_variable)(ModData *m));
#define LoadPersistentPointer(modinfo, var, free_variable) LoadPersistentPointerX(modinfo, #var, (void **)&var, free_variable)
+1 -1
View File
@@ -979,7 +979,7 @@ struct LocalClient {
char *sni_servername; /**< Servername as sent by client via SNI (Server Name Indication) in SSL/TLS, otherwise NULL */
int cap_protocol; /**< CAP protocol in use. At least 300 for any CAP capable client. 302 for 3.2, etc.. */
int identbufcnt; /**< Counter for 'ident' reading code */
ModData moddata[MODDATA_MAX_LOCALCLIENT]; /**< LocalClient attached module data, used by the ModData system */
ModData moddata[MODDATA_MAX_LOCAL_CLIENT]; /**< LocalClient attached module data, used by the ModData system */
};
/** User information (persons, not servers), you use sptr->user to access these (see also @link Client @endlink).