home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
old
/
ckermit60
/
ckvold.c
< prev
next >
Wrap
C/C++ Source or Header
|
2020-01-01
|
1KB
|
76 lines
#module ckvold "1.0-004"
/* C K V O L D -- C-Kermit file system support for VAX/VMS V4. */
/* Edit history
* 001 22-Jan-91 wb Initial version with memcpy, memmove
* 002 24-Apr-91 wb Added memset
* 003 01-Jul-91 wb Added strstr
* 004 26-Nov-91 wb Added system
* 006 10-Nov-96 lh All (and getcwd in CKCNET) needed w VAXCRTL 4.00922
* (VMS 4.4) only strstr needed w/ VAXCRTL 4.01322 (VMS 4.6)
*/
void *memcpy(d, s, n)
void *d, *s;
register int n;
{
register char *ss = (char *)s, *dd = (char *)d;
while (n-- > 0)
*dd++ = *ss++;
return d;
}
void *memmove(d, s, n)
void *d;
const void *s;
register int n;
{
register char *dd = (char *)d, *ss = (char *)s;
if (dd < ss || dd - ss >= n) {
while (n-- > 0)
*dd++ = *ss++;
} else if (n > 0) {
dd += n;
ss += n;
while (n-- > 0)
*--dd = *--ss;
}
return d;
}
void *memset(d, c, n)
void *d;
register int c;
register int n;
{
register char *dd = (char *)d;
while (n-- > 0)
*dd++ = c;
return d;
}
char *strstr(a, b)
const char *a;
const char *b;
{
int len;
if (!a || !b) return((char *)0);
if (!*b) return(a);
len = strlen(b);
while (*a) {
if (!strncmp(a, b, len)) return(a);
a++;
}
return((char *)0);
}
int system(s)
char *s;
{
while (*s == ' ' || *s == '$') s++;
zsyscmd(s);
return(1);
}