Thread: [IRC-Dev CVS] Module ircdh: Change commited ircdh/ircd ircd_string.c,NONE,1.1 table_gen.c,NONE,1.1 I
Brought to you by:
zolty
Update of /cvsroot/irc-dev/ircdh/ircd In directory usw-pr-cvs1:/tmp/cvs-serv10291/ircdh/ircd Modified Files: IPcheck.c Makefile.in channel.c chkconf.c crule.c dbuf.c hash.c list.c m_config.c match.c numnicks.c opercmds.c parse.c res.c s_auth.c s_bdd.c s_bsd.c s_conf.c s_misc.c s_ping.c s_serv.c s_socks.c s_user.c send.c support.c whocmds.c whowas.c Added Files: ircd_string.c table_gen.c Removed Files: common.c Log Message: 2002-08-21 Toni Garcia <zo...@ir...> * ircd/common.c/.h: Ha sido eliminado. * ircd/table_gen: La tabla de caracteres que estaba en common.c ha sido colocado en este nuevo fichero. * ircd/ircd_string.c/h: Las funciones que estaban en common.c y en support.c han sido movidos al nuevo fichero. Y se sustituyen en el codigo los "strtoken" por el nuevo "ircd_strtok". * Movidos los archivos viejos de "ChangeLog" de Hispano y Undernet al directorio doc/history. A partir de ahora se documentan los cambios en este fichero "ChangeLog". --- NEW FILE: ircd_string.c --- /* * IRC - Internet Relay Chat, ircd/ircd_string.c * Copyright (C) 1999 Thomas Helvey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ircd_string.c,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ #include "ircd_string.h" #include "ircd_defs.h" #include "ircd_chattr.h" #include <assert.h> #include <string.h> #include "sys.h" #include <stdarg.h> #include <signal.h> #include <netinet/in.h> #include "sprintf_irc.h" /* * include the character attribute tables here */ #include "chattr.tab.c" /* * strtoken.c * * Walk through a string of tokens, using a set of separators. * -argv 9/90 */ char *ircd_strtok(char **save, char *str, char *fs) { char *pos = *save; /* keep last position across calls */ char *tmp; if (str) pos = str; /* new string scan */ while (pos && *pos && strchr(fs, *pos) != NULL) pos++; /* skip leading separators */ if (!pos || !*pos) return (pos = *save = NULL); /* string contains only sep's */ tmp = pos; /* now, keep position of the token */ while (*pos && strchr(fs, *pos) == NULL) pos++; /* skip content of the token */ if (*pos) *pos++ = '\0'; /* remove first sep after the token */ else pos = NULL; /* end of string */ *save = pos; return (tmp); } /* * canonize * * reduce a string of duplicate list entries to contain only the unique * items. Unavoidably O(n^2). */ char *canonize(char *buffer) { static char cbuf[BUFSIZE]; char *s; char *t; char *cp = cbuf; int l = 0; char *p = NULL; char *p2; *cp = '\0'; for (s = ircd_strtok(&p, buffer, ","); s; s = ircd_strtok(&p, NULL, ",")) { if (l) { p2 = NULL; for (t = ircd_strtok(&p2, cbuf, ","); t; t = ircd_strtok(&p2, NULL, ",")) if (0 == ircd_strcmp(s, t)) break; else if (p2) p2[-1] = ','; } else t = NULL; if (!t) { if (l) *(cp - 1) = ','; else l = 1; strcpy(cp, s); if (p) cp += (p - s); } else if (p2) p2[-1] = ','; } return cbuf; } /* * ircd_strncpy - optimized strncpy * This may not look like it would be the fastest possible way to do it, * but it generally outperforms everything else on many platforms, * including asm library versions and memcpy, if compiled with the * optimizer on. (-O2 for gcc) --Bleep */ char *ircd_strncpy(char* s1, const char* s2, size_t n) { char *endp = s1 + n; char *s = s1; assert(0 != s1); assert(0 != s2); while (s < endp && (*s++ = *s2++)) ; return s1; } #ifndef FORCEINLINE NTL_HDR_strChattr { NTL_SRC_strChattr } NTL_HDR_strCasediff { NTL_SRC_strCasediff } #endif /* !FORCEINLINE */ /*============================================================================= * Other functions visible externally */ int strnChattr(const char *s, size_t n) { const char *rs = s; unsigned int x = ~0; int r = n; while (*rs && r--) x &= IRCD_CharAttrTab[*rs++ - CHAR_MIN]; return x; } /* * ircd_strcmp - case insensitive comparison of 2 strings * NOTE: see ircd_chattr.h for notes on case mapping. */ int ircd_strcmp(const char *a, const char *b) { const char *ra = a; const char *rb = b; while (ToLower(*ra) == ToLower(*rb)) { if (!*ra++) return 0; else ++rb; } return (*ra - *rb); } /* * ircd_strncmp - counted case insensitive comparison of 2 strings * NOTE: see ircd_chattr.h for notes on case mapping. */ int ircd_strncmp(const char *a, const char *b, size_t n) { const char *ra = a; const char *rb = b; int left = n; if (!left--) return 0; while (ToLower(*ra) == ToLower(*rb)) { if (!*ra++ || !left--) return 0; else ++rb; } return (*ra - *rb); } /* * unique_name_vector - create a unique vector of names from * a token separated list * list - [in] a token delimited null terminated character array * token - [in] the token to replace * vector - [out] vector of strings to be returned * size - [in] maximum number of elements to place in vector * Returns count of elements placed into the vector, if the list * is an empty string { '\0' } 0 is returned. * list, and vector must be non-null and size must be > 0 * Empty strings <token><token> are not placed in the vector or counted. * This function ignores all subsequent tokens when count == size * * NOTE: this function destroys it's input, do not use list after it * is passed to this function */ int unique_name_vector(char *list, char token, char **vector, int size) { int i; int count = 0; char *start = list; char *end; assert(0 != list); assert(0 != vector); assert(0 < size); /* * ignore spurious tokens */ while (token == *start) ++start; for (end = strchr(start, token); end; end = strchr(start, token)) { *end++ = '\0'; /* * ignore spurious tokens */ while (token == *end) ++end; for (i = 0; i < count; ++i) { if (0 == ircd_strcmp(vector[i], start)) break; } if (i == count) { vector[count++] = start; if (count == size) return count; } start = end; } if (*start) { for (i = 0; i < count; ++i) { if (0 == ircd_strcmp(vector[i], start)) return count; } vector[count++] = start; } return count; } /* * token_vector - create a vector of tokens from * a token separated list * list - [in] a token delimited null terminated character array * token - [in] the token to replace * vector - [out] vector of strings to be returned * size - [in] maximum number of elements to place in vector * returns count of elements placed into the vector, if the list * is an empty string { '\0' } 0 is returned. * list, and vector must be non-null and size must be > 1 * Empty tokens are counted and placed in the list * * NOTE: this function destroys it's input, do not use list after it * is passed to this function */ int token_vector(char *list, char token, char **vector, int size) { int count = 0; char *start = list; char *end; assert(0 != list); assert(0 != vector); assert(1 < size); vector[count++] = start; for (end = strchr(start, token); end; end = strchr(start, token)) { *end++ = '\0'; start = end; if (*start) { vector[count++] = start; if (count < size) continue; } break; } return count; } /* * host_from_uh - get the host.domain part of a us...@ho...main string * ripped from get_sockhost */ char *host_from_uh(char *host, const char *userhost, size_t n) { const char *s; assert(0 != host); assert(0 != userhost); if ((s = strchr(userhost, '@'))) ++s; else s = userhost; ircd_strncpy(host, s, n); host[n] = '\0'; return host; } /* * this new faster inet_ntoa was ripped from: * From: Thomas Helvey <to...@in...> */ static const char *IpQuadTab[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255" }; /* * ircd_ntoa - rewrote and renamed yet again :) --Bleep * inetntoa - in_addr to string * changed name to remove collision possibility and * so behaviour is guaranteed to take a pointer arg. * -avalon 23/11/92 * inet_ntoa -- returned the dotted notation of a given * internet number * argv 11/90). * inet_ntoa -- its broken on some Ultrix/Dynix too. -avalon */ const char *ircd_ntoa(const char *in) { static char buf[20]; return ircd_ntoa_r(buf, in); } /* * reentrant version of above */ const char *ircd_ntoa_r(char *buf, const char *in) { char *p = buf; const unsigned char *a = (const unsigned char *)in; const char* n; assert(0 != buf); assert(0 != in); n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a++]; while ((*p = *n++)) ++p; *p++ = '.'; n = IpQuadTab[*a]; while ((*p = *n++)) ++p; return buf; } /* PROVISIONAL */ /* * inetntoa -- Changed the parameter to NOT take a pointer. * -Run 4/8/97 * inetntoa -- Changed name to remove collision possibility and * so behaviour is garanteed to take a pointer arg. * -avalon 23/11/92 * inet_ntoa -- Returned the dotted notation of a given * internet number (some ULTRIX don't have this) * -argv 11/90. * inet_ntoa -- Its broken on some Ultrix/Dynix too. -avalon */ char *inetntoa(struct in_addr in) { static char buf[16]; unsigned char *s = (unsigned char *)&in.s_addr; unsigned char a, b, c, d; a = *s++; b = *s++; c = *s++; d = *s++; sprintf_irc(buf, "%u.%u.%u.%u", a, b, c, d); return buf; } #if 0 #ifndef HAVE_INET_NETOF /* * inet_netof -- return the net portion of an internet number * argv 11/90 */ int inet_netof(struct in_addr in) { int addr = in.s_net; if (addr & 0x80 == 0) return ((int)in.s_net); if (addr & 0x40 == 0) return ((int)in.s_net * 256 + in.s_host); return ((int)in.s_net * 256 + in.s_host * 256 + in.s_lh); } #endif #endif --- NEW FILE: table_gen.c --- /* * IRC - Internet Relay Chat, ircd/table_gen.c * Copyright (C) 1998 Andrea Cocito * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: table_gen.c,v 1.1 2002/08/21 17:59:40 zolty Exp $ */ /* * TABLE GENERATOR * The following part of code is NOT included in the actual server's * or library source, it's just used to build the above tables * * This should rebuild the actual tables and automatically place them * into this source file, note that this part of code is for developers * only, it's supposed to work on both signed and unsigned chars but I * actually tested it only on signed-char architectures, the code and * macros actually used by the server instead DO work and have been tested * on platforms where0 char is both signed or unsigned, this is true as long * as the <limits.h> macros are set properly and without any need to rebuild * the tables (wich as said an admin should NEVER do, tables need to be rebuilt * only when one wants to really change the results or when one has to * compile on architectures where a char is NOT eight bits [?!], yes * it all is supposed to work in that case too... but I can't test it * because I've not found a machine in the world where this happes). * * NEVER -f[un]signed-char on gcc since that does NOT fix the named macros * and you end up in a non-ANSI environment where CHAR_MIN and CHAR_MAX * are _not_ the real limits of a default 'char' type. This is true for * both admins and coders. * */ #include "ircd_chattr.h" #include <stdlib.h> #include <stdio.h> #include <ctype.h> static void zeroTables(void); static void markString(int macro, const char *s); static void unMarkString(int macro, const char *s); static void markRange(int macro, char from, char to); static void moveMacro(int from, int to); static void setLowHi(const char firstlow, const char lastlow, const char firsthi); char NTL_tolower_tab[1 + CHAR_MAX - CHAR_MIN]; /* 256 bytes */ char NTL_toupper_tab[1 + CHAR_MAX - CHAR_MIN]; /* 256 bytes */ int NTL_char_attrib[1 + CHAR_MAX - CHAR_MIN]; /* 256 ints = 0.5 to 2 kilobytes */ /* * makeTables() * Where we make the tables, edit ONLY this to change the tables. */ static void makeTables(void) { /* Start from a known status */ zeroTables(); /* Make the very elementary sets */ markRange(NTL_LOWER, 'a', 'z'); markString(NTL_LOWER, "{|}~"); markRange(NTL_UPPER, 'A', 'Z'); markString(NTL_UPPER, "[\\]^"); markRange(NTL_DIGIT, '0', '9'); markRange(NTL_CNTRL, '\000', '\037'); markString(NTL_PUNCT, "!\"#$%&'()*+,-./:;<=>?@_`"); markString(NTL_SPACE, "\011\012\013\014\015\040"); /* Make the derived sets, * WARNING: The order of these calls is important, some depend on * the results of the previous ones ! */ moveMacro(NTL_LOWER | NTL_UPPER, NTL_ALPHA); moveMacro(NTL_ALPHA | NTL_DIGIT, NTL_ALNUM); moveMacro(NTL_ALNUM | NTL_PUNCT, NTL_GRAPH); moveMacro(NTL_GRAPH, NTL_PRINT); markString(NTL_PRINT, " "); markRange(NTL_IRCCH, 0, (char) UCHAR_MAX); unMarkString(NTL_IRCCH, "\007\040\054\240"); markRange(NTL_IRCCL, '\300', '\326'); markRange(NTL_IRCCL, '\330', '\336'); moveMacro(NTL_ALNUM, NTL_IRCHN); markString(NTL_IRCHN, "-_."); /* Some DNS might allow '_' per RFC 1033 ! */ moveMacro(NTL_DIGIT, NTL_IRCIP); markString(NTL_IRCIP, "."); moveMacro(NTL_DIGIT | NTL_ALPHA, NTL_IRCNK); markString(NTL_IRCNK, "-_`"); moveMacro(NTL_ALNUM, NTL_IRCUI); markRange(NTL_IRCUI, '\xe0', '\xf6'); markRange(NTL_IRCUI, '\xf8', '\xfe'); markRange(NTL_IRCUI, '\xc0', '\xd6'); markRange(NTL_IRCUI, '\xd8', '\xde'); markString(NTL_IRCUI, ".-_^'`~"); markString(NTL_EOL, "\n\r"); markString(NTL_CHPFX, "#&+"); markString(NTL_KTIME, " ,-0123456789"); /* And finally let's take care of the toLower/toUpper stuff */ setLowHi('a', 'z', 'A'); setLowHi('\xe0', '\xf6', '\xc0'); setLowHi('\xf8', '\xfe', '\xd8'); setLowHi('{', '~', '['); } /* * main() * This is the main program to be executed for -DMAKETABLES */ static void dumphw(int *p, int beg); static void dumphb(char *p, int beg); int main(void) { int i; /* Make the tables */ makeTables(); /* Dump them as ANSI C source to be included below */ printf("/*\n * Automatically Generated Tables - DO NOT EDIT\n */\n"); printf("#include <limits.h>\n"); /* NTL_tolower_tab */ printf("const char ToLowerTab_8859_1[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_tolower_tab, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphb(NTL_tolower_tab, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_tolower_tab, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); /* NTL_toupper_tab */ printf("const char ToUpperTab_8859_1[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_toupper_tab, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphb(NTL_toupper_tab, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphb(NTL_toupper_tab, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); /* NTL_char_attrib */ printf("const unsigned int IRCD_CharAttrTab[] = {\n"); printf("#if (CHAR_MIN<0)\n"); i = (int)((char)SCHAR_MIN); dumphw(NTL_char_attrib, i); printf(" ,\n"); printf("#endif /* (CHAR_MIN<0) */\n"); i = 0; dumphw(NTL_char_attrib, i); printf("#if (!(CHAR_MIN<0))\n"); printf(" ,\n"); i = (int)((char)SCHAR_MIN); dumphw(NTL_char_attrib, i); printf("#endif /* (!(CHAR_MIN<0)) */\n"); printf(" };\n\n"); return 0; } /* A few utility functions for makeTables() */ static void zeroTables(void) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) { NTL_tolower_tab[i - CHAR_MIN] = (char)i; /* Unchanged */ NTL_toupper_tab[i - CHAR_MIN] = (char)i; /* Unchanged */ NTL_char_attrib[i - CHAR_MIN] = 0x0000; /* Nothing */ } } static void markString(int macro, const char *s) { while (*s) NTL_char_attrib[*(s++) - CHAR_MIN] |= macro; } static void unMarkString(int macro, const char *s) { while (*s) NTL_char_attrib[*(s++) - CHAR_MIN] &= ~macro; } static void markRange(int macro, char from, char to) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (((unsigned char)i >= (unsigned char)from) && ((unsigned char)i <= (unsigned char)to)) NTL_char_attrib[(char)i - CHAR_MIN] |= macro; } static void moveMacro(int from, int to) { int i; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (NTL_char_attrib[i - CHAR_MIN] & from) NTL_char_attrib[i - CHAR_MIN] |= to; } static void setLowHi(const char firstlow, const char lastlow, const char firsthi) { int i, j; for (i = CHAR_MIN; i <= CHAR_MAX; i++) if (((unsigned char)i >= (unsigned char)firstlow) && ((unsigned char)i <= (unsigned char)lastlow)) { j = ((int)((char)(i + (int)(firsthi - firstlow)))); NTL_tolower_tab[((char)j) - CHAR_MIN] = (char)i; NTL_toupper_tab[((char)i) - CHAR_MIN] = (char)j; } } /* These are used in main() to actually dump the tables, each function dumps half table as hex/char constants... */ #define ROWSIZE 8 static void dumphb(char *tbl, int beg) { int i, j, k; char *p = &tbl[beg - CHAR_MIN]; char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; c = (char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" x%02x", ((int)((unsigned char)c))); c = (char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else printf("x%02x", ((int)((unsigned char)c))); printf(" */"); for (j = i; j <= k; j++) { c = p[j]; if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" '\\x%02x'", ((int)((unsigned char)c))); if (j < SCHAR_MAX) printf(","); } printf("\n"); } } static void dumphw(int *tbl, int beg) { int i, j, k; int *p = &tbl[beg - CHAR_MIN]; char c; for (i = 0; i <= SCHAR_MAX; i += ROWSIZE) { k = i + ROWSIZE - 1; if (k > SCHAR_MAX) k = SCHAR_MAX; c = (char)(beg + i); printf("/*"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf(" '%c'", c); else printf(" x%02x", ((int)((unsigned char)c))); c = (char)(beg + k); printf("-"); if ((c > 0) && (c < SCHAR_MAX) && (isprint(c)) && (c != '\\') && (c != '\'')) printf("'%c'", c); else printf("x%02x", ((int)((unsigned char)c))); printf(" */"); for (j = i; j <= k; j++) { printf(" 0x%04x", p[j] & 0xffffffff); if (j < SCHAR_MAX) printf(","); } printf("\n"); } } Index: IPcheck.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/IPcheck.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- IPcheck.c 18 Aug 2002 22:59:22 -0000 1.3 +++ IPcheck.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -15,32 +15,39 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ + * + * + * This file should be edited in a window with a width of 141 characters + * ick */ +#include "IPcheck.h" +#if 0 +#include "client.h" +#endif +#include "ircd.h" +#include "numnicks.h" /* NumNick, NumServ (GODMODE) */ +#if 0 +#include "ircd_alloc.h" +#endif +#include "s_bsd.h" /* SetIPChecked */ +#include "s_debug.h" /* Debug */ +#include "s_user.h" /* TARGET_DELAY */ +#include "send.h" -/* This file should be edited in a window with a width of 141 characters */ +#include <assert.h> +#include <stdio.h> /* NULL ... bleah */ +/* Provisional */ +#include "h.h" #include "sys.h" #include <netinet/in.h> -#include "h.h" -#include "IPcheck.h" -#include "ircd.h" #include "querycmds.h" #include "struct.h" -#include "s_user.h" -#include "s_bsd.h" -#include "struct.h" -#ifdef GODMODE -#include "numnicks.h" -#endif -#include "send.h" - #if defined(BDD) && defined(BDD_CLONES) #include "s_bdd.h" -#include "support.h" #endif - -RCSTAG_CC("$Id$"); - /* * IP number and last targets of a user that just disconnected. Index: Makefile.in =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.in 18 Aug 2002 22:59:22 -0000 1.5 +++ Makefile.in 21 Aug 2002 17:59:40 -0000 1.6 @@ -74,6 +74,7 @@ ircd_log.c \ ircd_osdep.c \ ircd_signal.c \ + ircd_string.c \ list.c \ map.c \ match.c \ @@ -104,7 +105,6 @@ whowas.c \ m_config.c \ m_watch.c \ - common.c \ bsd.c OBJS = ${SRC:%.c=%.o} @@ -117,7 +117,8 @@ .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ -build: ircd chkconf +#build: ircd chkconf +build: ircd ircd: ${OBJS} ../include/patchlevel.h version.o ${PURIFY} ${CC} ${OBJS} version.o ${LDFLAGS} ${IRCDLIBS} -o ircd @@ -145,10 +146,9 @@ chkcrule.o: crule.c ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c crule.c -chkconf: chkconf.o match.o common.o chkcrule.o runmalloc.o fileio.o - ${CC} ${CFLAGS} ${CPPFLAGS} \ - chkconf.o match.o common.o chkcrule.o runmalloc.o fileio.o \ - ${LDFLAGS} ${IRCDLIBS} -o chkconf +chkconf: chkconf.o match.o chkcrule.o runmalloc.o fileio.o ircd_string.o + ${CC} chkconf.o match.o chkcrule.o fileio.o runmalloc.o \ + ircd_string.o ${LDFLAGS} ${IRCDLIBS} -o chkconf #chkconf: chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o ircd_string.o # ${CC} chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o \ @@ -176,7 +176,8 @@ ${RM} -f ${SYMLINK}; \ ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; ) @${RM} /tmp/ircd.tag - ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} +# ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} + ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} table_gen ${BINDIR} ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ../doc/ejemplo.conf ${DPATH} ( cd ${DPATH}; \ ${TOUCH} ${MPATH}; \ @@ -232,13 +233,6 @@ maintainer-clean: distclean -ctables: common.c - ${CC} -I../include -DMAKETABLES common.c || exit 1 - { ${GREP} -A1 -B1000 ^...NTL_TOK_START common.c ; ./a.out ; \ - ${GREP} -A1000 -B1 ^...NTL_TOK_END common.c ; } > common.temp || exit 1; - ${MV} common.temp common.c - ${RM} a.out - depend: @if [ -f Makefile.in.bak ]; then \ echo "make depend: First remove ircd/Makefile.in.bak"; \ @@ -248,20 +242,6 @@ ${CC} ${CFLAGS} -MM ${CPPFLAGS} ${SRC:hash.c=} >> Makefile.in; ) \ fi -hash.o: hash.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/struct.h ../include/dbuf.h \ - ../include/common.h ../include/match.h ../include/hash.h \ - ../include/channel.h ../include/list.h ../include/send.h \ - ../include/s_serv.h ../include/ircd.h ../include/s_bdd.h \ - ircd.c version.c.SH - @CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" \ - crypt/sums - ${CC} ${CFLAGS} ${CPPFLAGS} -c hash.c -o hash.o - @${RM} -f hash.c - @${MV} -f hash.c.old hash.c - @${TOUCH} hash.o - # Coders: You need GNU make for this to work Makefile: ../config/config.status Makefile.in ../config/gen.ircd.Makefile \ ../config/config.h ../config/.config stamp-m @@ -282,24 +262,24 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -IPcheck.o: IPcheck.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/IPcheck.h \ - ../include/ircd.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/querycmds.h ../include/s_user.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/list.h \ - ../include/send.h ../include/s_bdd.h ../include/support.h +IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/h.h \ + ../include/s_debug.h ../config/config.h ../config/setup.h \ + ../include/ircd_defs.h ../include/ircd.h ../include/struct.h \ + ../include/whowas.h ../include/dbuf.h ../include/runmalloc.h \ + ../include/numnicks.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/s_user.h ../include/send.h \ + ../include/sys.h ../include/querycmds.h ../include/s_bdd.h channel.o: channel.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ ../include/whowas.h ../include/dbuf.h ../include/channel.h \ ../include/parse.h ../include/send.h ../include/s_err.h \ - ../include/numeric.h ../include/ircd.h ../include/common.h \ - ../include/s_bdd.h ../include/match.h ../include/list.h \ - ../include/hash.h ../include/s_misc.h ../include/s_user.h \ - ../include/s_conf.h ../include/s_bsd.h ../include/msg.h \ - ../include/s_serv.h ../include/support.h ../include/numnicks.h \ - ../include/sprintf_irc.h ../include/querycmds.h + ../include/numeric.h ../include/ircd.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/s_bdd.h ../include/match.h \ + ../include/list.h ../include/hash.h ../include/s_misc.h \ + ../include/s_user.h ../include/s_conf.h ../include/s_bsd.h \ + ../include/msg.h ../include/s_serv.h ../include/support.h \ + ../include/numnicks.h ../include/sprintf_irc.h ../include/querycmds.h class.o: class.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -311,11 +291,13 @@ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/ircd.h \ ../include/match.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/list.h ../include/common.h ../include/crule.h + ../include/list.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/crule.h dbuf.o: dbuf.c ../include/h.h ../include/s_debug.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/common.h \ - ../include/sys.h ../include/runmalloc.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/s_serv.h + ../config/setup.h ../include/ircd_defs.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/sys.h ../include/runmalloc.h \ + ../include/struct.h ../include/whowas.h ../include/dbuf.h \ + ../include/s_serv.h fileio.o: fileio.c ../include/fileio.h ../include/runmalloc.h ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \ ../include/struct.h ../include/whowas.h ../include/h.h \ @@ -337,6 +319,10 @@ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/whowas.h ../include/h.h ../include/s_debug.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/runmalloc.h +ircd_string.o: ircd_string.c ../include/ircd_string.h ../config/config.h \ + ../config/setup.h ../include/ircd_chattr.h ../include/ircd_defs.h \ + ../include/sys.h ../include/runmalloc.h ../include/sprintf_irc.h \ + chattr.tab.c list.o: list.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -344,8 +330,8 @@ ../include/s_conf.h ../include/list.h ../include/class.h \ ../include/match.h ../include/ircd.h ../include/s_serv.h \ ../include/support.h ../include/s_misc.h ../include/s_bsd.h \ - ../include/res.h ../include/common.h ../include/s_user.h \ - ../include/opercmds.h + ../include/res.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_user.h ../include/opercmds.h map.o: map.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -354,18 +340,14 @@ ../include/ircd.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_misc.h ../include/querycmds.h ../include/map.h \ ../include/numnicks.h -match.o: match.c ../include/sys.h ../config/config.h ../config/setup.h \ - ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/match.h \ - ../include/ircd.h +match.o: match.c ../include/match.h ../include/ircd_chattr.h numnicks.o: numnicks.c ../include/numnicks.h ../include/sys.h \ ../config/config.h ../config/setup.h ../include/ircd_defs.h \ ../include/runmalloc.h ../include/h.h ../include/s_debug.h \ ../include/s_serv.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/ircd.h \ - ../include/s_misc.h ../include/match.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/list.h + ../include/dbuf.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/ircd.h ../include/s_misc.h ../include/match.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/list.h opercmds.o: opercmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/opercmds.h \ @@ -374,10 +356,10 @@ ../include/list.h ../include/send.h ../include/s_err.h \ ../include/numeric.h ../include/match.h ../include/s_misc.h \ ../include/class.h ../include/s_bdd.h ../include/s_user.h \ - ../include/common.h ../include/msg.h ../include/sprintf_irc.h \ - ../include/userload.h ../include/parse.h ../include/numnicks.h \ - ../include/crule.h ../include/version.h ../include/support.h \ - ../include/s_serv.h ../include/hash.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/msg.h \ + ../include/sprintf_irc.h ../include/userload.h ../include/parse.h \ + ../include/numnicks.h ../include/crule.h ../include/version.h \ + ../include/support.h ../include/s_serv.h ../include/hash.h packet.o: packet.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -389,14 +371,14 @@ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/send.h \ - ../include/parse.h ../include/common.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/list.h ../include/msg.h \ - ../include/s_user.h ../include/channel.h ../include/s_ping.h \ - ../include/res.h ../include/map.h ../include/s_bdd.h \ - ../include/m_config.h ../include/hash.h ../include/numeric.h \ - ../include/ircd.h ../include/s_misc.h ../include/s_numeric.h \ - ../include/numnicks.h ../include/opercmds.h ../include/querycmds.h \ - ../include/whocmds.h + ../include/parse.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/msg.h ../include/s_user.h \ + ../include/channel.h ../include/s_ping.h ../include/res.h \ + ../include/map.h ../include/s_bdd.h ../include/m_config.h \ + ../include/hash.h ../include/numeric.h ../include/ircd.h \ + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_numeric.h ../include/numnicks.h ../include/opercmds.h \ + ../include/querycmds.h ../include/whocmds.h querycmds.o: querycmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -411,20 +393,20 @@ ../include/ircd_defs.h ../include/runmalloc.h ../include/random.h res.o: res.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ - ../include/s_debug.h ../include/res.h ../include/list.h \ + ../include/s_debug.h ../include/ircd_chattr.h ../include/ircd_string.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ ../include/numeric.h ../include/send.h ../include/s_err.h \ ../include/s_misc.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/ircd.h ../include/s_ping.h ../include/support.h \ - ../include/common.h ../include/sprintf_irc.h + ../include/list.h ../include/ircd.h ../include/s_ping.h \ + ../include/support.h ../include/sprintf_irc.h s_auth.o: s_auth.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/res.h ../include/list.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/common.h ../include/send.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_misc.h ../include/s_serv.h \ - ../include/support.h ../include/ircd.h ../include/s_auth.h \ - ../include/sprintf_irc.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/send.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ + ../include/s_serv.h ../include/support.h ../include/ircd.h \ + ../include/s_auth.h ../include/sprintf_irc.h s_bdd.o: s_bdd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -432,11 +414,11 @@ ../include/s_misc.h ../include/sprintf_irc.h ../include/send.h \ ../include/s_err.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_conf.h ../include/list.h ../include/hash.h \ - ../include/common.h ../include/match.h ../include/crule.h \ - ../include/parse.h ../include/numnicks.h ../include/userload.h \ - ../include/s_user.h ../include/channel.h ../include/querycmds.h \ - ../include/IPcheck.h ../include/s_bdd.h ../include/msg.h \ - ../include/support.h + ../include/match.h ../include/crule.h ../include/parse.h \ + ../include/numnicks.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/userload.h ../include/s_user.h ../include/channel.h \ + ../include/querycmds.h ../include/IPcheck.h ../include/s_bdd.h \ + ../include/msg.h ../include/support.h s_bsd.o: s_bsd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/res.h ../include/list.h \ @@ -447,20 +429,21 @@ ../include/ircd.h ../include/support.h ../include/s_auth.h \ ../include/class.h ../include/packet.h ../include/s_ping.h \ ../include/channel.h ../include/version.h ../include/parse.h \ - ../include/common.h ../include/bsd.h ../include/numnicks.h \ - ../include/s_user.h ../include/sprintf_irc.h ../include/querycmds.h \ - ../include/IPcheck.h ../include/s_socks.h ../include/msg.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/bsd.h \ + ../include/numnicks.h ../include/s_user.h ../include/sprintf_irc.h \ + ../include/querycmds.h ../include/IPcheck.h ../include/s_socks.h \ + ../include/msg.h s_conf.o: s_conf.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/opercmds.h \ ../include/numeric.h ../include/send.h ../include/s_conf.h \ ../include/list.h ../include/class.h ../include/s_misc.h \ - ../include/match.h ../include/common.h ../include/s_err.h \ - ../include/s_bsd.h ../include/ircd.h ../include/crule.h \ - ../include/res.h ../include/support.h ../include/parse.h \ - ../include/numnicks.h ../include/sprintf_irc.h ../include/IPcheck.h \ - ../include/hash.h ../include/fileio.h + ../include/match.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_err.h ../include/s_bsd.h ../include/ircd.h \ + ../include/crule.h ../include/res.h ../include/support.h \ + ../include/parse.h ../include/numnicks.h ../include/sprintf_irc.h \ + ../include/IPcheck.h ../include/hash.h ../include/fileio.h s_debug.o: s_debug.c ../include/channel.h ../include/ircd_defs.h \ ../include/h.h ../include/s_debug.h ../config/config.h \ ../config/setup.h ../include/class.h ../include/hash.h \ @@ -478,12 +461,13 @@ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_serv.h ../include/numeric.h \ ../include/send.h ../include/s_conf.h ../include/list.h \ - ../include/s_misc.h ../include/common.h ../include/match.h \ - ../include/hash.h ../include/s_bsd.h ../include/res.h ../include/ircd.h \ - ../include/s_ping.h ../include/channel.h ../include/s_err.h \ - ../include/support.h ../include/userload.h ../include/parse.h \ - ../include/s_user.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/match.h ../include/hash.h ../include/s_bsd.h \ + ../include/res.h ../include/ircd.h ../include/s_ping.h \ + ../include/channel.h ../include/s_err.h ../include/support.h \ + ../include/userload.h ../include/parse.h ../include/s_user.h \ + ../include/numnicks.h ../include/sprintf_irc.h ../include/querycmds.h \ + ../include/IPcheck.h s_numeric.o: s_numeric.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -499,8 +483,8 @@ ../include/list.h ../include/match.h ../include/res.h \ ../include/s_bsd.h ../include/s_serv.h ../include/ircd.h \ ../include/s_ping.h ../include/support.h ../include/numeric.h \ - ../include/s_user.h ../include/s_err.h ../include/common.h \ - ../include/numnicks.h + ../include/s_user.h ../include/s_err.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/numnicks.h s_serv.o: s_serv.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ @@ -508,49 +492,52 @@ ../include/s_misc.h ../include/sprintf_irc.h ../include/send.h \ ../include/s_err.h ../include/numeric.h ../include/s_bsd.h \ ../include/s_conf.h ../include/list.h ../include/hash.h \ - ../include/common.h ../include/s_bdd.h ../include/msg.h \ - ../include/m_config.h ../include/match.h ../include/crule.h \ - ../include/parse.h ../include/numnicks.h ../include/userload.h \ - ../include/s_user.h ../include/channel.h ../include/querycmds.h \ - ../include/IPcheck.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/s_bdd.h \ + ../include/msg.h ../include/m_config.h ../include/match.h \ + ../include/crule.h ../include/parse.h ../include/numnicks.h \ + ../include/userload.h ../include/s_user.h ../include/channel.h \ + ../include/querycmds.h ../include/IPcheck.h s_socks.o: s_socks.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/res.h ../include/list.h \ ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/common.h ../include/send.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_misc.h ../include/support.h \ - ../include/ircd.h ../include/s_socks.h ../include/sprintf_irc.h \ - ../include/hash.h ../include/IPcheck.h ../include/s_bdd.h + ../include/ircd_chattr.h ../include/ircd_string.h ../include/send.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ + ../include/support.h ../include/ircd.h ../include/s_socks.h \ + ../include/sprintf_irc.h ../include/hash.h ../include/IPcheck.h \ + ../include/s_bdd.h s_user.o: s_user.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/common.h ../include/s_serv.h \ - ../include/numeric.h ../include/send.h ../include/s_conf.h \ - ../include/list.h ../include/s_misc.h ../include/match.h \ - ../include/hash.h ../include/s_bsd.h ../include/s_err.h \ - ../include/parse.h ../include/s_bdd.h ../include/ircd.h \ - ../include/s_user.h ../include/support.h ../include/channel.h \ - ../include/random.h ../include/version.h ../include/msg.h \ - ../include/userload.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h ../include/class.h + ../include/dbuf.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/s_serv.h ../include/numeric.h ../include/send.h \ + ../include/s_conf.h ../include/list.h ../include/s_misc.h \ + ../include/match.h ../include/hash.h ../include/s_bsd.h \ + ../include/s_err.h ../include/parse.h ../include/s_bdd.h \ + ../include/ircd.h ../include/s_user.h ../include/support.h \ + ../include/channel.h ../include/random.h ../include/version.h \ + ../include/msg.h ../include/userload.h ../include/numnicks.h \ + ../include/sprintf_irc.h ../include/querycmds.h ../include/IPcheck.h \ + ../include/class.h send.o: send.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ ../include/dbuf.h ../include/s_bsd.h ../include/s_conf.h \ ../include/list.h ../include/s_serv.h ../include/send.h \ - ../include/s_misc.h ../include/common.h ../include/match.h \ - ../include/ircd.h ../include/channel.h ../include/bsd.h \ - ../include/class.h ../include/s_user.h ../include/sprintf_irc.h + ../include/s_misc.h ../include/ircd_chattr.h ../include/ircd_string.h \ + ../include/match.h ../include/ircd.h ../include/channel.h \ + ../include/bsd.h ../include/class.h ../include/s_user.h \ + ../include/sprintf_irc.h sprintf_irc.o: sprintf_irc.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/sprintf_irc.h -support.o: support.c ../include/sys.h ../config/config.h \ - ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/send.h ../include/ircd.h \ - ../include/struct.h ../include/whowas.h ../include/dbuf.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/list.h \ - ../include/support.h ../include/sprintf_irc.h ../include/common.h \ - ../include/fileio.h +support.o: support.c ../include/fileio.h ../include/ircd.h \ + ../config/config.h ../config/setup.h ../include/struct.h \ + ../include/whowas.h ../include/h.h ../include/s_debug.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/runmalloc.h \ + ../include/ircd_chattr.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/list.h ../include/send.h ../include/sprintf_irc.h \ + ../include/support.h ../include/sys.h userload.o: userload.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ @@ -560,28 +547,31 @@ whocmds.o: whocmds.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/common.h \ - ../include/s_serv.h ../include/numeric.h ../include/send.h \ - ../include/s_conf.h ../include/list.h ../include/s_misc.h \ - ../include/match.h ../include/hash.h ../include/s_bsd.h \ - ../include/s_err.h ../include/parse.h ../include/ircd.h \ - ../include/s_user.h ../include/support.h ../include/channel.h \ - ../include/random.h ../include/version.h ../include/msg.h \ - ../include/userload.h ../include/numnicks.h ../include/sprintf_irc.h \ - ../include/querycmds.h ../include/IPcheck.h ../include/whocmds.h + ../include/whowas.h ../include/dbuf.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/s_serv.h ../include/numeric.h \ + ../include/send.h ../include/s_conf.h ../include/list.h \ + ../include/s_misc.h ../include/match.h ../include/hash.h \ + ../include/s_bsd.h ../include/s_err.h ../include/parse.h \ + ../include/ircd.h ../include/s_user.h ../include/support.h \ + ../include/channel.h ../include/random.h ../include/version.h \ + ../include/msg.h ../include/userload.h ../include/numnicks.h \ + ../include/sprintf_irc.h ../include/querycmds.h ../include/IPcheck.h \ + ../include/whocmds.h whowas.o: whowas.c ../include/sys.h ../config/config.h ../config/setup.h \ - ../include/ircd_defs.h ../include/runmalloc.h ../include/common.h \ - ../include/h.h ../include/s_debug.h ../include/struct.h \ - ../include/whowas.h ../include/dbuf.h ../include/numeric.h \ - ../include/send.h ../include/s_misc.h ../include/s_err.h \ - ../include/ircd.h ../include/list.h ../include/s_user.h \ - ../include/support.h ../include/s_bsd.h ../include/s_conf.h + ../include/ircd_defs.h ../include/runmalloc.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/h.h ../include/s_debug.h \ + ../include/struct.h ../include/whowas.h ../include/dbuf.h \ + ../include/numeric.h ../include/send.h ../include/s_misc.h \ + ../include/s_err.h ../include/ircd.h ../include/list.h \ + ../include/s_user.h ../include/support.h ../include/s_bsd.h \ + ../include/s_conf.h m_config.o: m_config.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ - ../include/h.h ../include/s_debug.h ../include/common.h \ - ../include/ircd.h ../include/struct.h ../include/whowas.h \ - ../include/dbuf.h ../include/s_serv.h ../include/msg.h \ - ../include/s_conf.h ../include/list.h ../include/m_config.h + ../include/h.h ../include/s_debug.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/ircd.h ../include/struct.h \ + ../include/whowas.h ../include/dbuf.h ../include/s_serv.h \ + ../include/msg.h ../include/s_conf.h ../include/list.h \ + ../include/m_config.h m_watch.o: m_watch.c ../include/sys.h ../config/config.h \ ../config/setup.h ../include/ircd_defs.h ../include/runmalloc.h \ ../include/h.h ../include/s_debug.h ../include/hash.h ../include/ircd.h \ @@ -589,9 +579,6 @@ ../include/list.h ../include/msg.h ../include/numeric.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_err.h \ ../include/s_user.h ../include/send.h ../include/support.h -common.o: common.c ../include/common.h ../include/sys.h \ - ../config/config.h ../config/setup.h ../include/ircd_defs.h \ - ../include/runmalloc.h bsd.o: bsd.c ../include/sys.h ../config/config.h ../config/setup.h \ ../include/ircd_defs.h ../include/runmalloc.h ../include/h.h \ ../include/s_debug.h ../include/struct.h ../include/whowas.h \ Index: channel.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/channel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- channel.c 15 Aug 2002 20:55:23 -0000 1.3 +++ channel.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ */ #include "sys.h" @@ -29,7 +31,8 @@ #include "s_err.h" #include "numeric.h" #include "ircd.h" -#include "common.h" +#include "ircd_string.h" +#include "ircd_chattr.h" #if defined(BDD) #include "s_bdd.h" #endif @@ -41,7 +44,6 @@ #include "s_conf.h" #include "s_bsd.h" #include "msg.h" -#include "common.h" #include "s_serv.h" #include "channel.h" #include "support.h" @@ -1547,7 +1549,7 @@ */ if (IsServer(sptr)) { - if (parc == 1 && isDigit(*curr)) + if (parc == 1 && IsDigit(*curr)) { newtime = atoi(curr); if (newtime && chptr->creationtime == MAGIC_REMOTE_JOIN_TS) @@ -2384,16 +2386,16 @@ { for (; *cn; cn++) { - if (!isIrcCh(*cn)) + if (!IsChannelChar(*cn)) { *cn = '\0'; return; } - if (isIrcCl(*cn)) + if (IsChannelLower(*cn)) #ifndef FIXME { #endif - *cn = toLower(*cn); + *cn = ToLower(*cn); #ifndef FIXME /* Missed the Icelandic letter ETH last time: */ if ((unsigned char)(*cn) == 0xd0) @@ -2615,7 +2617,7 @@ for (p = parv[1]; *p; p++) /* find the last "JOIN 0" in the line -Kev */ if (*p == '0' - && (*(p + 1) == ',' || *(p + 1) == '\0' || !isIrcCh(*(p + 1)))) + && (*(p + 1) == ',' || *(p + 1) == '\0' || !IsChannelChar(*(p + 1)))) { /* If it's a single "0", remember the place; we will start parsing the channels after the last 0 in the line -Kev */ @@ -2644,7 +2646,7 @@ * Rebuild list of channels joined to be the actual result of the * JOIN. Note that "JOIN 0" is the destructive problem. */ - for (name = strtoken(&p, parv[1], ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) { size_t len; if (MyConnect(sptr)) @@ -2912,7 +2914,7 @@ if (*jbuf) { /* check for channels that need TS's */ p = NULL; - for (name = strtoken(&p, jbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, jbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); if (chptr && chptr->mode.mode & MODE_SENDTS) @@ -2954,7 +2956,7 @@ if (*mbuf) { /* ok, send along modes for creation events to P9 */ p = NULL; - for (name = strtoken(&p, mbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, mbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) { chptr = get_channel(sptr, name, !CREATE); sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, @@ -3039,7 +3041,7 @@ *cbuf = '\0'; /* Start with empty buffer */ /* For each channel in the comma seperated list: */ - for (name = strtoken(&p, parv[1], ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, parv[1], ","); name; name = ircd_strtok(&p, NULL, ",")) { badop = 0; /* Default is to accept the op */ if ((chptr = FindChannel(name))) @@ -3125,7 +3127,7 @@ is not needed after all are 2.10 */ sendto_lowprot_butone(cptr, 9, ":%s JOIN %s", parv[0], cbuf); p = NULL; - for (name = strtoken(&p, cbuf, ","); name; name = strtoken(&p, NULL, ",")) + for (name = ircd_strtok(&p, cbuf, ","); name; name = ircd_strtok(&p, NULL, ",")) sendto_lowprot_butone(cptr, 9, ":%s MODE %s +o %s " TIME_T_FMT, sptr->user->server->name, name, parv[0], chanTS); #endif @@ -3615,7 +3617,7 @@ if (netride) break; /* Ignore bans */ /* Run over all bans */ - for (pv = parv[n] + 1; (ban = strtoken(&p, pv, " ")); pv = NULL) + for (pv = parv[n] + 1; (ban = ircd_strtok(&p, pv, " ")); pv = NULL) { int ret; /* @@ -3646,7 +3648,7 @@ /* Default mode: */ int default_mode = CHFL_DEOPPED; /* Run over all nicks */ - for (pv = parv[n]; (nick = strtoken(&p, pv, ",")); pv = NULL) + for (pv = parv[n]; (nick = ircd_strtok(&p, pv, ",")); pv = NULL) { aClient *acptr; if ((ptr = strchr(nick, ':'))) /* New default mode ? */ @@ -4026,7 +4028,7 @@ return 0; } - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = get_channel(sptr, name, !CREATE); if (!chptr) @@ -4350,7 +4352,7 @@ if (parc > 2) topic = parv[parc - 1]; - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = NULL; #if defined(BDD) @@ -4653,7 +4655,7 @@ case '>': { p++; - if (!isDigit(*p)) + if (!IsDigit(*p)) show_usage = 1; else { @@ -4772,7 +4774,7 @@ return 0; } - for (; (name = strtoken(&p, parv[1], ",")); parv[1] = NULL) + for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = NULL) { chptr = FindChannel(name); if (chptr && ShowChannel(sptr, chptr) && sptr->user) Index: chkconf.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/chkconf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- chkconf.c 18 Aug 2002 22:49:42 -0000 1.7 +++ chkconf.c 21 Aug 2002 17:59:40 -0000 1.8 @@ -39,7 +39,7 @@ #include "h.h" #include "s_conf.h" #include "class.h" -#include "common.h" +#include "ircd_string.h" #include "ircd.h" #include "fileio.h" #include <errno.h> @@ -477,7 +477,7 @@ { if (flags & aconf->status) fprintf(stderr, "ERROR: multiple %c-lines\n", - toUpper(confchar(aconf->status))); + ToUpper(confchar(aconf->status))); else flags |= aconf->status; } Index: crule.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/crule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- crule.c 15 Aug 2002 20:55:24 -0000 1.2 +++ crule.c 21 Aug 2002 17:59:40 -0000 1.3 @@ -41,7 +41,8 @@ #include "ircd.h" #include "match.h" #include "s_bsd.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "crule.h" #else /* includes and defines to make the stand-alone test parser */ @@ -343,7 +344,7 @@ *next_tokp = CR_END; break; default: - if ((isAlpha(*(--(*ruleptr)))) || (**ruleptr == '*') || + if ((IsAlpha(*(--(*ruleptr)))) || (**ruleptr == '*') || (**ruleptr == '?') || (**ruleptr == '.') || (**ruleptr == '-')) *next_tokp = CR_WORD; else @@ -360,7 +361,7 @@ word_ptr = word; while ((size_t)(word_ptr - word) < maxlen - && (isAlnum(**ruleptr) + && (IsAlnum(**ruleptr) || **ruleptr == '*' || **ruleptr == '?' || **ruleptr == '.' || **ruleptr == '-')) *word_ptr++ = *(*ruleptr)++; Index: dbuf.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/dbuf.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dbuf.c 15 Aug 2002 20:55:24 -0000 1.2 +++ dbuf.c 21 Aug 2002 17:59:40 -0000 1.3 @@ -18,7 +18,8 @@ */ #include "h.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "sys.h" #include "struct.h" #include "dbuf.h" @@ -505,7 +506,7 @@ /* * flush extra line terms */ - while (isEol(*db->start)) + while (IsEol(*db->start)) { if (++db->start == db->end) { @@ -559,7 +560,7 @@ while (length > 0) { end = MIN(db->end, (start + length)); - while (start < end && !isEol(*start)) + while (start < end && !IsEol(*start)) *buf++ = *start++; count = start - db->start; Index: hash.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/hash.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hash.c 18 Aug 2002 22:59:22 -0000 1.3 +++ hash.c 21 Aug 2002 17:59:40 -0000 1.4 @@ -25,7 +25,8 @@ #include <limits.h> #include "h.h" #include "struct.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #if defined(BDD) #include "s_bdd.h" #endif @@ -176,7 +177,7 @@ /* This is what the hash function will consider "equal" chars, this function MUST be transitive, if HASHEQ(y,x)&&HASHEQ(y,z) then HASHEQ(y,z), and MUST be symmetric, if HASHEQ(a,b) then HASHEQ(b,a), obvious ok but... :) */ -#define HASHEQ(x,y) (((char) toLower((char) x)) == ((char) toLower((char) y))) +#define HASHEQ(x,y) (((char) ToLower((char) x)) == ((char) ToLower((char) y))) /* hash_init * Initialize the maps used by hash functions and clear the tables */ @@ -497,7 +498,7 @@ strncpy(temp, nicks, 512); temp[512] = '\000'; p = NULL; - for (one = strtoken(&p, temp, ","); one; one = strtoken(&p, NULL, ",")) + for (one = ircd_strtok(&p, temp, ","); one; one = ircd_strtok(&p, NULL, ",")) { if (!*one) continue; Index: list.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/list.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- list.c 18 Aug 2002 22:59:22 -0000 1.4 +++ list.c 21 Aug 2002 17:59:40 -0000 1.5 @@ -33,7 +33,8 @@ #include "s_bsd.h" #include "whowas.h" #include "res.h" -#include "common.h" +#include "ircd_chattr.h" +#include "ircd_string.h" #include "list.h" #include "s_user.h" #include "opercmds.h" Index: m_config.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/m_config.c,v retrieving revision 1.1.1.1 retrieving... [truncated message content] |