$Log$
+ Revision 580.78 2001/11/26 03:27:08 ajc
+ * new algorithm to load the use table
+
Revision 580.77 2001/11/17 19:55:08 ajc
* Updated some of the documentation
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
static struct UseTable *ut = NULL;
struct UseTable *uptr = NULL;
char *serialized_table = NULL;
+ char *ptr;
char msgid[SIZ];
char buf[SIZ];
int i;
serialized_table = CtdlGetSysConfig(USETABLE);
if (serialized_table == NULL) return(0);
- for (i=0; i<num_tokens(serialized_table, '\n'); ++i) {
- extract_token(buf, serialized_table, i, '\n');
- uptr = (struct UseTable *)
- mallok(sizeof(struct UseTable));
- if (uptr != NULL) {
- uptr->next = ut;
- extract(msgid, buf, 0);
- uptr->message_id = strdoop(msgid);
- uptr->timestamp = extract_long(buf, 1);
- ut = uptr;
+ ptr = serialized_table;
+ i = 0;
+ buf[0] = 0;
+ while (ptr[0] != 0) {
+ buf[i] = *ptr;
+
+ if (buf[i]=='\n') {
+ buf[i] = 0;
+ if (strlen(buf) > 0) {
+
+ uptr = (struct UseTable *)
+ mallok(sizeof(struct UseTable));
+ if (uptr != NULL) {
+ uptr->next = ut;
+ extract(msgid, buf, 0);
+ uptr->message_id = strdoop(msgid);
+ uptr->timestamp = extract_long(buf, 1);
+ ut = uptr;
+ }
+ }
+
+ i = 0;
+ buf[0] = 0;
+ }
+ else {
+ ++i;
}
+ ++ptr;
}
phree(serialized_table);