dict->start=(DNODE *)malloc(sizeof(DNODE)); // error occurs here /* DNODE and dict defined as following: typedef struct _DICTIONARY { DNODE *hash[MAX_HASH_SLOT]; // the hash table of slots, each slot points to a DNODE DNODE *start; // start of double link list of DNODES terminated by NULL pointer DNODE *end; // points to the last DNODE on this list } __DICTIONARY; typedef struct _DICTIONARY DICTIONARY; extern DICTIONARY *dict; typedef struct _DNODE { struct _DNODE *next; struct _DNODE *prev; void *data; // actual data points to URLNODE char key[KEY_LENGTH]; // actual (URL) key } __DNODE; typedef struct _DNODE DNODE; Initialization: dict->start=(DNODE *)malloc(sizeof(DNODE)); //fault~? why?~ dict->end=(DNODE *)malloc(sizeof(DNODE)); dict->start->prev=dict->start->next=NULL; dict->hash[0]=dict->start; dict->start->data=n; BZERO(dict->start->key,KEY_LENGTH);
extern DICTIONARY *dict;
dict = (DICTIONARY*)malloc(sizeof(DICTIONARY));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)