strfuncs.c

dw_fluffos_v2/fluffos-2.9-ds2.05/strfuncs.c · 598 B

From the archive dw_fluffos_v2.zip

Download the archive   « Back to the archive contents

/*
 * ANSI C string library support/emulation
 *  (not complete)
 */

#include "std.h"

#ifndef WIN32
strcspn (register char * s, char * set)
{
    register char *t;
    register int count = 0;

    while (*s) {
	t = set;
	while (*t && (*s != *t))
	    t++;
	if (!*t) {
	    s++;
	    count++;
	} else
	    break;
    }

    return (count);
}


INLINE char *memset (char * s, int c, int n)
{
    if (c == 0)
	bzero(s, n);
    else {
	debug_message("Failed in memset\n");
	exit(1);
    }
}

INLINE char *memcpy (char * b, char * a, int s)
{
    bcopy(a, b, s);
    return b;
}
#endif /* !(WIN32) */

Site Stats

Snippets: 1791
Codebases: 571