Tizen 2.1 base
[framework/uifw/ecore.git] / src / lib / ecore / Ecore_Str.h
1 #ifndef _ECORE_STR_H
2 # define _ECORE_STR_H
3
4 #ifdef EAPI
5 # undef EAPI
6 #endif
7
8 #ifdef _WIN32
9 # ifdef EFL_ECORE_BUILD
10 #  ifdef DLL_EXPORT
11 #   define EAPI __declspec(dllexport)
12 #  else
13 #   define EAPI
14 #  endif /* ! DLL_EXPORT */
15 # else
16 #  define EAPI __declspec(dllimport)
17 # endif /* ! EFL_ECORE_BUILD */
18 #else
19 # ifdef __GNUC__
20 #  if __GNUC__ >= 4
21 #   define EAPI __attribute__ ((visibility("default")))
22 #  else
23 #   define EAPI
24 #  endif
25 # else
26 #  define EAPI
27 # endif
28 #endif /* ! _WIN32 */
29
30 /**
31  * @file Ecore_Str.h
32  * @brief Contains useful C string functions.
33  */
34
35 # ifdef __cplusplus
36 extern "C" {
37 # endif
38
39 # ifdef __sgi
40 #  define __FUNCTION__ "unknown"
41 #  ifndef __cplusplus
42 #   define inline
43 #  endif
44 # endif
45
46
47 /* strlcpy implementation for libc's lacking it */
48 EAPI size_t ecore_strlcpy(char *dst, const char *src, size_t siz);
49 EAPI size_t ecore_strlcat(char *dst, const char *src, size_t siz);
50
51 EAPI int ecore_str_has_prefix(const char *str, const char *prefix);
52
53 EAPI int ecore_str_has_suffix(const char *str, const char *suffix);
54 EAPI int ecore_str_has_extension(const char *str, const char *ext);
55
56 EAPI char **ecore_str_split(const char *string, const char *delimiter, 
57                             int max_tokens);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif                          /* _ECORE_STR_H */