* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)string.c 3.11 (Berkeley) %G%";
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
;