string operators, +, <<, >>
[unix-history] / usr / src / usr.bin / window / string.h
... / ...
CommitLineData
1/*
2 * @(#)string.h 3.3 84/04/05
3 */
4#define STR_DEBUG
5
6char *str_cpy();
7char *str_ncpy();
8char *str_cat();
9char *str_itoa();
10
11#define str_cmp(a, b) strcmp(a, b)
12
13#ifdef STR_DEBUG
14struct string {
15 struct string *s_forw;
16 struct string *s_back;
17 char s_data[1];
18};
19
20struct 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
25char *str_alloc();
26int str_free();
27#else
28#define str_free(s) free(s)
29#define str_alloc(s) malloc(s)
30#endif