* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)string.c 5.1 (Berkeley) 6/5/85";
* 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)");
(void) pstrcpy(strngp
, cp
);
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;