From 50a6ca39ad4ed01922aa4f755f0ca579788226cf Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 6 May 2010 21:04:40 +0000 Subject: Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657 --- firmware/libc/include/string.h | 94 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 firmware/libc/include/string.h (limited to 'firmware/libc/include/string.h') diff --git a/firmware/libc/include/string.h b/firmware/libc/include/string.h new file mode 100644 index 0000000000..8986bd6a0c --- /dev/null +++ b/firmware/libc/include/string.h @@ -0,0 +1,94 @@ +/* + * string.h + * + * Definitions for memory and string functions. + */ + +#ifndef _STRING_H_ +#define _STRING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "_ansi.h" + +#include + +#if !defined(__size_t_defined)&& !defined(_SIZE_T_) && !defined(size_t) && !defined(_SIZE_T_DECLARED) +#define __size_t_defined +#define _SIZE_T +#define _SIZE_T_ +#define _SIZE_T_DECLARED +#define size_t size_t +typedef unsigned long size_t; +#endif + +#ifndef NULL +#define NULL ((void*)0) +#endif + +_PTR _EXFUN(memchr,(const _PTR, int, size_t)); +int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); +_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t)); +_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); +_PTR _EXFUN(memset,(_PTR, int, size_t)); +char *_EXFUN(strcat,(char *, const char *)); +char *_EXFUN(strchr,(const char *, int)); +int _EXFUN(strcmp,(const char *, const char *)); +int _EXFUN(strcoll,(const char *, const char *)); +char *_EXFUN(strcpy,(char *, const char *)); +size_t _EXFUN(strcspn,(const char *, const char *)); +char *_EXFUN(strerror,(int)); +size_t _EXFUN(strlen,(const char *)); +char *_EXFUN(strncat,(char *, const char *, size_t)); +int _EXFUN(strncmp,(const char *, const char *, size_t)); +char *_EXFUN(strpbrk,(const char *, const char *)); +char *_EXFUN(strrchr,(const char *, int)); +size_t _EXFUN(strspn,(const char *, const char *)); +char *_EXFUN(strstr,(const char *, const char *)); +char *_EXFUN(strcasestr,(const char *, const char *)); + +size_t strlcpy(char *dst, const char *src, size_t siz); +size_t strlcat(char *dst, const char *src, size_t siz); + +#ifndef _REENT_ONLY +char *_EXFUN(strtok,(char *, const char *)); +#endif + +size_t _EXFUN(strxfrm,(char *, const char *, size_t)); + +#ifndef __STRICT_ANSI__ +char *_EXFUN(strtok_r,(char *, const char *, char **)); + +_PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t)); +int _EXFUN(strcasecmp,(const char *, const char *)); +int _EXFUN(strncasecmp,(const char *, const char *, size_t)); + +#ifdef __CYGWIN__ +#ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ +const char *_EXFUN(strsignal, (int __signo)); +#endif +int _EXFUN(strtosigno, (const char *__name)); +#endif + +/* These function names are used on Windows and perhaps other systems. */ +#ifndef strcmpi +#define strcmpi strcasecmp +#endif +#ifndef stricmp +#define stricmp strcasecmp +#endif +#ifndef strncmpi +#define strncmpi strncasecmp +#endif +#ifndef strnicmp +#define strnicmp strncasecmp +#endif + +#endif /* ! __STRICT_ANSI__ */ + +#ifdef __cplusplus +} +#endif +#endif /* _STRING_H_ */ -- cgit v1.2.3