2 # include "elementary_config.h"
4 #include <Elementary.h>
8 _str_ncpy(char *dest, const char *src, size_t count)
10 if ((!dest) || (!src)) return NULL;
11 return strncpy(dest, src, count);
15 _str_append(char *str, const char *txt, int *len, int *alloc)
17 int txt_len = strlen(txt);
19 if (txt_len <= 0) return str;
20 if ((*len + txt_len) >= *alloc)
25 alloc2 = *alloc + txt_len + 128;
26 str2 = realloc(str, alloc2);
27 if (!str2) return str;
31 strcpy(str + *len, txt);
37 _elm_util_mkup_to_text(const char *mkup)
39 return evas_textblock_text_markup_to_utf8(NULL, mkup);
43 _elm_util_text_to_mkup(const char *text)
45 return evas_textblock_text_utf8_to_markup(NULL, text);
49 _elm_atof(const char *s)
51 char *cradix, *buf, *p;
53 if ((!s) || (!s[0])) return 0.0;
54 cradix = nl_langinfo(RADIXCHAR);
55 if (!cradix) return atof(s);
56 buf = alloca(strlen(s) + 1);
58 for (p = buf; *p; p++)
60 if (*p == '.') *p = *cradix;