}
static char *
-_edje_strbuf_append(char *s, const char *s2, int *len, int *alloc)
+_edje_strbuf_append2(char *s, const char *s2, int *len, int *alloc)
{
int l2, tlen;
}
static char *
-_edje_strbuf_append_escaped(char *s, const char *unescaped_s, int *len, int *alloc)
+_edje_strbuf_append2_escaped(char *s, const char *unescaped_s, int *len, int *alloc)
{
char *tmp;
tmp = _edje_str_escape(unescaped_s);
if (!tmp) return s;
- s = _edje_strbuf_append(s, tmp, len, alloc);
+ s = _edje_strbuf_append2(s, tmp, len, alloc);
free(tmp);
return s;
char *tmpstr = NULL;
int tmplen = 0, tmpalloc = 0;
- tmpstr = _edje_strbuf_append(tmpstr, "fonts/",
+ tmpstr = _edje_strbuf_append2(tmpstr, "fonts/",
&tmplen, &tmpalloc);
- tmpstr = _edje_strbuf_append(tmpstr, val,
+ tmpstr = _edje_strbuf_append2(tmpstr, val,
&tmplen, &tmpalloc);
(*tag_ret)->font = eina_stringshare_add(tmpstr);
free(tmpstr);
s2 = _edje_str_escape(item);
if (s2)
{
- if (newstr) newstr = _edje_strbuf_append(newstr, " ", &newlen, &newalloc);
- newstr = _edje_strbuf_append(newstr, s2, &newlen, &newalloc);
+ if (newstr) newstr = _edje_strbuf_append2(newstr, " ", &newlen, &newalloc);
+ newstr = _edje_strbuf_append2(newstr, s2, &newlen, &newalloc);
free(s2);
}
}
}
else
{
- if (newstr) newstr = _edje_strbuf_append(newstr, " ", &newlen, &newalloc);
- newstr = _edje_strbuf_append(newstr, item, &newlen, &newalloc);
+ if (newstr) newstr = _edje_strbuf_append2(newstr, " ", &newlen, &newalloc);
+ newstr = _edje_strbuf_append2(newstr, item, &newlen, &newalloc);
}
free(item);
}
if (!tag->key) continue;
/* Add Tag Key */
- buf = _edje_strbuf_append(buf, tag->key, &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "='", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, tag->key, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "='", &buflen, &bufalloc);
/* Configure fonts from text class if it exists */
if ((tc = _edje_text_class_find(ed, tag->text_class)))
}
/* Add and Ha`ndle tag parsed data */
- buf = _edje_strbuf_append(buf, tag->value, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, tag->value, &buflen, &bufalloc);
if (!strcmp(tag->key, "DEFAULT"))
{
if (fontset)
{
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_fallbacks=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, fontset, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_fallbacks=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, fontset, &buflen, &bufalloc);
}
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_source=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, fontsource, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_source=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, fontsource, &buflen, &bufalloc);
}
if (tag->font_size != 0)
{
else
snprintf(font_size, sizeof(font_size), "%f", tag->font_size);
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_size=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, font_size, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_size=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, font_size, &buflen, &bufalloc);
}
/* Add font name last to save evas from multiple loads */
if (tag->font)
{
const char *f;
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font=", &buflen, &bufalloc);
f = (found) ? tc->font : tag->font;
- buf = _edje_strbuf_append_escaped(buf, f, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2_escaped(buf, f, &buflen, &bufalloc);
}
found = 0;
- buf = _edje_strbuf_append(buf, "'", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "'", &buflen, &bufalloc);
}
if (fontset) free(fontset);
if (fontsource) free(fontsource);
if (!tag->key) continue;
/* Add Tag Key */
- buf = _edje_strbuf_append(buf, tag->key, &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "='", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, tag->key, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "='", &buflen, &bufalloc);
ts = _edje_format_reparse(edf, tag->value, &(tag));
if (eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
eina_stringshare_del(tag->value);
tag->value = eina_stringshare_add(ts);
- buf = _edje_strbuf_append(buf, tag->value, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, tag->value, &buflen, &bufalloc);
free(ts);
}
{
if (fontset)
{
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_fallbacks=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, fontset, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_fallbacks=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, fontset, &buflen, &bufalloc);
}
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_source=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, fontsource, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_source=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, fontsource, &buflen, &bufalloc);
}
if (tag->font_size > 0)
{
char font_size[32];
snprintf(font_size, sizeof(font_size), "%f", tag->font_size);
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font_size=", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, font_size, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font_size=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, font_size, &buflen, &bufalloc);
}
/* Add font name last to save evas from multiple loads */
if (tag->font)
{
- buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
- buf = _edje_strbuf_append(buf, "font=", &buflen, &bufalloc);
- buf = _edje_strbuf_append_escaped(buf, tag->font, &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, " ", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "font=", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2_escaped(buf, tag->font, &buflen, &bufalloc);
}
- buf = _edje_strbuf_append(buf, "'", &buflen, &bufalloc);
+ buf = _edje_strbuf_append2(buf, "'", &buflen, &bufalloc);
}
if (fontset) free(fontset);
if (fontsource) free(fontsource);
*/
#include <string.h>
+
#include "edje_private.h"
typedef struct _Edje_Box_Layout Edje_Box_Layout;
}
return NULL;
}
+
static Eina_Bool
-_edje_strbuf_append(char **p_str, size_t *allocated, size_t *used, const char *news, size_t news_len)
+_edje_strbuf_append1(char **p_str, size_t *allocated, size_t *used, const char *news, size_t news_len)
{
if (*used + news_len >= *allocated)
{
else
escaped_len = strlen(escaped);
- if (!_edje_strbuf_append(&ret, &ret_len, &used, escaped, escaped_len))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, escaped, escaped_len))
return NULL;
text += advance;
}
- if (!_edje_strbuf_append(&ret, &ret_len, &used, "", 1))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, "", 1))
return NULL;
return ret;
}
if (len > 0)
{
- if (!_edje_strbuf_append(&ret, &ret_len, &used, str, len))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, str, len))
return NULL;
}
len = text + 1 - escape_start;
}
- if (!_edje_strbuf_append(&ret, &ret_len, &used, str, len))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, str, len))
return NULL;
escape_start = NULL;
if (last && (text > last))
{
size_t len = text - last;
- if (!_edje_strbuf_append(&ret, &ret_len, &used, last, len))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, last, len))
return NULL;
}
- if (!_edje_strbuf_append(&ret, &ret_len, &used, "", 1))
+ if (!_edje_strbuf_append1(&ret, &ret_len, &used, "", 1))
return NULL;
return ret;
}