prom_string.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1991-1995, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The routines are NOT part of the interface, merely internal
* utilities which assist in making the interface standalone.
*/
#include <sys/promimpl.h>
/*
* a version of string copy that is bounded
*/
char *
{
n++;
;
if (n != 0)
while (--n != 0)
*s1++ = '\0';
return (os1);
}
/*
* and one that knows no bounds
*/
char *
{
register char *os1;
;
return (os1);
}
/*
* a copy of string compare that is bounded
*/
int
{
n++;
return (0);
if (*s1++ == '\0')
return (0);
}
/*
* and one that knows no bounds
*/
int
{
if (*s1++ == '\0')
return (0);
}
/*
* finds the length of a succession of non-NULL chars
*/
int
prom_strlen(register char *s)
{
register int n = 0;
while (*s++)
n++;
return (n);
}
/*
* return the ptr in sp at which the character c last
* appears; 0 if not found
*/
char *
prom_strrchr(register char *sp, register char c)
{
register char *r;
if (*sp == c)
r = sp;
return (r);
}
/*
* Concatenate string s2 to string s1
*/
char *
{
while ((*s1) != ((char)0))
s1++; /* find the end of string s1 */
;
return (os1);
}
/*
* Return the ptr in sp at which the character c first
* appears; NULL if not found
*/
char *
prom_strchr(register const char *sp, register int c)
{
do {
if (*sp == (char)c)
return ((char *)sp);
} while (*sp++);
return (NULL);
}