X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Ftools.h;h=bab14cb658f3771c1612be726a21f7b38341f976;hp=dffb4a2188a4f9828b879dace81e9fd8a1bb87de;hb=HEAD;hpb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb diff --git a/src/tools.h b/src/tools.h index dffb4a2..bab14cb 100644 --- a/src/tools.h +++ b/src/tools.h @@ -1,4 +1,4 @@ -/* tools.h - NeonServ v5.3 +/* tools.h - NeonServ v5.6 * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -19,9 +19,10 @@ #include "main.h" -#define TABLE_FLAG_USE_POINTER 0x01 -#define TABLE_FLAG_COL_BOLD 0x02 -#define TABLE_FLAG_COL_CONTENTS 0x04 +#define TABLE_FLAG_USE_POINTER 0x01 +#define TABLE_FLAG_COL_BOLD 0x02 +#define TABLE_FLAG_COL_CONTENTS 0x04 +#define TABLE_FLAG_COL_SKIP_NULL 0x08 struct ClientSocket; struct UserNode; @@ -51,39 +52,50 @@ struct ModeBuffer { int delCount; }; -int match(const char *mask, const char *name); - -struct Table *table_init(int width, int length, int flags); -int table_add(struct Table *table, char **entry); -int table_change(struct Table *table, int row, char **entry); -int table_change_field(struct Table *table, int row, int col, char *entry); -int table_set_bold(struct Table *table, int collum, int bold); -char **table_end(struct Table *table); -void table_free(struct Table *table); - -char* timeToStr(struct UserNode *user, int seconds, int items, char *buf); -int strToTime(struct UserNode *user, char *str); - -struct ModeBuffer* initModeBuffer(struct ClientSocket *client, struct ChanNode *chan); #define modeBufferSimpleMode(MODEBUF,ADD,MODE) modeBufferSet(MODEBUF, ADD, MODE, NULL) #define modeBufferOp(MODEBUF,USER) modeBufferSet(MODEBUF, 1, 'o', USER) #define modeBufferDeop(MODEBUF,USER) modeBufferSet(MODEBUF, 0, 'o', USER) +#define modeBufferHalfop(MODEBUF,USER) modeBufferSet(MODEBUF, 1, 'h', USER) +#define modeBufferDehalfop(MODEBUF,USER) modeBufferSet(MODEBUF, 0, 'h', USER) #define modeBufferVoice(MODEBUF,USER) modeBufferSet(MODEBUF, 1, 'v', USER) #define modeBufferDevoice(MODEBUF,USER) modeBufferSet(MODEBUF, 0, 'v', USER) #define modeBufferBan(MODEBUF,MASK) modeBufferSet(MODEBUF, 1, 'b', MASK) #define modeBufferUnban(MODEBUF,MASK) modeBufferSet(MODEBUF, 0, 'b', MASK) -void modeBufferSet(struct ModeBuffer *modeBuf, int add, char mode, char *param); -void flushModeBuffer(struct ModeBuffer *modeBuf); -void freeModeBuffer(struct ModeBuffer *modeBuf); -int is_ircmask(const char *text); +#ifndef DND_FUNCTIONS +/* MODULAR ACCESSIBLE */ int match(const char *mask, const char *name); + +/* MODULAR ACCESSIBLE */ struct Table *table_init(int width, int length, int flags); +/* MODULAR ACCESSIBLE */ int table_add(struct Table *table, char **entry); +/* MODULAR ACCESSIBLE */ int table_change(struct Table *table, int row, char **entry); +/* MODULAR ACCESSIBLE */ int table_change_field(struct Table *table, int row, int col, char *entry); +/* MODULAR ACCESSIBLE */ int table_set_bold(struct Table *table, int collum, int bold); +/* MODULAR ACCESSIBLE */ char **table_end(struct Table *table); +/* MODULAR ACCESSIBLE */ void table_free(struct Table *table); + +/* MODULAR ACCESSIBLE */ char* timeToStr(struct UserNode *user, int seconds, int items, char *buf); +/* MODULAR ACCESSIBLE */ int strToTime(struct UserNode *user, char *str); +/* MODULAR ACCESSIBLE */ int getCurrentSecondsOfDay(); + +/* MODULAR ACCESSIBLE */ struct ModeBuffer* initModeBuffer(struct ClientSocket *client, struct ChanNode *chan); +/* MODULAR ACCESSIBLE */ void modeBufferSet(struct ModeBuffer *modeBuf, int add, char mode, char *param); +/* MODULAR ACCESSIBLE */ void flushModeBuffer(struct ModeBuffer *modeBuf); +/* MODULAR ACCESSIBLE */ void freeModeBuffer(struct ModeBuffer *modeBuf); + +/* MODULAR ACCESSIBLE */ int is_ircmask(const char *text); + +/* MODULAR ACCESSIBLE */ char* generate_banmask(struct UserNode *user, char *buffer); +/* MODULAR ACCESSIBLE */ char* make_banmask(char *input, char* buffer); +/* MODULAR ACCESSIBLE */ int isFakeHost(char *host); + +/* MODULAR ACCESSIBLE */ int mask_match(char *mask, struct UserNode *user); -char* generate_banmask(struct UserNode *user, char *buffer); -char* make_banmask(char *input, char* buffer); -int isFakeHost(char *host); +/* MODULAR ACCESSIBLE */ unsigned long crc32(const char *text); -unsigned long crc32(const char *text); +/* MODULAR ACCESSIBLE */ int stricmp (const char *s1, const char *s2); +/* MODULAR ACCESSIBLE */ int stricmplen (const char *s1, const char *s2, int len); void init_tools(); -#endif \ No newline at end of file +#endif +#endif