Commit | Line | Data |
---|---|---|
921f5a1c | 1 | /* |
60de5df9 | 2 | * @(#)string.h 3.5 %G% |
921f5a1c | 3 | */ |
60de5df9 EW |
4 | |
5 | /* | |
6 | * Copyright (c) 1983 Regents of the University of California, | |
7 | * All rights reserved. Redistribution permitted subject to | |
8 | * the terms of the Berkeley Software License Agreement. | |
9 | */ | |
10 | ||
90ede912 | 11 | #define STR_DEBUG |
921f5a1c EW |
12 | |
13 | char *str_cpy(); | |
0180c2d9 | 14 | char *str_ncpy(); |
921f5a1c EW |
15 | char *str_cat(); |
16 | char *str_itoa(); | |
17 | ||
18 | #define str_cmp(a, b) strcmp(a, b) | |
90ede912 EW |
19 | |
20 | #ifdef STR_DEBUG | |
21 | struct string { | |
22 | struct string *s_forw; | |
23 | struct string *s_back; | |
24 | char s_data[1]; | |
25 | }; | |
26 | ||
27 | struct string str_head; | |
28 | ||
29 | #define str_offset ((unsigned)str_head.s_data - (unsigned)&str_head) | |
30 | #define str_stos(s) ((struct string *)((unsigned)(s) - str_offset)) | |
31 | ||
32 | char *str_alloc(); | |
33 | int str_free(); | |
34 | #else | |
35 | #define str_free(s) free(s) | |
36 | #define str_alloc(s) malloc(s) | |
37 | #endif |