X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=visor;a=blobdiff_plain;f=libvisor%2Fsrc%2Fvilibc.h;h=f9e8d062b263f7c6672336e96540d3562c00db01;hp=881c6ede9d0e58c70c23c4de76b381fe012412df;hb=2e3cec9f53a10e7c71da4a0d999a00bddae2935c;hpb=4f957b16f77eb7761afd9e0b9064c7f08deb45be diff --git a/libvisor/src/vilibc.h b/libvisor/src/vilibc.h index 881c6ed..f9e8d06 100644 --- a/libvisor/src/vilibc.h +++ b/libvisor/src/vilibc.h @@ -1,3 +1,20 @@ +/* +visor - lightweight system-independent embeddable text editor framework +Copyright (C) 2019 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . +*/ #ifndef VISOR_LIBC_H_ #define VISOR_LIBC_H_ @@ -11,19 +28,28 @@ #include #include #include +#include +#include +#include #else +int atoi(const char *str); +long atol(const char *str); +long strtol(const char *str, char **endp, int base); + void *memset(void *s, int c, unsigned long n); void *memcpy(void *dest, const void *src, unsigned long n); void *memmove(void *dest, const void *src, unsigned long n); unsigned long strlen(const char *s); +char *strchr(const char *s, int c); int strcmp(const char *s1, const char *s2); +char *strcpy(char *dest, const char *src); #ifdef __GNUC__ typedef __builtin_va_list va_list; #define va_start(v,l) __builtin_va_start(v,l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v,l) __builtin_va_arg(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_va_arg(v,l) #else /* !def __GNUC__ */ #error "stdargs implementation for this compiler missing (libvisor/src/vilibc.h)" #endif @@ -33,6 +59,21 @@ int vsprintf(char *buf, const char *fmt, va_list ap); int snprintf(char *buf, unsigned long sz, const char *fmt, ...); int vsnprintf(char *buf, unsigned long sz, const char *fmt, va_list ap); +int isalnum(int c); +int isalpha(int c); +#define isascii(c) ((c) < 128) +int isblank(int c); +int isdigit(int c); +int isupper(int c); +int islower(int c); +int isprint(int c); +int isspace(int c); + +int toupper(int c); +int tolower(int c); + +#define assert(x) + #endif /* !HAVE_LIBC */ struct visor;