Commit | Line | Data |
---|---|---|
2febe727 CH |
1 | # |
2 | /* | |
3 | * pxp - Pascal execution profiler | |
4 | * | |
5 | * Bill Joy UCB | |
6 | * Version 1.0 August 1977 | |
7 | */ | |
8 | ||
9 | #include "0.h" | |
10 | ||
11 | /* | |
12 | * STRING SPACE DECLARATIONS | |
13 | * | |
14 | * Strng is the base of the current | |
15 | * string space and strngp the | |
16 | * base of the free area therein. | |
17 | * No array of descriptors is needed | |
18 | * as string space is never freed. | |
19 | */ | |
20 | STATIC char strings[STRINC]; | |
21 | STATIC char *strng strings; | |
22 | STATIC char *strngp strings; | |
23 | ||
24 | /* | |
25 | initstring() | |
26 | { | |
27 | ||
28 | } | |
29 | */ | |
30 | /* | |
31 | * Copy a string into the string area. | |
32 | */ | |
33 | savestr(cp) | |
34 | register char *cp; | |
35 | { | |
36 | register int i; | |
37 | ||
38 | i = strlen(cp) + 1; | |
39 | if (strngp + i >= strng + STRINC) { | |
40 | strngp = alloc(STRINC); | |
41 | if (strngp == -1) { | |
42 | yerror("Ran out of memory (string)"); | |
43 | pexit(DIED); | |
44 | } | |
45 | strng = strngp; | |
46 | } | |
47 | strcpy(strngp, cp); | |
48 | cp = strngp; | |
49 | strngp = cp + i; | |
50 | return (cp); | |
51 | } | |
52 | ||
53 | esavestr(cp) | |
54 | char *cp; | |
55 | { | |
56 | ||
57 | strngp = (strngp + 1) &~ 1; | |
58 | return (savestr(cp)); | |
59 | } |