diff options
Diffstat (limited to 'comp/cw/code/tokenizer/ads/dict')
-rw-r--r-- | comp/cw/code/tokenizer/ads/dict/Makefile | 4 | ||||
-rw-r--r-- | comp/cw/code/tokenizer/ads/dict/dict.c | 29 | ||||
-rw-r--r-- | comp/cw/code/tokenizer/ads/dict/dict.h | 9 | ||||
-rw-r--r-- | comp/cw/code/tokenizer/ads/dict/dict.o | bin | 1768 -> 0 bytes | |||
-rwxr-xr-x | comp/cw/code/tokenizer/ads/dict/dicttest | bin | 20536 -> 0 bytes | |||
-rw-r--r-- | comp/cw/code/tokenizer/ads/dict/dicttest.c | 10 |
6 files changed, 0 insertions, 52 deletions
diff --git a/comp/cw/code/tokenizer/ads/dict/Makefile b/comp/cw/code/tokenizer/ads/dict/Makefile deleted file mode 100644 index f224267..0000000 --- a/comp/cw/code/tokenizer/ads/dict/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -all: dict.c - cc dict.c -c -o dict.o -test: all - cc dict.o dicttest.c -o dicttest diff --git a/comp/cw/code/tokenizer/ads/dict/dict.c b/comp/cw/code/tokenizer/ads/dict/dict.c deleted file mode 100644 index 551afca..0000000 --- a/comp/cw/code/tokenizer/ads/dict/dict.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdlib.h> -#include <string.h> - -typedef struct dict_t { - int id; - void *data; -}dict_t; - -dict_t *dictalloc(){ - dict_t *output = malloc(sizeof(dict_t)); - return output; -} - -int dictset(dict_t *dict, int id, void *data){ - dict->id = id; - - dict->data = malloc(sizeof(data)); - if (dict->data == NULL) - return 1; - memcpy(dict->data, data, sizeof(data)); - - return 0; -} - -void dictfree(dict_t *dict){ - free(dict->data); - free(dict); -} - diff --git a/comp/cw/code/tokenizer/ads/dict/dict.h b/comp/cw/code/tokenizer/ads/dict/dict.h deleted file mode 100644 index e6ab69d..0000000 --- a/comp/cw/code/tokenizer/ads/dict/dict.h +++ /dev/null @@ -1,9 +0,0 @@ -typedef struct dict_t { - int id; - void *data; -}dict_t; - -dict_t *dictalloc(); -int dictset(dict_t *dict, int id, void *data); -void dictfree(dict_t *dict); - diff --git a/comp/cw/code/tokenizer/ads/dict/dict.o b/comp/cw/code/tokenizer/ads/dict/dict.o Binary files differdeleted file mode 100644 index aefd77a..0000000 --- a/comp/cw/code/tokenizer/ads/dict/dict.o +++ /dev/null diff --git a/comp/cw/code/tokenizer/ads/dict/dicttest b/comp/cw/code/tokenizer/ads/dict/dicttest Binary files differdeleted file mode 100755 index dddf2a0..0000000 --- a/comp/cw/code/tokenizer/ads/dict/dicttest +++ /dev/null diff --git a/comp/cw/code/tokenizer/ads/dict/dicttest.c b/comp/cw/code/tokenizer/ads/dict/dicttest.c deleted file mode 100644 index 4a20870..0000000 --- a/comp/cw/code/tokenizer/ads/dict/dicttest.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <stdio.h> - -#include "dict.h" - -int main(){ - dict_t *dict = dictalloc(); - dictset(dict, 1, "hello"); - printf("%d:%s\n", dict->id, (char *)dict->data); - dictfree(dict); -} |