home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
CBASE09.ZIP
/
BLKIO10.ZIP
/
BTMP.C
< prev
next >
Wrap
Text File
|
1989-08-30
|
1KB
|
69 lines
/* #ident "btmp.c 1.1 - 89/07/03" */
#include "blkio_.h"
/*------------------------------------------------------------------------------
DESCRIPTION
This file contains new ANSI C library functions used by the blkio
package. Any functions included with your library should be deleted
from this file.
SEE ALSO
blkio.h.
------------------------------------------------------------------------------*/
void *calloc(n, size)
size_t n;
size_t size;
{
void *rt = NULL;
rt = (void *)malloc(n * size);
if (rt != NULL) {
memset(rt, 0, n * size);
}
return rt;
}
void *memmove(t, s, n)
void *t;
void *s;
size_t n;
{
void *buf = NULL;
buf = calloc(1, n);
if (buf == NULL) {
return NULL;
}
memcpy(buf, s, n);
memcpy(t, buf, n);
free(buf);
return t;
}
char *strstr(cs, ct)
char *cs;
char *ct;
{
size_t ctlen = 0;
if ((cs == NULL) || (ct == NULL)) {
return NULL;
}
ctlen = strlen(ct);
while (*cs != '\0') {
if (strncmp(cs, ct, ctlen) == 0) {
return cs;
}
cs++;
}
return NULL;
}