aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgenheader.sh2
-rw-r--r--libhashtable.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/genheader.sh b/genheader.sh
index 3995579..b3a28e6 100755
--- a/genheader.sh
+++ b/genheader.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-cat libhashtable.c | head -n 22 | tail -n 16 > hashtable.h
+cat libhashtable.c | grep -A 100 _A_ | grep -B 100 _B_ | grep -v "_[AB]_" > hashtable.h
cat libhashtable.c | grep '(.*) *{' | egrep -v 'if|for|while' | sed 's/ {/;/' >> hashtable.h
diff --git a/libhashtable.c b/libhashtable.c
index 9eb0ed4..e838433 100644
--- a/libhashtable.c
+++ b/libhashtable.c
@@ -3,7 +3,7 @@
#include <string.h>
#include "hashtable.h"
-/*
+/* _A_
struct entry {//linked list node.
char *original;
void *target;
@@ -20,7 +20,7 @@ struct hashtable {
struct hitem **bucket;
int *keys;
};
-*/
+ _B_ */
unsigned short hash(char *key) {//maybe use a seeded rand()? :) Thanks FreeArtMan
return (strlen(key)<<8)+(key[0]<<4)+key[1];