#include "setup.h"Go to the source code of this file.
Defines | |
| #define | EmptyString(x) ((x == NULL) || (*(x) == '\0')) |
| #define | CheckEmpty(x) EmptyString(x) ? "" : x |
| #define | ToLower(c) (ToLowerTab[(unsigned char)(c)]) |
| #define | ToUpper(c) (ToUpperTab[(unsigned char)(c)]) |
| #define | PRINT_C 0x001 |
| #define | CNTRL_C 0x002 |
| #define | ALPHA_C 0x004 |
| #define | PUNCT_C 0x008 |
| #define | DIGIT_C 0x010 |
| #define | SPACE_C 0x020 |
| #define | NICK_C 0x040 |
| #define | CHAN_C 0x080 |
| #define | KWILD_C 0x100 |
| #define | CHANPFX_C 0x200 |
| #define | USER_C 0x400 |
| #define | HOST_C 0x800 |
| #define | NONEOS_C 0x1000 |
| #define | SERV_C 0x2000 |
| #define | EOL_C 0x4000 |
| #define | MWILD_C 0x8000 |
| #define | LET_C 0x10000 |
| #define | FCHAN_C 0x20000 |
| #define | IsHostChar(c) (CharAttrs[(unsigned char)(c)] & HOST_C) |
| #define | IsUserChar(c) (CharAttrs[(unsigned char)(c)] & USER_C) |
| #define | IsChanPrefix(c) (CharAttrs[(unsigned char)(c)] & CHANPFX_C) |
| #define | IsChanChar(c) (CharAttrs[(unsigned char)(c)] & CHAN_C) |
| #define | IsFakeChanChar(c) (CharAttrs[(unsigned char)(c)] & FCHAN_C) |
| #define | IsKWildChar(c) (CharAttrs[(unsigned char)(c)] & KWILD_C) |
| #define | IsMWildChar(c) (CharAttrs[(unsigned char)(c)] & MWILD_C) |
| #define | IsNickChar(c) (CharAttrs[(unsigned char)(c)] & NICK_C) |
| #define | IsServChar(c) (CharAttrs[(unsigned char)(c)] & (NICK_C | SERV_C)) |
| #define | IsIdChar(c) (CharAttrs[(unsigned char)(c)] & (DIGIT_C | LET_C)) |
| #define | IsLetter(c) (CharAttrs[(unsigned char)(c)] & LET_C) |
| #define | IsCntrl(c) (CharAttrs[(unsigned char)(c)] & CNTRL_C) |
| #define | IsAlpha(c) (CharAttrs[(unsigned char)(c)] & ALPHA_C) |
| #define | IsSpace(c) (CharAttrs[(unsigned char)(c)] & SPACE_C) |
| #define | IsLower(c) (IsAlpha((c)) && ((unsigned char)(c) > 0x5f)) |
| #define | IsUpper(c) (IsAlpha((c)) && ((unsigned char)(c) < 0x60)) |
| #define | IsDigit(c) (CharAttrs[(unsigned char)(c)] & DIGIT_C) |
| #define | IsXDigit(c) |
| #define | IsAlNum(c) (CharAttrs[(unsigned char)(c)] & (DIGIT_C | ALPHA_C)) |
| #define | IsPrint(c) (CharAttrs[(unsigned char)(c)] & PRINT_C) |
| #define | IsAscii(c) ((unsigned char)(c) < 0x80) |
| #define | IsGraph(c) (IsPrint((c)) && ((unsigned char)(c) != 0x32)) |
| #define | IsPunct(c) |
| #define | IsNonEOS(c) (CharAttrs[(unsigned char)(c)] & NONEOS_C) |
| #define | IsEol(c) (CharAttrs[(unsigned char)(c)] & EOL_C) |
Functions | |
| int | valid_servername (const char *) |
| int | valid_hostname (const char *) |
| int | valid_username (const char *) |
Variables | |
| const unsigned char | ToLowerTab [] |
| const unsigned char | ToUpperTab [] |
| const unsigned int | CharAttrs [] |
| #define ALPHA_C 0x004 |
Definition at line 49 of file irc_string.h.
| #define CHAN_C 0x080 |
Definition at line 54 of file irc_string.h.
| #define CHANPFX_C 0x200 |
Definition at line 56 of file irc_string.h.
| #define CheckEmpty | ( | x | ) | EmptyString(x) ? "" : x |
Definition at line 34 of file irc_string.h.
| #define CNTRL_C 0x002 |
Definition at line 48 of file irc_string.h.
| #define DIGIT_C 0x010 |
Definition at line 51 of file irc_string.h.
| #define EmptyString | ( | x | ) | ((x == NULL) || (*(x) == '\0')) |
Definition at line 33 of file irc_string.h.
| #define EOL_C 0x4000 |
Definition at line 61 of file irc_string.h.
| #define FCHAN_C 0x20000 |
Definition at line 64 of file irc_string.h.
| #define HOST_C 0x800 |
Definition at line 58 of file irc_string.h.
| #define IsAlNum | ( | c | ) | (CharAttrs[(unsigned char)(c)] & (DIGIT_C | ALPHA_C)) |
Definition at line 85 of file irc_string.h.
| #define IsAlpha | ( | c | ) | (CharAttrs[(unsigned char)(c)] & ALPHA_C) |
Definition at line 78 of file irc_string.h.
| #define IsAscii | ( | c | ) | ((unsigned char)(c) < 0x80) |
Definition at line 87 of file irc_string.h.
| #define IsChanChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & CHAN_C) |
Definition at line 69 of file irc_string.h.
| #define IsChanPrefix | ( | c | ) | (CharAttrs[(unsigned char)(c)] & CHANPFX_C) |
Definition at line 68 of file irc_string.h.
| #define IsCntrl | ( | c | ) | (CharAttrs[(unsigned char)(c)] & CNTRL_C) |
Definition at line 77 of file irc_string.h.
| #define IsDigit | ( | c | ) | (CharAttrs[(unsigned char)(c)] & DIGIT_C) |
Definition at line 82 of file irc_string.h.
| #define IsEol | ( | c | ) | (CharAttrs[(unsigned char)(c)] & EOL_C) |
Definition at line 96 of file irc_string.h.
| #define IsFakeChanChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & FCHAN_C) |
Definition at line 70 of file irc_string.h.
| #define IsGraph | ( | c | ) | (IsPrint((c)) && ((unsigned char)(c) != 0x32)) |
Definition at line 88 of file irc_string.h.
| #define IsHostChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & HOST_C) |
Definition at line 66 of file irc_string.h.
Referenced by valid_hostname().
| #define IsIdChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & (DIGIT_C | LET_C)) |
Definition at line 75 of file irc_string.h.
| #define IsKWildChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & KWILD_C) |
Definition at line 71 of file irc_string.h.
| #define IsLetter | ( | c | ) | (CharAttrs[(unsigned char)(c)] & LET_C) |
Definition at line 76 of file irc_string.h.
| #define IsLower | ( | c | ) | (IsAlpha((c)) && ((unsigned char)(c) > 0x5f)) |
Definition at line 80 of file irc_string.h.
| #define IsMWildChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & MWILD_C) |
Definition at line 72 of file irc_string.h.
| #define IsNickChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & NICK_C) |
Definition at line 73 of file irc_string.h.
| #define IsNonEOS | ( | c | ) | (CharAttrs[(unsigned char)(c)] & NONEOS_C) |
Definition at line 95 of file irc_string.h.
| #define IsPrint | ( | c | ) | (CharAttrs[(unsigned char)(c)] & PRINT_C) |
Definition at line 86 of file irc_string.h.
| #define IsPunct | ( | c | ) |
| #define IsServChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & (NICK_C | SERV_C)) |
Definition at line 74 of file irc_string.h.
Referenced by valid_servername().
| #define IsSpace | ( | c | ) | (CharAttrs[(unsigned char)(c)] & SPACE_C) |
Definition at line 79 of file irc_string.h.
| #define IsUpper | ( | c | ) | (IsAlpha((c)) && ((unsigned char)(c) < 0x60)) |
Definition at line 81 of file irc_string.h.
| #define IsUserChar | ( | c | ) | (CharAttrs[(unsigned char)(c)] & USER_C) |
Definition at line 67 of file irc_string.h.
Referenced by valid_username().
| #define IsXDigit | ( | c | ) |
(IsDigit(c) || ('a' <= (c) && (c) <= 'f') || \ ('A' <= (c) && (c) <= 'F'))
Definition at line 83 of file irc_string.h.
| #define KWILD_C 0x100 |
Definition at line 55 of file irc_string.h.
| #define LET_C 0x10000 |
Definition at line 63 of file irc_string.h.
| #define MWILD_C 0x8000 |
Definition at line 62 of file irc_string.h.
| #define NICK_C 0x040 |
Definition at line 53 of file irc_string.h.
| #define NONEOS_C 0x1000 |
Definition at line 59 of file irc_string.h.
| #define PRINT_C 0x001 |
Definition at line 47 of file irc_string.h.
| #define PUNCT_C 0x008 |
Definition at line 50 of file irc_string.h.
| #define SERV_C 0x2000 |
Definition at line 60 of file irc_string.h.
| #define SPACE_C 0x020 |
Definition at line 52 of file irc_string.h.
| #define ToLower | ( | c | ) | (ToLowerTab[(unsigned char)(c)]) |
Definition at line 40 of file irc_string.h.
| #define ToUpper | ( | c | ) | (ToUpperTab[(unsigned char)(c)]) |
Definition at line 43 of file irc_string.h.
| #define USER_C 0x400 |
Definition at line 57 of file irc_string.h.
| int valid_hostname | ( | const char * | ) |
Definition at line 34 of file irc_string.c.
References IsHostChar, and s_assert.
Referenced by AddUser().
| int valid_servername | ( | const char * | ) |
| int valid_username | ( | const char * | ) |
Definition at line 62 of file irc_string.c.
References IsUserChar.
| const unsigned int CharAttrs[] |
Definition at line 181 of file irc_string.c.
| const unsigned char ToLowerTab[] |
Definition at line 107 of file irc_string.c.
| const unsigned char ToUpperTab[] |
Definition at line 144 of file irc_string.c.
1.6.3