diff options
Diffstat (limited to 'comp/cw/code/ads/dict/dict.c')
-rw-r--r-- | comp/cw/code/ads/dict/dict.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/comp/cw/code/ads/dict/dict.c b/comp/cw/code/ads/dict/dict.c deleted file mode 100644 index 551afca..0000000 --- a/comp/cw/code/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); -} - |