home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
progm
/
cbase.zip
/
CBASE10B.ZIP
/
ROLODECK.ZIP
/
KRTMP.C
< prev
next >
Wrap
Text File
|
1989-10-31
|
1KB
|
58 lines
/* #ident "krtmp.c 1.2 - 89/10/31" */
/*man---------------------------------------------------------------------------
NAME
krtmp - K&R C temporary ANSI functions
DESCRIPTION
This file contains ANSI functions required by cbase which may not
be available with K&R compilers.
------------------------------------------------------------------------------*/
#if __STDC__ != 1
#include <stdio.h>
#include <sys/types.h>
void *calloc();
void free();
void *memmove(t, s, n)
void *t;
void *s;
size_t n;
{
void *buf = NULL;
if ((buf = calloc((size_t)1, n)) == NULL) return NULL;
memcpy(buf, s, n);
memcpy(t, buf, n);
free(buf);
return t;
}
int link();
int unlink();
int remove(filename)
char *filename;
{
if (unlink(filename) == -1) {
return -1;
}
return 0;
}
int rename(file1, file2)
char *file1;
char *file2;
{
if (link(file1, file2) == -1) {
return -1;
}
if (unlink(file1) == -1) {
return -1;
}
return 0;
}
#endif