static char sccsid
[] = "@(#)string.c 3.8 %G%";
* Copyright (c) 1983 Regents of the University of California,
* All rights reserved. Redistribution permitted subject to
* the terms of the Berkeley Software License Agreement.
str
= p
= str_alloc(strlen(s
) + 1);
str
= p
= str_alloc(n
+ 1);
(void) sprintf(buf
, "%d", i
);
str
= p
= str_alloc(strlen(s1
) + strlen(s2
) + 1);
for (q
= s1
; *p
++ = *q
++;)
for (q
= s2
, p
--; *p
++ = *q
++;)
* s can be a prefix of p with at least min characters.
for (; *s
&& *p
&& *s
== *p
; s
++, p
++, min
--)
return *s
== *p
|| *s
== 0 && min
<= 0;
register struct string
*s
;
s
= (struct string
*) malloc((unsigned)l
+ str_offset
);
if (str_head
.s_forw
== 0)
str_head
.s_forw
= str_head
.s_back
= &str_head
;
s
->s_forw
= str_head
.s_forw
;
register struct string
*s
;
for (s
= str_head
.s_forw
; s
!= &str_head
&& s
->s_data
!= str
;
s
->s_back
->s_forw
= s
->s_forw
;
s
->s_forw
->s_back
= s
->s_back
;