From 8a679c4ce561110321504d6149888e8868a1b249 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Thu, 30 Apr 2015 13:39:15 -0500 Subject: made genheader.sh not use static sizes for grepping out the structs. --- genheader.sh | 2 +- libhashtable.c | 4 ++-- 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 #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]; -- cgit v1.2.3