I made some tools useful to reduce the time of programing.
-
toolbox.h
,toolbox.c
- void swap(char *got_array, int a, int b)
- void char_qsort(char *got_array, int left, int right)
- int yes_or_no(void)
- struct key_char_head *init_key_char(void)
- int get_hash(char *key)
- struct key_char_node *get_key_char_node(struct key_char_head *this_head, char *key)
- char *get_key_char_value(struct key_char_head *this_head, char *key)
- int delete_key_char(struct key_char_head *this_head, char *key)
-
Tools:
pcinfo
,sysinfo
、swap
Start test.
----------------
swap: pass
----------------
char_qsort: pass
----------------
get_hash: pass
----------------
get_hash_with_zero_char: pass
----------------
pass: 4
pass rate: 100.00%
Dictionary testing:dictionary_testing.c
Append: key:abc value:def
state:1
Find the value with this key: adc.
result:def
Append: key:bac value:aaa
state:2
Find the value with this key: bac.
result:aaa
Delete the value with this key: abc.
state:1
Find the value with this key: bac.
result:aaa