#include "brstdlib.h"
#include "harness/trace.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
// Global variables
// DOSPICK has "$Id: stdlib.c 2.4 1996/12/06 21:18:39 sam Exp $" for this. Do we want to implement these?
int BrMemCmp(void* s1, void* s2, size_t n) {
}
void* BrMemCpy(void* s1, void* s2, size_t n) {
}
void* BrMemSet(void* s, int c, size_t n) {
if (s == NULL) {
// Passing a null target pointer is undefined behavior
return NULL;
}
}
char* BrStrCat(char* s1, char* s2) {
}
int BrStrCmp(char* s1, char* s2) {
}
int BrStrICmp(char* s1, char* s2) {
// Windows is stricmp, while posix is strcasecmp
#ifdef _WIN32
return _stricmp(s1, s2); // Pierre-Marie Baty -- ISO C name conformance fix
#else
return strcasecmp(s1, s2);
#endif
}
char* BrStrCpy(char* s1, const char* s2) {
}
br_size_t BrStrLen(char* s) {
}
int BrStrNCmp(char* s1, char* s2, size_t n) {
}
int BrStrNICmp(char* s1, char* s2, size_t n) {
// Windows is strnicmp, while posix is strncasecmp
#ifdef _WIN32
return _strnicmp(s1, s2, n); // Pierre-Marie Baty -- ISO C name conformance fix
#else
return strncasecmp(s1, s2, n);
#endif
}
char* BrStrNCpy(char* s1, char* s2, size_t n) {
}
char* BrStrRChr(char* s1, char c) {
}
void BrAbort(void) {
}
char* BrGetEnv(char* name) {
}
float BrStrToF(char* nptr, char** endptr) {
return strtof(nptr, endptr);
}
double BrStrToD(char* nptr, char** endptr) {
}
long BrStrToL(char* nptr, char** endptr, int base) {
return strtol(nptr
, endptr
, base
);
}
unsigned long BrStrToUL(char* nptr, char** endptr, int base) {
return strtoul(nptr
, endptr
, base
);
}
br_boolean BrIsAlpha(int c) {
}
br_boolean BrIsDigit(int c) {
}
br_boolean BrIsSpace(int c) {
}
br_boolean BrIsPrint(int c) {
}
br_int_32 BrVSprintf(char* buf, const char* fmt, va_list args) {
}
br_int_32 BrVSprintfN(char* buf, br_size_t buf_size, const char* fmt, va_list args) {
// Most C libs have vsnprintf these days that can replace this.
unsigned int n;
char tmp[512];
if (buf_size - 1 < n) {
n = buf_size - 1;
}
buf[n] = '\0';
return n;
}
br_int_32 BrVSScanf(char* buf, const char* fmt, va_list args) {
}