| 1 | /* |
| 2 | * @(#)string.h 3.3 84/04/05 |
| 3 | */ |
| 4 | #define STR_DEBUG |
| 5 | |
| 6 | char *str_cpy(); |
| 7 | char *str_ncpy(); |
| 8 | char *str_cat(); |
| 9 | char *str_itoa(); |
| 10 | |
| 11 | #define str_cmp(a, b) strcmp(a, b) |
| 12 | |
| 13 | #ifdef STR_DEBUG |
| 14 | struct string { |
| 15 | struct string *s_forw; |
| 16 | struct string *s_back; |
| 17 | char s_data[1]; |
| 18 | }; |
| 19 | |
| 20 | struct string str_head; |
| 21 | |
| 22 | #define str_offset ((unsigned)str_head.s_data - (unsigned)&str_head) |
| 23 | #define str_stos(s) ((struct string *)((unsigned)(s) - str_offset)) |
| 24 | |
| 25 | char *str_alloc(); |
| 26 | int str_free(); |
| 27 | #else |
| 28 | #define str_free(s) free(s) |
| 29 | #define str_alloc(s) malloc(s) |
| 30 | #endif |