#include "mm_file_utils.h"
#ifdef __MMFILE_MEM_TRACE__
-EXPORT_API
-int mmfile_util_wstrlen(unsigned short *wText)
-{
- int n = 0;
-
- if (NULL == wText) {
- debug_error(DEBUG, "wText is NULL\n");
- return MMFILE_UTIL_FAIL;
- }
-
- n = 0;
-
- while (*(wText + n) != 0) {
- n++;
- }
-
- return n;
-}
-
short __WmLngSwapShort(short aShort)
{
return ((aShort << 8) + (aShort >> 8));
}
EXPORT_API
-char **mmfile_strsplit(const char *string, const char *delimiter)
-{
- return g_strsplit(string, delimiter, -1);
-}
-
-EXPORT_API
-void mmfile_strfreev(char **str_array)
-{
- g_strfreev(str_array);
-}
-
-EXPORT_API
char *mmfile_strdup_debug(const char *str, const char *func, unsigned int line)
{
char *temp = NULL;
#else /* __MMFILE_MEM_TRACE__ */
EXPORT_API
-int mmfile_util_wstrlen(unsigned short *wText)
-{
- int n = 0;
-
- if (NULL == wText) {
- debug_error(DEBUG, "wText is NULL\n");
- return MMFILE_UTIL_FAIL;
- }
-
- n = 0;
-
- while (*(wText + n) != 0) {
- n++;
- }
-
- return n;
-}
-
-EXPORT_API
char *mmfile_get_charset(const char *str)
{
UCharsetDetector *ucsd = NULL;
}
EXPORT_API
-char **mmfile_strsplit(const char *string, const char *delimiter)
+char *mmfile_strdup(const char *str)
{
- return g_strsplit(string, delimiter, -1);
+ if (!str)
+ return NULL;
+
+ return strdup(str);
}
+#endif /*__MMFILE_MEM_TRACE__*/
+
EXPORT_API
-void mmfile_strfreev(char **str_array)
+int mmfile_util_wstrlen(unsigned short *wText)
{
- g_strfreev(str_array);
+ int n = 0;
+
+ if (NULL == wText) {
+ debug_error(DEBUG, "wText is NULL\n");
+ return MMFILE_UTIL_FAIL;
+ }
+
+ n = 0;
+
+ while (*(wText + n) != 0) {
+ n++;
+ }
+
+ return n;
}
EXPORT_API
-char *mmfile_strdup(const char *str)
+char **mmfile_strsplit(const char *string, const char *delimiter)
{
- if (!str)
- return NULL;
-
- return strdup(str);
+ return g_strsplit(string, delimiter, -1);
}
-#endif /*__MMFILE_MEM_TRACE__*/
-
+EXPORT_API
+void mmfile_strfreev(char **str_array)
+{
+ g_strfreev(str_array);
+}