Update of /cvsroot/mahogany/M/lib/dspam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14352
Modified Files:
config.h lht.c lht.h libdspam.c libdspam.h libdspam_objects.h
sqlite_drv.c storage_driver.h tbt.c util.c
Log Message:
reverted longlong_t chaneg at authors request; use long long directly again
Index: config.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/config.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -2 -r1.3 -r1.4
--- config.h 9 Jul 2004 21:23:21 -0000 1.3
+++ config.h 10 Jul 2004 15:58:11 -0000 1.4
@@ -108,8 +108,4 @@
#endif
-#ifndef longlong_t
-#define longlong_t long long
-#endif
-
#ifndef LL_FMT_SPEC
#define LL_FMT_SPEC "ll"
Index: lht.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/lht.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- lht.c 10 Jul 2004 11:11:38 -0000 1.4
+++ lht.c 10 Jul 2004 15:58:11 -0000 1.5
@@ -41,5 +41,5 @@
static struct lht_node *
-lht_node_create (unsigned longlong_t key)
+lht_node_create (unsigned long long key)
{
struct lht_node *node;
@@ -117,5 +117,5 @@
int
-lht_getfrequency (struct lht *lht, unsigned longlong_t key)
+lht_getfrequency (struct lht *lht, unsigned long long key)
{
unsigned long hash_code;
@@ -137,5 +137,5 @@
char *
-lht_gettoken (struct lht *lht, unsigned longlong_t key)
+lht_gettoken (struct lht *lht, unsigned long long key)
{
unsigned long hash_code;
@@ -157,5 +157,5 @@
int
-lht_getspamstat (struct lht *lht, unsigned longlong_t key,
+lht_getspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s)
{
@@ -185,5 +185,5 @@
int
-lht_delete (struct lht *lht, unsigned longlong_t key)
+lht_delete (struct lht *lht, unsigned long long key)
{
unsigned long hash_code;
@@ -269,5 +269,5 @@
int
-lht_hit (struct lht *lht, unsigned longlong_t key, const char *token_name)
+lht_hit (struct lht *lht, unsigned long long key, const char *token_name)
{
unsigned long hash_code;
@@ -333,5 +333,5 @@
int
-lht_setfrequency (struct lht *lht, unsigned longlong_t key,
+lht_setfrequency (struct lht *lht, unsigned long long key,
int frequency)
{
@@ -388,5 +388,5 @@
int
-lht_settoken (struct lht *lht, unsigned longlong_t key, const char *token_name)
+lht_settoken (struct lht *lht, unsigned long long key, const char *token_name)
{
unsigned long hash_code;
@@ -452,5 +452,5 @@
int
-lht_setspamstat (struct lht *lht, unsigned longlong_t key,
+lht_setspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s)
{
@@ -513,5 +513,5 @@
int
-lht_addspamstat (struct lht *lht, unsigned longlong_t key,
+lht_addspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s)
{
Index: lht.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/lht.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- lht.h 9 Jul 2004 21:23:21 -0000 1.2
+++ lht.h 10 Jul 2004 15:58:11 -0000 1.3
@@ -39,5 +39,5 @@
unsigned long size;
unsigned long items;
- unsigned longlong_t whitelist_token;
+ unsigned long long whitelist_token;
struct lht_node **tbl;
struct nt *order;
@@ -48,5 +48,5 @@
struct lht_node
{
- unsigned longlong_t key;
+ unsigned long long key;
struct lht_node *next;
@@ -69,26 +69,26 @@
/* read-only functions */
-int lht_getfrequency(struct lht *lht, unsigned longlong_t key);
-char * lht_gettoken (struct lht *lht, unsigned longlong_t key);
-int lht_getspamstat (struct lht *lht, unsigned longlong_t key,
+int lht_getfrequency(struct lht *lht, unsigned long long key);
+char * lht_gettoken (struct lht *lht, unsigned long long key);
+int lht_getspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s);
/* read-write functions */
-int lht_setfrequency (struct lht *lht, unsigned longlong_t key,
+int lht_setfrequency (struct lht *lht, unsigned long long key,
int frequency);
-int lht_settoken (struct lht *lht, unsigned longlong_t key,
+int lht_settoken (struct lht *lht, unsigned long long key,
const char *token_name);
-int lht_setspamstat (struct lht *lht, unsigned longlong_t key,
+int lht_setspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s);
-int lht_addspamstat (struct lht *lht, unsigned longlong_t key,
+int lht_addspamstat (struct lht *lht, unsigned long long key,
struct _ds_spam_stat *s);
-int lht_hit (struct lht *lht, unsigned longlong_t key,
+int lht_hit (struct lht *lht, unsigned long long key,
const char *token_name);
-int lht_delete (struct lht *lht, unsigned longlong_t key);
+int lht_delete (struct lht *lht, unsigned long long key);
/* iteration functions */
Index: libdspam.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/libdspam.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -u -2 -r1.5 -r1.6
--- libdspam.c 10 Jul 2004 11:11:38 -0000 1.5
+++ libdspam.c 10 Jul 2004 15:58:11 -0000 1.6
@@ -411,5 +411,5 @@
int spammy = 0;
- unsigned longlong_t whitelist_token = 0;
+ unsigned long long whitelist_token = 0;
int do_whitelist = 0;
@@ -601,5 +601,5 @@
char *url_ptr = url_body;
int url_length;
- unsigned longlong_t crc;
+ unsigned long long crc;
token = strstr (url_ptr, "http://");
@@ -643,5 +643,5 @@
char *url_ptr = url_body;
int url_length;
- unsigned longlong_t crc;
+ unsigned long long crc;
url_ptr = url_body;
@@ -1024,5 +1024,5 @@
#endif
{
- unsigned longlong_t crc;
+ unsigned long long crc;
char *token_name;
@@ -1432,5 +1432,5 @@
while (node_lht != NULL)
{
- unsigned longlong_t crc;
+ unsigned long long crc;
crc = node_lht->key;
@@ -1658,5 +1658,5 @@
int
-_ds_calc_stat (DSPAM_CTX * CTX, unsigned longlong_t token,
+_ds_calc_stat (DSPAM_CTX * CTX, unsigned long long token,
struct _ds_spam_stat *s)
{
@@ -1771,5 +1771,5 @@
int len = 0;
int is_received;
- unsigned longlong_t crc;
+ unsigned long long crc;
char *tweaked_token;
@@ -1854,5 +1854,5 @@
char combined_token[256];
int len;
- unsigned longlong_t crc;
+ unsigned long long crc;
char *tweaked_token;
Index: libdspam.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/libdspam.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- libdspam.h 9 Jul 2004 21:23:21 -0000 1.2
+++ libdspam.h 10 Jul 2004 15:58:11 -0000 1.3
@@ -93,5 +93,5 @@
int _ds_calc_stat (DSPAM_CTX * CTX,
- unsigned longlong_t token,
+ unsigned long long token,
struct _ds_spam_stat *);
Index: libdspam_objects.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/libdspam_objects.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- libdspam_objects.h 10 Jul 2004 11:11:38 -0000 1.4
+++ libdspam_objects.h 10 Jul 2004 15:58:11 -0000 1.5
@@ -199,5 +199,5 @@
struct _ds_signature_token
{
- unsigned longlong_t token;
+ unsigned long long token;
unsigned char frequency;
};
Index: sqlite_drv.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/sqlite_drv.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -u -2 -r1.6 -r1.7
--- sqlite_drv.c 9 Jul 2004 21:23:21 -0000 1.6
+++ sqlite_drv.c 10 Jul 2004 15:58:11 -0000 1.7
@@ -235,5 +235,5 @@
char scratch[1024];
struct _ds_spam_stat stat;
- unsigned longlong_t token = 0;
+ unsigned long long token = 0;
char *err=NULL, **row;
int nrow, ncolumn, get_one = 0, i;
@@ -481,5 +481,5 @@
int
-_ds_get_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token,
+_ds_get_spamrecord (DSPAM_CTX * CTX, unsigned long long token,
struct _ds_spam_stat *stat)
{
@@ -525,5 +525,5 @@
int
-_ds_set_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token,
+_ds_set_spamrecord (DSPAM_CTX * CTX, unsigned long long token,
struct _ds_spam_stat *stat)
{
@@ -1264,5 +1264,5 @@
int
-_ds_del_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token)
+_ds_del_spamrecord (DSPAM_CTX * CTX, unsigned long long token)
{
struct _sqlite_drv_storage *s = (struct _sqlite_drv_storage *) CTX->storage;
Index: storage_driver.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/storage_driver.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- storage_driver.h 9 Jul 2004 21:23:21 -0000 1.2
+++ storage_driver.h 10 Jul 2004 15:58:11 -0000 1.3
@@ -27,5 +27,5 @@
struct _ds_storage_record
{
- unsigned longlong_t token;
+ unsigned long long token;
long spam_hits;
long innocent_hits;
@@ -74,9 +74,9 @@
int _ds_delall_spamrecords (DSPAM_CTX * CTX, struct lht *lht);
-int _ds_get_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token,
+int _ds_get_spamrecord (DSPAM_CTX * CTX, unsigned long long token,
struct _ds_spam_stat *stat);
-int _ds_set_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token,
+int _ds_set_spamrecord (DSPAM_CTX * CTX, unsigned long long token,
struct _ds_spam_stat *stat);
-int _ds_del_spamrecord (DSPAM_CTX * CTX, unsigned longlong_t token);
+int _ds_del_spamrecord (DSPAM_CTX * CTX, unsigned long long token);
/* Iteration calls */
Index: tbt.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/tbt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- tbt.c 10 Jul 2004 11:11:38 -0000 1.4
+++ tbt.c 10 Jul 2004 15:58:11 -0000 1.5
@@ -32,5 +32,5 @@
static struct tbt_node *
-tbt_node_create (double probability, unsigned longlong_t token, int type)
+tbt_node_create (double probability, unsigned long long token, int type)
{
struct tbt_node *node;
@@ -145,5 +145,5 @@
int
-tbt_add (struct tbt *tbt, double probability, unsigned longlong_t token,
+tbt_add (struct tbt *tbt, double probability, unsigned long long token,
unsigned long frequency, int complexity)
{
Index: util.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -2 -r1.3 -r1.4
--- util.c 9 Jul 2004 21:23:21 -0000 1.3
+++ util.c 10 Jul 2004 15:58:11 -0000 1.4
@@ -433,9 +433,9 @@
}
-unsigned longlong_t
+unsigned long long
_ds_getcrc64 (const char *s)
{
- static unsigned longlong_t CRCTable[256];
- unsigned longlong_t crc = 0;
+ static unsigned long long CRCTable[256];
+ unsigned long long crc = 0;
static int init = 0;
@@ -447,5 +447,5 @@
{
int j;
- unsigned longlong_t part = i;
+ unsigned long long part = i;
for (j = 0; j < 8; j++)
{
@@ -460,7 +460,7 @@
for (; *s; s++)
{
- unsigned longlong_t temp1 = crc >> 8;
- unsigned longlong_t temp2 =
- CRCTable[(crc ^ (unsigned longlong_t) *s) & 0xff];
+ unsigned long long temp1 = crc >> 8;
+ unsigned long long temp2 =
+ CRCTable[(crc ^ (unsigned long long) *s) & 0xff];
crc = temp1 ^ temp2;
}
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates