sgdk
string.h
Go to the documentation of this file.
00001 
00013 #if (ENABLE_NEWLIB == 1) && !defined(_NEWLIB_STRING_H_)
00014 #define _NEWLIB_STRING_H_
00015 #include_next <string.h> // Include string.h from newlib
00016 #undef _STRING_H_        // Will be defined again just below
00017 #endif
00018 
00019 #ifndef _STRING_H_
00020 #define _STRING_H_
00021 
00022 #if (ENABLE_NEWLIB == 0)
00023 
00028 #define isdigit(c)      ((c) >= '0' && (c) <= '9')
00029 
00030 
00031 typedef void *__gnuc_va_list;
00032 typedef __gnuc_va_list va_list;
00033 
00034 #define __va_rounded_size(TYPE)  \
00035   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
00036 
00037 #define va_start(AP, LASTARG)                                           \
00038  (AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
00039 
00040 #define va_end(AP)      ((void)0)
00041 
00042 #define va_arg(AP, TYPE)                                                \
00043  (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)),     \
00044   *((TYPE *) (void *) ((char *) (AP)                                    \
00045                        - ((sizeof (TYPE) < __va_rounded_size (char)     \
00046                            ? sizeof (TYPE) : __va_rounded_size (TYPE))))))
00047 
00058 u16 strlen(const char *str);
00073 u16 strnlen(const char *str, u16 maxlen);
00091 s16 strcmp(const char *str1, const char *str2);
00092 
00105 char* strcpy(char *dest, const char *src);
00120 char* strncpy(char *dest, const char *src, u16 len);
00133 char* strcat(char *dest, const char *src);
00159 u16 sprintf(char *buffer,const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
00160 
00161 #endif  // ENABLE_NEWLIB
00162 
00173 char* strclr(char *str);
00188 char *strreplacechar(char *str, char oldc, char newc);
00204 u16 intToStr(s32 value, char *str, u16 minsize);
00220 u16 uintToStr(u32 value, char *str, u16 minsize);
00235 void intToHex(u32 value, char *str, u16 minsize);
00236 
00250 void fix32ToStr(fix32 value, char *str, u16 numdec);
00264 void fix16ToStr(fix16 value, char *str, u16 numdec);
00265 
00266 #endif // _STRING_H_
00267 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines