printf("Expecting id: %s, got: %s\n", tests[i].expected, id);
ret = 0;
}
- if (id) ecore_string_release(id);
+ if (id) eina_stringshare_del(id);
}
}
else
efreet_init(void)
{
if (init++) return init;
+ if (!eina_stringshare_init()) return --init;
if (!efreet_base_init()) return --init;
if (!efreet_xml_init()) return --init;
if (!efreet_icon_init()) return --init;
efreet_icon_shutdown();
efreet_xml_shutdown();
efreet_base_shutdown();
+ eina_stringshare_shutdown();
IF_FREE(efreet_lang);
IF_FREE(efreet_lang_country);
int
efreet_base_init(void)
{
- if (!ecore_string_init()) return 0;
+ if (!eina_stringshare_init()) return 0;
return 1;
}
IF_FREE_LIST(xdg_data_dirs);
IF_FREE_LIST(xdg_config_dirs);
- ecore_string_shutdown();
+ eina_stringshare_shutdown();
}
/**
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
efreet_home_dir = "/tmp";
- efreet_home_dir = ecore_string_instance(efreet_home_dir);
+ efreet_home_dir = eina_stringshare_add(efreet_home_dir);
return efreet_home_dir;
}
dir = malloc(sizeof(char) * len);
snprintf(dir, len, "%s%s", user, fallback);
- t = ecore_string_instance(dir);
+ t = eina_stringshare_add(dir);
FREE(dir);
}
- else t = ecore_string_instance(dir);
+ else t = eina_stringshare_add(dir);
return t;
}
if (!path || (path[0] == '\0')) path = fallback;
dirs = ecore_list_new();
- ecore_list_free_cb_set(dirs, ECORE_FREE_CB(ecore_string_release));
+ ecore_list_free_cb_set(dirs, ECORE_FREE_CB(eina_stringshare_del));
if (!path) return dirs;
tmp = strdup(path);
{
*p = '\0';
if (!ecore_list_find(dirs, ECORE_COMPARE_CB(strcmp), s))
- ecore_list_append(dirs, (void *)ecore_string_instance(s));
+ ecore_list_append(dirs, (void *)eina_stringshare_add(s));
s = ++p;
p = strchr(s, ':');
}
if (!ecore_list_find(dirs, ECORE_COMPARE_CB(strcmp), s))
- ecore_list_append(dirs, (void *)ecore_string_instance(s));
+ ecore_list_append(dirs, (void *)eina_stringshare_add(s));
FREE(tmp);
return dirs;
efreet_desktop_init(void)
{
if (init++) return init;
- if (!ecore_string_init()) return --init;
+ if (!eina_stringshare_init()) return --init;
if (!ecore_file_init()) return --init;
efreet_desktop_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
{
if (--init) return init;
ecore_file_shutdown();
- ecore_string_shutdown();
+ eina_stringshare_shutdown();
IF_RELEASE(desktop_environment);
IF_FREE_HASH(efreet_desktop_cache);
EAPI void
efreet_desktop_environment_set(const char *environment)
{
- if (desktop_environment) ecore_string_release(desktop_environment);
- if (environment) desktop_environment = ecore_string_instance(environment);
+ if (desktop_environment) eina_stringshare_del(desktop_environment);
+ if (environment) desktop_environment = eina_stringshare_add(environment);
else desktop_environment = NULL;
}
{
desktop->categories = ecore_list_new();
ecore_list_free_cb_set(desktop->categories,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
}
else
if (ecore_list_find(desktop->categories,
ECORE_COMPARE_CB(strcmp), category)) return;
ecore_list_append(desktop->categories,
- (void *)ecore_string_instance(category));
+ (void *)eina_stringshare_add(category));
}
/**
list = ecore_list_new();
if (!list) return NULL;
- ecore_list_free_cb_set(list, ECORE_FREE_CB(ecore_string_release));
+ ecore_list_free_cb_set(list, ECORE_FREE_CB(eina_stringshare_del));
tmp = strdup(string);
s = tmp;
{
if (p > tmp && *(p-1) == '\\') continue;
*p = '\0';
- ecore_list_append(list, (void *)ecore_string_instance(s));
+ ecore_list_append(list, (void *)eina_stringshare_add(s));
s = p + 1;
}
/* If this is true, the .desktop file does not follow the standard */
printf("[Efreet]: Found a string list without ';' "
"at the end: %s\n", string);
#endif
- ecore_list_append(list, (void *)ecore_string_instance(s));
+ ecore_list_append(list, (void *)eina_stringshare_add(s));
}
free(tmp);
{
desktop->x = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(desktop->x,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(desktop->x,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
}
- ecore_hash_set(desktop->x, (void *)ecore_string_instance(node->key),
- (void *)ecore_string_instance(node->value));
+ ecore_hash_set(desktop->x, (void *)eina_stringshare_add(node->key),
+ (void *)eina_stringshare_add(node->value));
}
/**
* directories are used to look for icons after looking in the user icon dir
* and before looking in standard system directories. The order of search is
* from first to last directory in this list. the strings in the list should
- * be created with ecore_string_instance().
+ * be created with eina_stringshare_add().
*/
EAPI Ecore_List *
efreet_icon_extra_list_get(void)
const char *key;
Efreet_Icon_Theme *theme;
- key = ecore_string_instance(theme_name);
+ key = eina_stringshare_add(theme_name);
theme = ecore_hash_get(efreet_icon_themes, key);
if (!theme)
{
efreet_icon_theme_dir_scan_all(theme_name);
theme = ecore_hash_get(efreet_icon_themes, key);
}
- ecore_string_release(key);
+ eina_stringshare_del(key);
return theme;
}
{
theme = efreet_icon_theme_new();
theme->fake = 1;
- theme->name.internal = ecore_string_instance(theme_name);
+ theme->name.internal = eina_stringshare_add(theme_name);
ecore_hash_set(efreet_icon_themes, (void *)theme->name.internal, theme);
}
|| !ecore_file_is_dir(path))
continue;
- key = ecore_string_instance(dir->d_name);
+ key = eina_stringshare_add(dir->d_name);
theme = ecore_hash_get(efreet_icon_themes, key);
if (!theme)
{
if (theme->fake)
theme->fake = 0;
- ecore_string_release(key);
+ eina_stringshare_del(key);
}
efreet_icon_theme_path_add(theme, path);
efreet_ini_section_set(ini, "Icon Theme");
tmp = efreet_ini_localestring_get(ini, "Name");
- if (tmp) theme->name.name = ecore_string_instance(tmp);
+ if (tmp) theme->name.name = eina_stringshare_add(tmp);
tmp = efreet_ini_localestring_get(ini, "Comment");
if (tmp) theme->comment = strdup(tmp);
efreet_ini_init(void)
{
if (init++) return init;
- if (!ecore_string_init()) return --init;
+ if (!eina_stringshare_init()) return --init;
return init;
}
efreet_ini_shutdown(void)
{
if (--init) return init;
- ecore_string_shutdown();
+ eina_stringshare_shutdown();
return init;
}
}
data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(data, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(data, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(data, ECORE_FREE_CB(ecore_hash_destroy));
line_start = buffer;
section = ecore_hash_new(ecore_str_hash, ecore_str_compare);
ecore_hash_free_key_cb_set(section,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(section, ECORE_FREE_CB(free));
old = ecore_hash_remove(data, header);
// "in file '%s'\n", header, file);
IF_FREE_HASH(old);
- ecore_hash_set(data, (void *)ecore_string_instance(header),
+ ecore_hash_set(data, (void *)eina_stringshare_add(header),
section);
}
else
old = ecore_hash_remove(section, key);
IF_FREE(old);
- ecore_hash_set(section, (void *)ecore_string_instance(key),
+ ecore_hash_set(section, (void *)eina_stringshare_add(key),
efreet_ini_unescape(value));
}
// else
if (!ini->data)
{
ini->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(ini->data, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(ini->data, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(ini->data, ECORE_FREE_CB(ecore_hash_destroy));
}
if (ecore_hash_get(ini->data, section)) return;
hash = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(hash, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(hash, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(hash, ECORE_FREE_CB(free));
- ecore_hash_set(ini->data, (void *)ecore_string_instance(section), hash);
+ ecore_hash_set(ini->data, (void *)eina_stringshare_add(section), hash);
}
/**
{
if (!ini || !key || !ini->section) return;
- ecore_hash_set(ini->section, (void *)ecore_string_instance(key), strdup(value));
+ ecore_hash_set(ini->section, (void *)eina_stringshare_add(key), strdup(value));
}
/**
{NULL, NULL}
};
- if (!ecore_string_init()) return 0;
+ if (!eina_stringshare_init()) return 0;
if (!efreet_xml_init()) return 0;
efreet_menu_handle_cbs = ecore_hash_new(NULL, NULL);
return 0;
ecore_hash_free_key_cb_set(efreet_menu_handle_cbs,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_key_cb_set(efreet_menu_filter_cbs,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_key_cb_set(efreet_menu_move_cbs,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_key_cb_set(efreet_menu_layout_cbs,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
/* set Menu into it's own so we can check the XML is valid before trying
* to handle it */
- efreet_tag_menu = ecore_string_instance(menu_cbs[0].key);
+ efreet_tag_menu = eina_stringshare_add(menu_cbs[0].key);
for (i = 0; menu_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_handle_cbs,
- (void *)ecore_string_instance(menu_cbs[i].key),
+ (void *)eina_stringshare_add(menu_cbs[i].key),
menu_cbs[i].cb);
for (i = 0; filter_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_filter_cbs,
- (void *)ecore_string_instance(filter_cbs[i].key),
+ (void *)eina_stringshare_add(filter_cbs[i].key),
filter_cbs[i].cb);
for (i = 0; move_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_move_cbs,
- (void *)ecore_string_instance(move_cbs[i].key),
+ (void *)eina_stringshare_add(move_cbs[i].key),
move_cbs[i].cb);
for (i = 0; layout_cbs[i].key != NULL; i++)
ecore_hash_set(efreet_menu_layout_cbs,
- (void *)ecore_string_instance(layout_cbs[i].key),
+ (void *)eina_stringshare_add(layout_cbs[i].key),
layout_cbs[i].cb);
return 1;
efreet_menu_kde_legacy_dirs = ecore_list_new();
ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
/* XXX if the return from kde-config is a line longer than PATH_MAX,
* this won't be correct (increase buffer and get the rest...) */
{
*p = '\0';
ecore_list_append(efreet_menu_kde_legacy_dirs,
- (void *)ecore_string_instance(s));
+ (void *)eina_stringshare_add(s));
s = p + 1;
p = strchr(s, ':');
}
if (*s)
ecore_list_append(efreet_menu_kde_legacy_dirs,
- (void *)ecore_string_instance(s));
+ (void *)eina_stringshare_add(s));
pclose(f);
return 1;
IF_RELEASE(efreet_tag_menu);
efreet_xml_shutdown();
- ecore_string_shutdown();
+ eina_stringshare_shutdown();
}
EAPI Efreet_Menu *
entry = efreet_menu_entry_new();
entry->type = EFREET_MENU_ENTRY_DESKTOP;
- entry->id = ecore_string_instance(id);
- entry->name = ecore_string_instance(desktop->name);
- if (desktop->icon) entry->icon = ecore_string_instance(desktop->icon);
+ entry->id = eina_stringshare_add(id);
+ entry->name = eina_stringshare_add(desktop->name);
+ if (desktop->icon) entry->icon = eina_stringshare_add(desktop->icon);
efreet_desktop_ref(desktop);
entry->desktop = desktop;
/* ignore the name if it contains a / */
if (strchr(xml->text, '/')) return 1;
- parent->name.internal = ecore_string_instance(xml->text);
+ parent->name.internal = eina_stringshare_add(xml->text);
return 1;
}
}
legacy_internal = efreet_menu_internal_new();
- legacy_internal->name.internal = ecore_string_instance(ecore_file_file_get(path));
+ legacy_internal->name.internal = eina_stringshare_add(ecore_file_file_get(path));
/* add the legacy dir as an app dir */
app_dir = efreet_menu_app_dir_new();
*path = '\0';
ancestor = efreet_menu_internal_new();
- ancestor->name.internal = ecore_string_instance(tmp);
+ ancestor->name.internal = eina_stringshare_add(tmp);
efreet_menu_create_sub_menu_list(parent);
ecore_list_append(parent->sub_menus, ancestor);
}
IF_RELEASE(origin->name.internal);
- origin->name.internal = ecore_string_instance(tmp);
+ origin->name.internal = eina_stringshare_add(tmp);
efreet_menu_create_sub_menu_list(parent);
ecore_list_append(parent->sub_menus, origin);
menu_desktop = efreet_menu_desktop_new();
menu_desktop->desktop = desktop;
- menu_desktop->id = ecore_string_instance(buf2);
+ menu_desktop->id = eina_stringshare_add(buf2);
ecore_list_prepend(internal->app_pool, menu_desktop);
}
}
/* init entry */
entry = efreet_menu_entry_new();
entry->type = EFREET_MENU_ENTRY_MENU;
- entry->id = ecore_string_instance(internal->name.internal);
- entry->name = ecore_string_instance(internal->name.name);
+ entry->id = eina_stringshare_add(internal->name.internal);
+ entry->name = eina_stringshare_add(internal->name.name);
if (internal->directory)
{
- entry->icon = ecore_string_instance(internal->directory->icon);
+ entry->icon = eina_stringshare_add(internal->directory->icon);
efreet_desktop_ref(internal->directory);
entry->desktop = internal->directory;
}
/* init entry */
entry = efreet_menu_entry_new();
entry->type = EFREET_MENU_ENTRY_DESKTOP;
- entry->id = ecore_string_instance(md->id);
- entry->name = ecore_string_instance(md->desktop->name);
- if (md->desktop->icon) entry->icon = ecore_string_instance(md->desktop->icon);
+ entry->id = eina_stringshare_add(md->id);
+ entry->name = eina_stringshare_add(md->desktop->name);
+ if (md->desktop->icon) entry->icon = eina_stringshare_add(md->desktop->icon);
efreet_desktop_ref(md->desktop);
entry->desktop = md->desktop;
Efreet_Menu *tmp;
tmp = ecore_list_first_remove(sub_entry->entries);
- ecore_string_release(tmp->name);
+ eina_stringshare_del(tmp->name);
tmp->name = sub_entry->name;
sub_entry->name = NULL;
IF_RELEASE(tmp->icon);
IF_FREE_HASH(wild);
wild = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(wild, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(wild, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(wild,
- ECORE_FREE_CB(ecore_string_release));
+ ECORE_FREE_CB(eina_stringshare_del));
IF_FREE_LIST(globs);
globs = ecore_list_new();
ecore_list_free_cb_set(globs, efreet_mime_glob_free);
strncpy(ext, pp, (p - pp));
ext[p - pp] = 0;
- ecore_hash_set(wild, (void*)ecore_string_instance(ext),
- (void*)ecore_string_instance(mimetype));
+ ecore_hash_set(wild, (void*)eina_stringshare_add(ext),
+ (void*)eina_stringshare_add(mimetype));
}
while ((*p != '\n') && (*p != 0));
}
if (ext[0] == '*' && ext[1] == '.')
{
- ecore_hash_set(wild, (void*)ecore_string_instance(&(ext[2])),
- (void*)ecore_string_instance(mimetype));
+ ecore_hash_set(wild, (void*)eina_stringshare_add(&(ext[2])),
+ (void*)eina_stringshare_add(mimetype));
}
else
{
mime = NEW(Efreet_Mime_Glob, 1);
if (mime)
{
- mime->mime = ecore_string_instance(mimetype);
- mime->glob = ecore_string_instance(ext);
+ mime->mime = eina_stringshare_add(mimetype);
+ mime->glob = eina_stringshare_add(ext);
if ((!mime->mime) || (!mime->glob))
{
IF_RELEASE(mime->mime);
memcpy(&buf, ptr, val - ptr);
buf[val - ptr] = '\0';
- mime->mime = ecore_string_instance(buf);
+ mime->mime = eina_stringshare_add(buf);
ptr = ++val;
while (*ptr != '\n') ptr++;
#include <Ecore.h>
#include <Ecore_File.h>
#include <Ecore_Str.h>
+#include <eina_stringshare.h>
#include "efreet_xml.h"
#include "efreet_ini.h"
/**
* @def IF_RELEASE(x)
- * If x is set, ecore_string_release x and set to NULL
+ * If x is set, eina_stringshare_del x and set to NULL
*/
#define IF_RELEASE(x) do { \
if (x) { \
- const char *__tmp; __tmp = (x); (x) = NULL; ecore_string_release(__tmp); \
+ const char *__tmp; __tmp = (x); (x) = NULL; eina_stringshare_del(__tmp); \
} \
(x) = NULL; \
} while (0)
return NULL;
IF_RELEASE(efreet_trash_dir);
- efreet_trash_dir = ecore_string_instance(buf);
+ efreet_trash_dir = eina_stringshare_add(buf);
snprintf(buf, sizeof(buf), "%s/files", efreet_trash_dir);
if (!ecore_file_exists(buf) && !ecore_file_mkpath(buf))
uri = NEW(Efreet_Uri, 1);
if (!uri) return NULL;
- uri->protocol = ecore_string_instance(protocol);
- uri->hostname = ecore_string_instance(hostname);
- uri->path = ecore_string_instance(path);
+ uri->protocol = eina_stringshare_add(protocol);
+ uri->hostname = eina_stringshare_add(hostname);
+ uri->path = eina_stringshare_add(path);
return uri;
}
* @param uri: Create an URI string from an Efreet_Uri struct
* @return The string rapresentation of uri (ex: 'file:///home/my%20name')
* @brief Get the string rapresentation of the given uri struct escaping
- * illegal caracters. Remember to free the string with ecore_string_release()
+ * illegal caracters. Remember to free the string with eina_stringshare_del()
* when you don't need it anymore.
* @note The resulting string will contain the protocol and the path but not
* the hostname, as many apps doesn't handle it.
}
}
- return ecore_string_instance(dest);
+ return eina_stringshare_add(dest);
}
/**
if (!EFREET_EVENT_DESKTOP_CHANGE)
EFREET_EVENT_DESKTOP_CHANGE = ecore_event_type_new();
desktop_by_file_id = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(desktop_by_file_id, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(desktop_by_file_id, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(desktop_by_file_id, ECORE_FREE_CB(efreet_util_desktop_free));
file_id_by_desktop_path = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(file_id_by_desktop_path, ECORE_FREE_CB(ecore_string_release));
- ecore_hash_free_value_cb_set(file_id_by_desktop_path, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(file_id_by_desktop_path, ECORE_FREE_CB(eina_stringshare_del));
+ ecore_hash_free_value_cb_set(file_id_by_desktop_path, ECORE_FREE_CB(eina_stringshare_del));
desktops_by_category = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(desktops_by_category, ECORE_FREE_CB(ecore_string_release));
+ ecore_hash_free_key_cb_set(desktops_by_category, ECORE_FREE_CB(eina_stringshare_del));
ecore_hash_free_value_cb_set(desktops_by_category, ECORE_FREE_CB(ecore_list_destroy));
monitors = ecore_list_new();
p++;
}
free(base);
- file_id = ecore_string_instance(tmp);
+ file_id = eina_stringshare_add(tmp);
free(tmp);
- ecore_hash_set(file_id_by_desktop_path, (void *)ecore_string_instance(path),
+ ecore_hash_set(file_id_by_desktop_path, (void *)eina_stringshare_add(path),
(void *)file_id);
return file_id;
}
Efreet_Cache_Search_List search;
search.list = ecore_list_new();
- search.what = ecore_string_instance(mime);
+ search.what = eina_stringshare_add(mime);
ecore_hash_for_each_node(desktop_by_file_id, efreet_util_cache_search_mime, &search);
- ecore_string_release(search.what);
+ eina_stringshare_del(search.what);
if (ecore_list_empty_is(search.list)) IF_FREE_LIST(search.list);
return search.list;
ud->priority = priority;
ud->desktop = desktop;
- ecore_hash_set(desktop_by_file_id, (void *)ecore_string_instance(file_id), ud);
+ ecore_hash_set(desktop_by_file_id, (void *)eina_stringshare_add(file_id), ud);
efreet_util_desktops_by_category_add(desktop);
ev = NEW(Efreet_Event_Desktop_Change, 1);
if (!ecore_hash_get(file_id_by_desktop_path, desktop->orig_path))
ecore_hash_set(file_id_by_desktop_path,
- (void *)ecore_string_instance(desktop->orig_path),
- (void *)ecore_string_instance(file_id));
+ (void *)eina_stringshare_add(desktop->orig_path),
+ (void *)eina_stringshare_add(file_id));
ud = ecore_hash_get(desktop_by_file_id, file_id);
if (!ud)
ud->priority = priority;
ud->desktop = desktop;
- ecore_hash_set(desktop_by_file_id, (void *)ecore_string_instance(file_id), ud);
+ ecore_hash_set(desktop_by_file_id, (void *)eina_stringshare_add(file_id), ud);
efreet_util_desktops_by_category_add(desktop);
if (event)
ud->priority = priority;
ud->desktop = desktop;
- ecore_hash_set(desktop_by_file_id, (void *)ecore_string_instance(file_id), ud);
+ ecore_hash_set(desktop_by_file_id, (void *)eina_stringshare_add(file_id), ud);
efreet_util_desktops_by_category_remove(ud->desktop);
efreet_util_desktops_by_category_add(desktop);
{
list = ecore_list_new();
ecore_hash_set(desktops_by_category,
- (void *)ecore_string_instance(category), list);
+ (void *)eina_stringshare_add(category), list);
}
if (!ecore_list_goto(list, desktop))
ecore_list_append(list, desktop);
efreet_xml_init(void)
{
if (init++) return init;
- if (!ecore_string_init()) return --init;
+ if (!eina_stringshare_init()) return --init;
return init;
}
efreet_xml_shutdown(void)
{
if (--init) return init;
- ecore_string_shutdown();
+ eina_stringshare_shutdown();
return init;
}
if (xml->children) ecore_dlist_destroy(xml->children);
xml->children = NULL;
- if (xml->tag) ecore_string_release(xml->tag);
+ if (xml->tag) eina_stringshare_del(xml->tag);
if (xml->attributes)
{
Efreet_Xml_Attribute **curr;
curr = xml->attributes;
while (*curr)
{
- ecore_string_release((*curr)->key);
- ecore_string_release((*curr)->value);
+ eina_stringshare_del((*curr)->key);
+ eina_stringshare_del((*curr)->value);
FREE(*curr);
curr++;
xml = NEW(Efreet_Xml, 1);
if (!xml)
{
- ecore_string_release(tag);
+ eina_stringshare_del(tag);
return NULL;
}
if (buf_size > 256) buf_size = 256;
memcpy(buf, start, buf_size - 1);
buf[buf_size - 1] = '\0';
- *tag = ecore_string_instance(buf);
+ *tag = eina_stringshare_add(buf);
return 1;
}
if (buf_size > 256) buf_size = 256;
memcpy(buf, start, buf_size - 1);
buf[buf_size - 1] = '\0';
- attr[count].key = ecore_string_instance(buf);
+ attr[count].key = eina_stringshare_add(buf);
/* search for '=', key/value seperator */
start = NULL;
if (buf_size > 256) buf_size = 256;
memcpy(buf, start, buf_size - 1);
buf[buf_size - 1] = '\0';
- attr[count].value = ecore_string_instance(buf);
+ attr[count].value = eina_stringshare_add(buf);
count++;
}
ERROR:
while (count >= 0)
{
- if (attr[count].key) ecore_string_release(attr[count].key);
- if (attr[count].value) ecore_string_release(attr[count].value);
+ if (attr[count].key) eina_stringshare_del(attr[count].key);
+ if (attr[count].value) eina_stringshare_del(attr[count].value);
count--;
}
error = 1;