CCASSERT(sizeof(unsigned long long) == sizeof(u_int64_t))
#define authnamehash(x) ((x)%AUTHNAMEHASHSIZE)
-#define authnamehashbyname(x) (crc32i(x)%AUTHNAMEHASHSIZE)
+#define authnamehashbyname(x) (irc_crc32i(x)%AUTHNAMEHASHSIZE)
authname *authnametable[AUTHNAMEHASHSIZE];
if (IsAccount(np) && (type & CFACCOUNT)) {
if (np->exts[cfnext] == NULL) {
- np->exts[cfnext] = (void *)crc32(np->authname);
+ np->exts[cfnext] = (void *)irc_crc32(np->authname);
}
return (unsigned long)np->exts[cfnext];
return (unsigned long)np->exts[cfnext];
else {
snprintf(buf, sizeof(buf), "%s@%s", np->ident, np->host->name->content);
- hash = crc32(buf);
+ hash = irc_crc32(buf);
/* if the user is not authed, update the hash */
if (!IsAccount(np)) {
MODULE_VERSION("")
-#define channelhash(x) (crc32i(x)%CHANNELHASHSIZE)
+#define channelhash(x) (irc_crc32i(x)%CHANNELHASHSIZE)
chanindex *chantable[CHANNELHASHSIZE];
sstring *extnames[MAXCHANNELEXTS];
MODULE_VERSION("");
-#define channelhash(x) (crc32i(x)%CHANNELHASHSIZE)
+#define channelhash(x) (irc_crc32i(x)%CHANNELHASHSIZE)
unsigned long nouser;
/* Compute ze hash */
sprintf(hashstr,"%u.%u.%u",rcp->ID,target->ID,rup->ID);
- thehash=crc32(hashstr);
+ thehash=irc_crc32(hashstr);
sprintf(hashstr,"%x",thehash);
maildomain *maildomainnametable[MAILDOMAINHASHSIZE];
maildomain *maildomainIDtable[MAILDOMAINHASHSIZE];
-#define regusernickhash(x) ((crc32i(x))%REGUSERHASHSIZE)
-#define maildomainnamehash(x) ((crc32i(x))%MAILDOMAINHASHSIZE)
+#define regusernickhash(x) ((irc_crc32i(x))%REGUSERHASHSIZE)
+#define maildomainnamehash(x) ((irc_crc32i(x))%MAILDOMAINHASHSIZE)
#define maildomainIDhash(x) ((x)%MAILDOMAINHASHSIZE)
void chanservhashinit() {
#include "../lib/irc_string.h"
#include "../irc/irc_config.h"
-#define chanstatshash(x) (crc32i(x)%CHANSTATSHASHSIZE)
+#define chanstatshash(x) (irc_crc32i(x)%CHANSTATSHASHSIZE)
/*
* findchanstats:
}
-
\ No newline at end of file
+
/* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
/* code or tables extracted from it, as desired without restriction. */
/* Modified by Fox: no more length parameter, always does the whole string */
-unsigned long crc32(const char *s) {
+unsigned long irc_crc32(const char *s) {
const char *cp;
unsigned long crc32val;
}
/* Case insensitive version of the above */
-unsigned long crc32i(const char *s) {
+unsigned long irc_crc32i(const char *s) {
const char *cp;
unsigned long crc32val;
int match2strings(const char *patrn, const char *strng);
int match2patterns(const char *patrn, const char *strng);
-unsigned long crc32(const char *s);
-unsigned long crc32i(const char *s);
+unsigned long irc_crc32(const char *s);
+unsigned long irc_crc32i(const char *s);
int ircd_strcmp(const char *s1, const char *s2);
int ircd_strncmp(const char *s1, const char *s2, size_t len);
char *delchars(char *string, const char *badchars);
{ 'd', AFLAG_DEVELOPER },
{ '\0', 0 } };
-#define nickhash(x) ((crc32i(x))%NICKHASHSIZE)
+#define nickhash(x) ((irc_crc32i(x))%NICKHASHSIZE)
nick *nicktable[NICKHASHSIZE];
nick **servernicks[MAXSERVERS];
#include <string.h>
-#define hosthash(x) ((crc32i(x))%HOSTHASHSIZE)
-#define realnamehash(x) ((crc32(x))%REALNAMEHASHSIZE)
+#define hosthash(x) ((irc_crc32i(x))%HOSTHASHSIZE)
+#define realnamehash(x) ((irc_crc32(x))%REALNAMEHASHSIZE)
host *hosttable[HOSTHASHSIZE];
realname *realnametable[REALNAMEHASHSIZE];
#include "../nick/nick.h"
#define PATRICIANICK_HASHSIZE 5
-#define pn_getidenthash(x) ((crc32i(x)) % PATRICIANICK_HASHSIZE)
+#define pn_getidenthash(x) ((irc_crc32i(x)) % PATRICIANICK_HASHSIZE)
#define PATRICIANICK_MAXRESULTS 1000
typedef struct patricianick_s {
return;
}
- tablecrc=crc32(tli->tablename->content);
+ tablecrc=irc_crc32(tli->tablename->content);
count=strtoul(PQgetvalue(res, 0, 0), NULL, 10);
PQclear(res);
}
if (bot->flags & QAB_FLOODDETECT) {
- crc = crc32i(text);
+ crc = irc_crc32i(text);
if (crc == qab_lastq_crc) {
qab_lastq_count++;
if (qab_lastq_count >= 3) {
newrow->type = 0; /* just in case */
snprintf(glineiddata, sizeof(glineiddata), "%s regexgline %s %s %s %d %d", mynumeric->content, mask, setby, reason, (int)iexpires, newrow->type);
- newrow->glineid = crc32(glineiddata);
+ newrow->glineid = irc_crc32(glineiddata);
}
return newrow;
vsstatistic* v, *pv;
replylen = strlen(reply);
- replycrc = crc32i(reply);
+ replycrc = irc_crc32i(reply);
pv=NULL;
for (v=vsstats; v; v=v->next) {