|
|
1.1 root 1: /*
2: * @(#)string.h 3.5 4/24/85
3: */
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:
11: #define STR_DEBUG
12:
13: char *str_cpy();
14: char *str_ncpy();
15: char *str_cat();
16: char *str_itoa();
17:
18: #define str_cmp(a, b) strcmp(a, b)
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
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.