/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/Makefile |
---|
0,0 → 1,3 |
THIS_SRCS = bcmp.c bcopy.c bzero.c index.s rindex.s |
include $(MENUET_LIBC_TOPDIR)/Make.rules |
/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/bcmp.c |
---|
0,0 → 1,26 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <string.h> |
#undef bcmp |
int |
bcmp(const void *ptr1, const void *ptr2, int length) |
{ |
if (ptr1 == ptr2) |
return 0; |
if (ptr1 == 0 || ptr2 == 0) |
return -1; |
const char* arg1 = ptr1; |
const char* arg2 = ptr2; |
while (length) |
{ |
if (*arg1++ != *arg2++) |
return length; |
length--; |
} |
return 0; |
} |
/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/bcopy.c |
---|
0,0 → 1,10 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <string.h> |
#undef bcopy |
void * |
bcopy(const void *a, void *b, size_t len) |
{ |
return memmove(b, a, len); |
} |
/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/bzero.c |
---|
0,0 → 1,10 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <string.h> |
#undef bzero |
void * |
bzero(void *a, size_t b) |
{ |
return memset(a,0,b); |
} |
/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/index.s |
---|
0,0 → 1,6 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(index) |
jmp C_SYM(strchr) |
/programs/develop/libraries/menuetlibc/src/libc/compat/bsd/rindex.s |
---|
0,0 → 1,5 |
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
#include <libc/asmdefs.h> |
#include<libc/asm.h> |
MK_C_SYM(rindex) |
jmp C_SYM(strrchr) |