Export tkl_type_string via efuncs (actually, the name may change...)

This commit is contained in:
Bram Matthys 2019-06-15 17:06:41 +02:00
parent 7542cdeaca
commit 876fda63ec
No known key found for this signature in database
GPG key ID: BF8116B163EAAE98
4 changed files with 8 additions and 2 deletions

View file

@ -629,6 +629,7 @@ extern MODVAR int (*register_user)(aClient *cptr, aClient *sptr, char *nick, cha
extern MODVAR int (*tkl_hash)(unsigned int c);
extern MODVAR char (*tkl_typetochar)(int type);
extern MODVAR int (*tkl_chartotype)(char c);
extern MODVAR char *(*tkl_type_string)(aTKline *tk);
extern MODVAR aTKline *(*tkl_add_line)(int type, char *usermask, char *hostmask, char *reason, char *setby,
TS expire_at, TS set_at, TS spamf_tkl_duration, char *spamf_tkl_reason, MatchType match_type, int soft);
extern MODVAR aTKline *(*tkl_del_line)(aTKline *tkl);

View file

@ -1199,6 +1199,7 @@ _UNREAL_ERROR(_hook_error_incompatible, "Incompatible hook function. Check argum
#define EFUNC_PARSE_MESSAGE_TAGS 61
#define EFUNC_MTAGS_TO_STRING 62
#define EFUNC_TKL_CHARTOTYPE 63
#define EFUNC_TKL_TYPE_STRING 64
/* Module flags */
#define MODFLAG_NONE 0x0000

View file

@ -92,6 +92,7 @@ int (*register_user)(aClient *cptr, aClient *sptr, char *nick, char *username, c
int (*tkl_hash)(unsigned int c);
char (*tkl_typetochar)(int type);
int (*tkl_chartotype)(char c);
char *(*tkl_type_string)(aTKline *tk);
aTKline *(*tkl_add_line)(int type, char *usermask, char *hostmask, char *reason, char *setby,
TS expire_at, TS set_at, TS spamf_tkl_duration, char *spamf_tkl_reason, MatchType match_type, int soft);
aTKline *(*tkl_del_line)(aTKline *tkl);
@ -210,7 +211,8 @@ static const EfunctionsList efunction_table[MAXEFUNCTIONS] = {
/* 61 */ {"parse_message_tags", (void *)&parse_message_tags, &parse_message_tags_default_handler},
/* 62 */ {"mtags_to_string", (void *)&mtags_to_string, &mtags_to_string_default_handler},
/* 63 */ {"tkl_chartotype", (void *)&tkl_chartotype, NULL},
/* 64 */ {NULL, NULL, NULL},
/* 64 */ {"tkl_type_string", (void *)&tkl_type_string, NULL},
/* 65 */ {NULL, NULL, NULL},
};
#ifdef UNDERSCORE

View file

@ -53,6 +53,7 @@ int m_tkl_line(aClient *cptr, aClient *sptr, int parc, char *parv[], char* type)
int _tkl_hash(unsigned int c);
char _tkl_typetochar(int type);
int _tkl_chartotype(char c);
char *_tkl_type_string(aTKline *tk);
aTKline *_tkl_add_line(int type, char *usermask, char *hostmask, char *reason, char *setby,
TS expire_at, TS set_at, TS spamf_tkl_duration, char *spamf_tkl_reason, MatchType match_type, int soft);
void _tkl_del_line(aTKline *tkl);
@ -107,6 +108,7 @@ MOD_TEST(m_tkl)
EfunctionAdd(modinfo->handle, EFUNC_TKL_HASH, _tkl_hash);
EfunctionAdd(modinfo->handle, EFUNC_TKL_TYPETOCHAR, TO_INTFUNC(_tkl_typetochar));
EfunctionAdd(modinfo->handle, EFUNC_TKL_CHARTOTYPE, TO_INTFUNC(_tkl_chartotype));
EfunctionAddPChar(modinfo->handle, EFUNC_TKL_TYPE_STRING, _tkl_type_string);
EfunctionAddPVoid(modinfo->handle, EFUNC_TKL_ADD_LINE, TO_PVOIDFUNC(_tkl_add_line));
EfunctionAddVoid(modinfo->handle, EFUNC_TKL_DEL_LINE, _tkl_del_line);
EfunctionAddVoid(modinfo->handle, EFUNC_TKL_CHECK_LOCAL_REMOVE_SHUN, _tkl_check_local_remove_shun);
@ -2033,7 +2035,7 @@ void _tkl_synch(aClient *sptr)
}
/** Show TKL type as a string (used when adding/removing) */
char *tkl_type_string(aTKline *tk)
char *_tkl_type_string(aTKline *tk)
{
static char txt[256];