|
|
1.1 root 1: /* Copyright (c) 1979 Regents of the University of California */
2: #
3: /*
4: * pxp - Pascal execution profiler
5: *
6: * Bill Joy UCB
7: * Version 1.2 January 1979
8: */
9:
10: #include "0.h"
11:
12: /*
13: * STRING SPACE DECLARATIONS
14: *
15: * Strng is the base of the current
16: * string space and strngp the
17: * base of the free area therein.
18: * No array of descriptors is needed
19: * as string space is never freed.
20: */
21: STATIC char strings[STRINC];
22: STATIC char *strng strings;
23: STATIC char *strngp strings;
24:
25: /*
26: initstring()
27: {
28:
29: }
30: */
31: /*
32: * Copy a string into the string area.
33: */
34: savestr(cp)
35: register char *cp;
36: {
37: register int i;
38:
39: i = strlen(cp) + 1;
40: if (strngp + i >= strng + STRINC) {
41: strngp = alloc(STRINC);
42: if (strngp == -1) {
43: yerror("Ran out of memory (string)");
44: pexit(DIED);
45: }
46: strng = strngp;
47: }
48: strcpy(strngp, cp);
49: cp = strngp;
50: strngp = cp + i;
51: return (cp);
52: }
53:
54: esavestr(cp)
55: char *cp;
56: {
57:
58: strngp = (int)(strngp + (sizeof (int) - 1)) &~ (sizeof (int) - 1);
59: return (savestr(cp));
60: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.