2009-01-09 19:49:34 +01:00
|
|
|
#ifndef __MHL_STRING_H
|
|
|
|
#define __MHL_STRING_H
|
|
|
|
|
|
|
|
#include <ctype.h>
|
2009-01-11 13:03:41 +01:00
|
|
|
#include <stdarg.h>
|
2009-01-09 19:49:34 +01:00
|
|
|
#include "../mhl/memory.h"
|
|
|
|
|
|
|
|
#define mhl_str_dup(str) ((str ? strdup(str) : strdup("")))
|
|
|
|
#define mhl_str_ndup(str,len) ((str ? strndup(str,len) : strdup("")))
|
|
|
|
#define mhl_str_len(str) ((str ? strlen(str) : 0))
|
|
|
|
|
2009-01-14 12:48:12 +02:00
|
|
|
inline char* mhl_str_trim(char*);
|
2009-01-09 19:49:34 +01:00
|
|
|
|
2009-01-14 12:48:12 +02:00
|
|
|
inline void mhl_str_toupper(char*);
|
2009-01-09 19:49:34 +01:00
|
|
|
|
2009-01-11 21:32:52 +01:00
|
|
|
#define __STR_CONCAT_MAX 32
|
|
|
|
|
2009-01-13 17:35:02 +02:00
|
|
|
/* _NEVER_ call this function directly ! */
|
2009-01-14 12:48:12 +02:00
|
|
|
inline char* __mhl_str_concat_hlp(const char*, ...);
|
2009-01-11 13:03:41 +01:00
|
|
|
|
2009-01-11 21:32:52 +01:00
|
|
|
#define mhl_str_concat(...) (__mhl_str_concat_hlp(__VA_ARGS__, (char*)(1)))
|
|
|
|
|
2009-01-14 12:48:12 +02:00
|
|
|
inline char* mhl_str_reverse(char*);
|
2009-01-09 19:49:34 +01:00
|
|
|
|
2009-01-13 17:35:02 +02:00
|
|
|
#endif // __MHL_STRING_H
|