os-k/src/kaleid/common/stdlib.h

80 lines
2.6 KiB
C
Raw Normal View History

2018-12-31 10:49:08 +01:00
//----------------------------------------------------------------------------//
// GNU GPL OS/K //
// //
// Authors: spectral` //
// NeoX //
// //
// Desc: Kaleid string library //
//----------------------------------------------------------------------------//
2018-12-31 15:08:56 +01:00
#ifndef _KALCOMM_STDLIB_H
#define _KALCOMM_STDLIB_H
2018-12-31 10:49:08 +01:00
#ifndef _KALCOMM_COMMON_H
# include <kaleid/common/common.h>
#endif
//------------------------------------------//
// Memory management utilitaries //
//------------------------------------------//
#ifndef _OSK_SOURCE
# define memcpy _osk_memcpy
# define memcmp _osk_memcmp
# define memzero _osk_memzero
#endif
2018-12-31 15:08:56 +01:00
#define memsetb memset
2018-12-31 10:49:08 +01:00
void *memset(void *, int, size_t);
2018-12-31 15:08:56 +01:00
void *memsetw(void *, int, size_t);
void *memsetd(void *, int, size_t);
void *memsetq(void *, long, size_t);
2018-12-31 10:49:08 +01:00
void *memzero(void *, size_t);
//------------------------------------------//
// String manipulation utilitaries //
//------------------------------------------//
#ifndef _OSK_SOURCE
# define strlen _osk_strlen
# define strcpy _osk_strcpy
# define strncpy _osk_strncpy
# define strrev _osk_strrev
# define reverse _osk_reverse
# define sprintf _osk_sprintf
# define snprintf _osk_snprintf
# define vsprintf _osk_vsprintf
# define vsnprintf _osk_vsnprintf
#endif
size_t strlen(const char *);
char *strcpy(char *, const char *);
char *strncpy(char *, const char *, size_t);
char *strrev(char *dest, const char *src);
char *reverse(char *);
int sprintf(char *, const char *, ...);
int snprintf(char *, size_t, const char *, ...);
int vsprintf(char *, const char *, va_list);
int vsnprintf(char *, size_t, const char *, va_list);
//------------------------------------------//
// Type conversion utilities //
//------------------------------------------//
#ifndef _OSK_SOURCE
# define itoa _osk_itoa
# define atoi _osk_atoi
#endif
char *itoa(int, char *, int);
//------------------------------------------//
// End of kaleid/common/stdlib.h //
//------------------------------------------//
#endif