/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)string.c 1.1 8/27/80";
* STRING SPACE DECLARATIONS
* Strng is the base of the current
* string space and strngp the
* base of the free area therein.
* Strp is the array of descriptors.
STATIC
char strings
[STRINC
];
STATIC
char *strng
= strings
;
STATIC
char *strngp
= strings
;
STATIC
char **stract strp
;
strng
= strngp
= strings
;
* Copy a string into the string area.
if (strngp
+ i
>= strng
+ STRINC
) {
yerror("Ran out of memory (string)");
strngp
= ( (char *) ( ( (int) (strngp
+ 1) ) &~ 1 ) );
if (cp
== NIL
|| cp
== OCT
|| cp
== HEX
)
for (i
= STRINC
, sp
= strp
; sp
< stract
; sp
++) {
if (cp
>= *sp
&& cp
< (*sp
+ STRINC
))
if (i
== 0 || i
== -OCT
|| i
== -HEX
)
return (strp
[(i
/ STRINC
) - 1] + (i
% STRINC
));
strngp
= (strngp
+ 1) &~ 1;