00001
00021 #ifndef _LIGHTMEDIASCANNER_CHARSET_CONV_H_
00022 #define _LIGHTMEDIASCANNER_CHARSET_CONV_H_ 1
00023
00024 #ifdef GNUC_MALLOC
00025 #undef GNUC_MALLOC
00026 #endif
00027 #ifdef GNUC_WARN_UNUSED_RESULT
00028 #undef GNUC_WARN_UNUSED_RESULT
00029 #endif
00030 #ifdef GNUC_NON_NULL
00031 #undef GNUC_NON_NULL
00032 #endif
00033 #ifdef API
00034 #undef API
00035 #endif
00036
00037 #ifdef __GNUC__
00038 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
00039 # define GNUC_MALLOC __attribute__((__malloc__))
00040 # else
00041 # define GNUC_MALLOC
00042 # endif
00043 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00044 # define GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
00045 # define GNUC_NON_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
00046 # else
00047 # define GNUC_WARN_UNUSED_RESULT
00048 # define GNUC_NON_NULL(...)
00049 # endif
00050 # if __GNUC__ >= 4
00051 # define API __attribute__ ((visibility("default")))
00052 # else
00053 # define API
00054 # endif
00055 #else
00056 # define GNUC_MALLOC
00057 # define GNUC_WARN_UNUSED_RESULT
00058 # define GNUC_NON_NULL(...)
00059 # define API
00060 #endif
00061
00062 #ifdef __cplusplus
00063 extern "C" {
00064 #endif
00065
00072 typedef struct lms_charset_conv lms_charset_conv_t;
00073
00074 API lms_charset_conv_t *lms_charset_conv_new(void) GNUC_MALLOC GNUC_WARN_UNUSED_RESULT;
00075 API void lms_charset_conv_free(lms_charset_conv_t *lcc) GNUC_NON_NULL(1);
00076 API int lms_charset_conv_add(lms_charset_conv_t *lcc, const char *charset) GNUC_NON_NULL(1, 2);
00077 API int lms_charset_conv_del(lms_charset_conv_t *lcc, const char *charset) GNUC_NON_NULL(1, 2);
00078
00079 API int lms_charset_conv(lms_charset_conv_t *lcc, char **p_str, unsigned int *p_len) GNUC_NON_NULL(1, 2, 3);
00080 API int lms_charset_conv_check(lms_charset_conv_t *lcc, const char *str, unsigned int len) GNUC_NON_NULL(1, 2);
00081
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088 #endif