Remove private versions of strchr() & bcopy(); there is nothing wrong with

the versions in our C library.
This commit is contained in:
jtc 1994-05-04 23:46:28 +00:00
parent 81d81cf9a0
commit c1954f273e
2 changed files with 3 additions and 64 deletions

View File

@ -36,7 +36,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mystring.c 5.1 (Berkeley) 3/7/91";*/
static char rcsid[] = "$Id: mystring.c,v 1.4 1993/08/01 18:58:05 mycroft Exp $";
static char rcsid[] = "$Id: mystring.c,v 1.5 1994/05/04 23:46:28 jtc Exp $";
#endif /* not lint */
/*
@ -45,8 +45,6 @@ static char rcsid[] = "$Id: mystring.c,v 1.4 1993/08/01 18:58:05 mycroft Exp $";
* equal(s1, s2) Return true if strings are equal.
* scopy(from, to) Copy a string.
* scopyn(from, to, n) Like scopy, but checks for overflow.
* strchr(s, c) Find first occurance of c in s.
* bcopy(from, to, n) Copy a block of memory.
* number(s) Convert a string of digits to an integer.
* is_number(s) Return true if s is a string of digits.
*/
@ -81,50 +79,6 @@ scopyn(from, to, size)
}
/*
* strchr - find first occurrence of a character in a string.
*/
#ifndef SYS5
char *
mystrchr(s, charwanted)
char const *s;
register char charwanted;
{
register char const *scan;
/*
* The odd placement of the two tests is so NUL is findable.
*/
for (scan = s ; *scan != charwanted ; ) /* ++ moved down for opt. */
if (*scan++ == '\0')
return NULL;
return (char *)scan;
}
#endif
/*
* bcopy - copy bytes
*
* This routine was derived from code by Henry Spencer.
*/
void
mybcopy(src, dst, length)
pointer dst;
const pointer src;
register int length;
{
register char *d = dst;
register char *s = src;
while (--length >= 0)
*d++ = *s++;
}
/*
* prefix -- see if pfx is a prefix of string.
*/

View File

@ -34,37 +34,22 @@
* SUCH DAMAGE.
*
* from: @(#)mystring.h 5.1 (Berkeley) 3/7/91
* $Id: mystring.h,v 1.4 1993/08/01 18:58:39 mycroft Exp $
* $Id: mystring.h,v 1.5 1994/05/04 23:46:32 jtc Exp $
*/
#ifndef SYSV
#define strchr mystrchr
#endif
#include <string.h>
#ifdef __STDC__
void scopyn(const char *, char *, int);
char *strchr(const char *, int);
void mybcopy(const pointer, pointer, int);
int prefix(const char *, const char *);
int number(const char *);
int is_number(const char *);
int strcmp(const char *, const char *); /* from C library */
char *strcpy(char *, const char *); /* from C library */
int strlen(const char *); /* from C library */
char *strcat(char *, const char *); /* from C library */
#else
void scopyn();
char *strchr();
void mybcopy();
int prefix();
int number();
int is_number();
int strcmp();
char *strcpy();
int strlen();
char *strcat();
#endif
#define equal(s1, s2) (strcmp(s1, s2) == 0)
#define scopy(s1, s2) ((void)strcpy(s2, s1))
#define bcopy(src, dst, n) mybcopy((pointer)(src), (pointer)(dst), n)