diff options
author | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-09-15 02:46:47 -0500 |
---|---|---|
committer | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-09-15 02:48:47 -0500 |
commit | 7f82cd9b726f69f01c243833058e438c4e22b84f (patch) | |
tree | d486bd12def255048b27fa1d357036059451ee52 /libhashtable/hashtable.h | |
parent | 9b8d802ca89027de46ee45fbc9adf978a16e7927 (diff) | |
download | segfault-7f82cd9b726f69f01c243833058e438c4e22b84f.tar.gz segfault-7f82cd9b726f69f01c243833058e438c4e22b84f.zip |
did the TODO of making builtins use a hashtable.
added two commands for dealing with them.
if you want you can override builtins for security reasons? :)
added a small program for doing tail -f for systems that may not have tail -f
Diffstat (limited to 'libhashtable/hashtable.h')
-rw-r--r-- | libhashtable/hashtable.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libhashtable/hashtable.h b/libhashtable/hashtable.h index 820d230..f0e2a15 100644 --- a/libhashtable/hashtable.h +++ b/libhashtable/hashtable.h @@ -1,23 +1,23 @@ -struct entry {//linked list node. +struct entry {/*linked list node.*/ char *original; - char *target; - struct entry *prev;// doubly linked list. why? + void *target; + struct entry *prev;/* doubly linked list. why? */ struct entry *next; }; -struct hitem {//dunno why I don't just have this as a linked list. +struct hitem {/*dunno why I don't just have this as a linked list. */ struct entry *ll; }; struct hashtable { - int kl;//number of keys in the table + int kl;/*number of keys in the table*/ struct hitem **bucket; int *keys; }; -unsigned short hash(char *v);//maybe use a seeded rand()? :) Thanks FreeArtMan +unsigned short hash(char *key);/*maybe use a seeded rand()? :) Thanks FreeArtMan*/ void inittable(struct hashtable *ht,int tsize); -int ht_setkey(struct hashtable *ht,char *key,char *value); +int ht_setkey(struct hashtable *ht,char *key,void *value); struct entry *ll_getentry(struct entry *start,char *msg); struct entry *ht_getentry(struct hashtable *ht,char *key); struct entry *ht_getnode(struct hashtable *ht,char *msg); -char *ht_getvalue(struct hashtable *ht,char *msg); +void *ht_getvalue(struct hashtable *ht,char *msg); |