void eim_free (Eim *e) { #ifdef CORE_DEBUG printf("TRACE: eim_free\n"); #endif assert (e); if (e->egxps!= NULL) ecore_list_destroy (e->egxps); if (e->account_properties) ecore_list_destroy (e->account_properties); FREE (e); }
void etk_file_cache_dialog_refresh(Etk_Widget* tree) { Etk_Tree_Col* col1; Etk_Tree_Col* col2; char* key; char buffer[PATH_MAX]; Ecore_List* keys; etk_tree_clear(ETK_TREE(tree)); /*Populate the tree*/ col1 = etk_tree_nth_col_get(ETK_TREE(tree), 0); col2 = etk_tree_nth_col_get(ETK_TREE(tree), 1); etk_tree_freeze(ETK_TREE(tree)); keys = entropy_core_file_cache_keys_retrieve(); while ( (key = ecore_list_first_remove(keys))) { entropy_file_listener* listen = entropy_core_file_cache_retrieve(key); if (listen) { snprintf(buffer, PATH_MAX, "%s/%s", listen->file->path, listen->file->filename); etk_tree_row_append(ETK_TREE(tree), NULL, col1, listen->count, col2, buffer, NULL); } } ecore_list_destroy(keys); etk_tree_thaw(ETK_TREE(tree)); }
static Ecore_List * _list_keys_order (Ecore_List *keys) { Ecore_List *l; char *key; l = ecore_list_new (); ecore_list_first_goto(keys); while ((key = ecore_list_next(keys))) { char *str; ecore_list_first_goto (l); while ((str = ecore_list_next(l)) && (strcasecmp (key, str) >= 0)) { } if (!str) ecore_list_append (l, key); else { ecore_list_index_goto (l, ecore_list_index (l) - 1); ecore_list_insert (l, key); } } ecore_list_destroy (keys); return l; }
void get_theme_list() { char * path; path = malloc(sizeof(char) * PATH_MAX); snprintf(path, PATH_MAX, "%s/.e/e/themes", getenv("HOME")); Ecore_List *list; list = ecore_file_ls(path); ecore_list_first_goto(list); char * data; themes = NULL; while ((data = (char *)ecore_list_next(list))) if (strstr(data, ".edj") != NULL) { char * file = (char *) strdup(data); Etheme_Object * o; o = etheme_new(file); themes = eina_list_append(themes, o); free(file); } ecore_list_destroy(list); free(path); }
static void _exml_write_element(EXML_Node *node, xmlTextWriterPtr writer) { EXML_Node *child; Ecore_List *keys; xmlChar *name; xmlTextWriterStartElement( writer, (xmlChar *) node->tag ); keys = ecore_hash_keys( node->attributes ); ecore_list_first_goto( keys ); while( (name = ecore_list_next( keys )) ) { xmlChar *value = ecore_hash_get( node->attributes, name ); xmlTextWriterWriteAttribute( writer, name, value ); } ecore_list_destroy( keys ); if (node->value) xmlTextWriterWriteString( writer, (xmlChar *) node->value ); ecore_list_first_goto( node->children ); while( (child = ecore_list_next( node->children )) ) _exml_write_element( child, writer ); xmlTextWriterEndElement( writer ); }
void ewl_icon_local_viewer_menu_rename_cb (Ewl_Widget * w, void *ev_data, void *user_data) { entropy_gui_component_instance *instance = user_data; entropy_icon_viewer *viewer = instance->data; Ecore_List *sel = ewl_iconbox_get_selection (EWL_ICONBOX (viewer->iconbox)); if (ecore_list_count (sel) == 1) { Ewl_Iconbox_Icon *icon = ecore_list_first_remove (sel); gui_file *local_file = ecore_hash_get (viewer->icon_hash, icon); if (icon) { printf ("Rename dialog..\n"); entropy_ewl_rename_dialog_new (entropy_file_gui_component_new_with_data (local_file->file, instance)); } } else { printf ("Can't rename more than 1 file\n"); } ecore_list_destroy (sel); }
void etk_entropy_delete_dialog_cb(Etk_Object* w, void* user_data) { Etk_Widget* window = NULL; int result = (int)user_data; entropy_generic_file* file; Ecore_List* files; entropy_gui_component_instance* instance; window = etk_object_data_get(ETK_OBJECT(w), "window"); files= etk_object_data_get(ETK_OBJECT(window), "files"); instance = etk_object_data_get(ETK_OBJECT(window), "instance"); switch (result) { case ENTROPY_USER_INTERACTION_RESPONSE_YES: { ecore_list_first_goto(files); while ((file = ecore_list_first_remove(files))) { entropy_plugin_filesystem_file_remove(file, instance); } } break; case ENTROPY_USER_INTERACTION_RESPONSE_NO: { } break; default: break; } ecore_list_destroy(files); etk_object_destroy(ETK_OBJECT(window)); }
void ewl_iconbox_file_copy_cb (Ewl_Widget * w, void *ev_data, void *user_data) { Ecore_List *icon_list; gui_file *file; Ewl_Iconbox_Icon *list_item; entropy_gui_component_instance *instance = (entropy_gui_component_instance *) user_data; /*Clear the existing contents */ entropy_core_selected_files_clear (instance->core); icon_list = ewl_iconbox_get_selection (EWL_ICONBOX (((entropy_icon_viewer *) instance->data)-> iconbox)); ecore_list_first_goto (icon_list); while ((list_item = ecore_list_next (icon_list))) { file = ecore_hash_get (((entropy_icon_viewer *) instance->data)->icon_hash, list_item); entropy_core_selected_file_add (file->file); } ecore_list_destroy (icon_list); }
Ecore_List* entropy_plugins_type_get(int type, int subtype) { entropy_plugin* list_item; Ecore_List* plugins = entropy_core_get_core()->plugin_list; if (plugin_list) { ecore_list_destroy(plugin_list); } plugin_list = ecore_list_new(); ecore_list_first_goto(plugins); while ( (list_item = ecore_list_next(plugins)) ) { /*printf("Scanning plugin: %s\n", list_item->filename);*/ if (list_item->type == type && (subtype == ENTROPY_PLUGIN_SUB_TYPE_ALL || subtype == list_item->subtype) && (type != ENTROPY_PLUGIN_GUI_COMPONENT || (type == ENTROPY_PLUGIN_GUI_COMPONENT && !strcmp(list_item->toolkit, entropy_layout_global_toolkit_get())))) { ecore_list_append(plugin_list, list_item); } } return plugin_list; }
char * EvfsFilereference_to_string(EvfsFilereference * ref) { int length = 0; char *uri; Ecore_List *parent_list = ecore_list_new(); EvfsFilereference *parent; ecore_list_prepend(parent_list, ref); length += strlen(ref->plugin_uri) + strlen("://"); if (ref->username) { length += strlen(ref->username) + strlen(ref->password) + strlen(":") + strlen("@"); } length += strlen(ref->path); while ((parent = ref->parent)) { ecore_list_prepend(parent_list, parent); length += strlen(parent->plugin_uri) + strlen("://"); if (parent->username) { length += strlen(parent->username) + strlen(parent->password) + strlen(":") + strlen("@"); } length += strlen(parent->path); length += strlen("#"); } length += 1; uri = calloc(length, sizeof(char)); while ((parent = ecore_list_first_remove(parent_list))) { strcat(uri, parent->plugin_uri); strcat(uri, "://"); if (parent->username) { strcat(uri, parent->username); strcat(uri, ":"); strcat(uri, parent->password); strcat(uri, "@"); } strcat(uri, parent->path); if (ecore_list_next(parent_list)) strcat(uri, "#"); } ecore_list_destroy(parent_list); return uri; }
int evfs_client_disconnect(evfs_client * client) { Ecore_List *mon_list; Ecore_List *indiv_list; evfs_file_monitor *mon; char *key; Ecore_List *watched_keys = ecore_list_new(); /*printf("Received disconnect for client at evfs_fs_posix.c for client %lu\n", client->id); printf("Scanning monitors for client and removing...\n");*/ mon_list = ecore_hash_keys(posix_monitor_hash); if (mon_list) { while ((key = ecore_list_first_remove(mon_list))) { /*printf("Looking for clients for '%s'\n", key);*/ indiv_list = ecore_hash_get(posix_monitor_hash, key); ecore_list_first_goto(indiv_list); while ((mon = ecore_list_next(indiv_list))) { if (mon->client == client) { ecore_list_append(watched_keys, key); } } } ecore_list_destroy(mon_list); } else { /*printf("No directories/files monitored by any client\n");*/ } while ((key = ecore_list_first_remove(watched_keys))) { evfs_posix_monitor_remove(client, key); } ecore_list_destroy(watched_keys); return 1; }
void widget_clear_ui_hooks( Ewler_Widget *w ) { Ecore_Hash *elems; Ecore_List *elems_stack; Ecore_List *names, *names_stack; char *name; names = ecore_hash_keys(w->elems); elems = w->elems; elems_stack = ecore_list_new(); names_stack = ecore_list_new(); while( (name = ecore_list_next(names)) ) { Ewler_Widget_Elem *elem; elem = ecore_hash_get(elems, name); elem->entry = NULL; elem->text = NULL; if( elem->items ) ecore_hash_destroy(elem->items); elem->items = NULL; if( elem->spec->type == EWLER_SPEC_ELEM_STRUCT ) { ecore_list_prepend(elems_stack, elems); ecore_list_prepend(names_stack, names); elems = elem->info.children; names = ecore_hash_keys(elems); } while( !ecore_list_current(names) && elems != w->elems ) { ecore_list_destroy(names); elems = ecore_list_first_remove(elems_stack); names = ecore_list_first_remove(names_stack); } } ecore_list_destroy(names); ecore_list_destroy(elems_stack); ecore_list_destroy(names_stack); }
void entropy_notification_engine_destroy_thread(entropy_notification_engine* engine) { /*Request a terminate*/ engine->terminate = 1; entropy_notify_event* ev; void* clean; entropy_notify_event_cb_data* cb_data; /*Wait for thread to finish*/ printf("Waiting for notify thread to finish..\n"); printf("..Terminated\n"); ecore_list_first_goto(engine->op_queue); while ( (ev = ecore_list_next(engine->op_queue)) ) { //printf("Freeing an event..\n"); if (ev->cb_list) { ecore_list_first_goto(ev->cb_list); while ( (cb_data = ecore_list_next(ev->cb_list)) ) { entropy_free(cb_data); } ecore_list_destroy(ev->cb_list); } if (ev->cleanup_list) { ecore_list_first_goto(ev->cleanup_list); while ( (clean = ecore_list_next(ev->cleanup_list)) ) { entropy_free(clean); } ecore_list_destroy(ev->cleanup_list); } } printf("Terminating op queue...\n"); ecore_list_destroy(engine->op_queue); printf("Terminating exe queue...\n"); ecore_list_destroy(engine->exe_queue); /*Return*/ printf("..Exiting thread\n"); }
void entropy_notify_event_bulk_commit(entropy_notification_engine* engine, Ecore_List* list) { entropy_notify_event* ev; while ( (ev = ecore_list_first_remove(list))) { ecore_list_append(engine->op_queue, ev); } ecore_list_destroy(list); }
void egxp_node_free (Egxp_Node * n) { #ifdef EGXP_DEBUG printf("TRACE: egxp_node_free\n"); #endif assert (n); if (n->conditions) ecore_list_destroy (n->conditions); if (n->childs) ecore_hash_destroy (n->childs); FREE (n); }
/** * @brief print the dns list in the standard output */ void exalt_dns_printf() { Ecore_List* l = exalt_dns_get_list(); char *dns; printf("## DNS LIST ##\n"); ecore_list_first_goto(l); while (( dns=ecore_list_next(l))) printf("%s\n",dns); ecore_list_destroy(l); }
static void * elem_at_index(Ecore_Hash *elems, int i) { Ecore_List *keys; Ewler_Widget_Elem *elem; char *name; keys = ecore_hash_keys(elems); while( (name = ecore_list_next(keys)) ) { elem = ecore_hash_get(elems, name); if( elem->spec->index == i ) { ecore_list_destroy(keys); return &elem->info.ivalue; } } ecore_list_destroy(keys); return NULL; }
/** * Destroys this xml stylesheet * @param xsl The xml stylesheet * @return nothing */ void exml_xsl_destroy( EXML_XSL *xsl ) { CHECK_PARAM_POINTER("xsl", xsl); if( xsl->buffers ) ecore_list_destroy(xsl->buffers); if( xsl->cur ) xsltFreeStylesheet(xsl->cur); free(xsl); }
void entropy_thumbnailer_plugin_print(Ecore_Hash* mime_register) { char* mime_type; Ecore_List* keys = ecore_hash_keys(mime_register); ecore_list_first_goto(keys); while ( (mime_type = ecore_list_next(keys)) ) { printf ("We have a handler for '%s', it is: %s\n", mime_type, ((entropy_plugin*)ecore_hash_get(mime_register, mime_type))->filename ); } ecore_list_destroy(keys); }
static void _exml_node_destroy( void *data ) { EXML_Node *node = data; if (node) { ecore_hash_destroy(node->attributes); IF_FREE(node->tag); IF_FREE(node->value); ecore_list_destroy(node->children); FREE(node); } }
void ewl_icon_local_viewer_delete_cb (Ewl_Widget * w, void *ev_data, void *user_data) { Ecore_List *file_list = user_data; const char *text = ewl_button_label_get (EWL_BUTTON (w)); entropy_generic_file *file; entropy_gui_component_instance *instance; if (!strcmp (text, "Yes")) { entropy_plugin *plugin; void (*del_func) (entropy_generic_file * source); ecore_list_first_goto (file_list); /*As mentioned below, this is awkward, * but we avoid a sep. data structure here, * as long as we make sure this is documented * i.e. - this first item on this list is the plugin * reference */ instance = ecore_list_next (file_list); plugin = entropy_plugins_type_get_first (ENTROPY_PLUGIN_BACKEND_FILE, ENTROPY_PLUGIN_SUB_TYPE_ALL); /*Get the func ref */ del_func = dlsym (plugin->dl_ref, "entropy_filesystem_file_remove"); while ((file = ecore_list_next (file_list))) { printf ("Deleting '%s'\n", file->filename); (*del_func) (file); } } else { printf ("Selected cancel..\n"); } /*Um...FIXME bad - we need to save a reference to the dialog somewhere */ ewl_widget_destroy (w->parent->parent->parent); ecore_list_destroy (file_list); }
void file_project_save( Ewler_Project *p ) { EXML *xml; Ecore_List *names; char *name; xml = exml_new(); exml_start(xml); exml_tag_set(xml, "project"); exml_attribute_set(xml, "source", "ewler"); exml_attribute_set(xml, "version", VERSION); exml_start(xml); exml_tag_set(xml, "name"); exml_value_set(xml, p->name); exml_end(xml); exml_start(xml); exml_tag_set(xml, "path"); exml_value_set(xml, p->path); exml_end(xml); exml_start(xml); exml_tag_set(xml, "files"); names = ecore_hash_keys(p->files); while( (name = ecore_list_next(names)) ) { exml_start(xml); exml_tag_set(xml, "file"); exml_attribute_set(xml, "name", name); exml_value_set(xml, ecore_hash_get(p->files, name)); exml_end(xml); } ecore_list_destroy(names); exml_end(xml); exml_end(xml); /* maybe prepend path to this */ exml_file_write(xml, p->filename); exml_destroy(xml); }
void ecrin_ewl_list_fill_package (char *aiguille) { Ewl_Widget *row; char *key; if (list_rows) ecore_list_destroy (list_rows); list_rows = ecore_list_new (); if (!aiguille) aiguille = ""; ecore_list_first_goto(sorted_keys); while ((key = ecore_list_next(sorted_keys))) { Ecrin_Hash_Data *data; data = ecrin_hash_data_get (key); if (strstr (key, aiguille)) { row = ewl_tree_text_row_add (EWL_TREE (list), NULL, &data->data_name); ecore_list_append (list_rows, row); switch (data->type) { case HASH_DATA_ENUM: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _enum_display, data); break; case HASH_DATA_DEFINE: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _define_display, data); break; case HASH_DATA_FUNCTION: ewl_callback_append (row, EWL_CALLBACK_CLICKED, _function_display, data); break; default: break; } } } }
void xmpp_im_contact_free (XmppIM_Contact * contact) { assert( contact != NULL); #ifdef XMPPIM_DEBUG _contact_num -=1; printf("TRACE:xmpp_im_contact_free: %d - %s\n", _contact_num, contact->name); #endif /* unregister the contact from his group list */ xmpp_im_contact_remove_all_group (contact); /* remove jid */ xmpp_jid_free (contact->jid); /* free name */ IF_FREE (contact->name); /* remove the list of attached groups */ ecore_list_destroy (contact->groups); FREE (contact); }
static void epdf_index_unfill (Ecore_List *items) { Epdf_Index_Item *item; if (!items) return; ecore_list_first_goto (items); while ((item = (Epdf_Index_Item *)ecore_list_next (items))) { if (item->title) free (item->title); if (item->children) { epdf_index_unfill (item->children); } free (item); } ecore_list_destroy (items); }
/** * update the view of this project based on its contents */ void project_update( void ) { Ewl_Widget *w; Ecore_List *names; Ecore_Sheap *snames; int i, nodes; char *name; ewl_tree_selected_clear(EWL_TREE(file_tree)); ewl_container_reset(EWL_CONTAINER(file_tree)); if( !active_project->files->nodes ) return; names = ecore_hash_keys(active_project->files); nodes = ecore_list_count(names); snames = ecore_sheap_new(ecore_str_compare, nodes); while( (name = ecore_list_remove(names)) ) ecore_sheap_insert(snames, name); ecore_sheap_sort(snames); for( i=0;i<nodes;i++ ) { Ewl_Widget *row; name = ecore_sheap_item(snames, i); w = ewl_text_new(name); row = ewl_tree_row_add(EWL_TREE(file_tree), NULL, &w); ewl_callback_append(row, EWL_CALLBACK_DOUBLE_CLICKED, form_open, name); ewl_callback_append(row, EWL_CALLBACK_CLICKED, project_file_menu, name); ewl_widget_show(w); } ecore_sheap_destroy(snames); ecore_list_destroy(names); }
/*Location related functions*/ static void _etk_layout_location_delete_confirm_cb(Etk_Object * object, void *data) { entropy_gui_component_instance* instance = data; entropy_layout_gui* gui = instance->data; Etk_Tree_Row* row = gui->delete_row; Entropy_Config_Structure* structure; Ecore_List* row_refs = NULL; _layout_etk_row_structure_plugin* ref; if (row) { structure = ecore_hash_get(_etk_layout_row_reference, row); row_refs = ecore_hash_get(_etk_layout_structure_plugin_reference, structure); if (row_refs) { while ( (ref = ecore_list_first_remove(row_refs))) { etk_tree_row_delete(ref->row); IF_FREE(ref); } ecore_list_destroy(row_refs); ecore_hash_remove(_etk_layout_structure_plugin_reference, structure); } entropy_config_standard_structure_remove(structure); } }
static EWL_CALLBACK_DEFN(widget_destroy) { Ewler_Widget *ewler_w; int i; ewler_w = user_data; if( !ewler_w ) return; if( ewler_w->form ) form_remove(ewler_w->form, ewler_w); IF_FREE(ewler_w->source); IF_FREE(ewler_w->parent); ecore_hash_destroy(ewler_w->elems); for( i=0;i<EWL_CALLBACK_MAX;i++ ) if( ewler_w->callbacks[i] ) ecore_list_destroy(ewler_w->callbacks[i]); FREE(ewler_w); }
void xmpp_im_callback_roster_populate(Egxp_Message *msg, void* data) { #ifdef XMPPIM_DEBUG printf("TRACE: xmpp_im_callback_roster_populate\n"); #endif assert (msg && data); Egxp * eg = EGXP(data); /* get the query, all data are inside the query */ Egxp_Message * query = egxp_message_get_child(msg, XMPP_TAG_QUERY); assert (query); /* now get the list of all item message */ Ecore_List * child_list = egxp_message_get_childs(query, XMPP_IM_TAG_ITEM); /* for each element try to create/update the contact */ xmpp_im_roster_update_from_item_messages (XMPPIM_GET(eg)->roster, child_list); /* free list */ ecore_list_destroy (child_list); printf("Callback Roster Populate !!!\n"); }
void gui_object_destroy_and_free (entropy_gui_component_instance * comp, Ecore_Hash * gui_hash) { Ecore_List *list; entropy_generic_file *obj; gui_file *freeobj; /*Temporarily stop callbacks, we don't want to clobber an in-op process */ entropy_notify_lock_loop (comp->core->notify); list = ecore_hash_keys (gui_hash); ecore_list_first_goto (list); while ((obj = ecore_list_next (list))) { freeobj = ecore_hash_get (gui_hash, obj); if (freeobj) { /*Associate this icon with this file in the core, so DND works */ entropy_core_object_file_disassociate (freeobj->icon); gui_file_destroy (freeobj); } /*Tell the core we no longer need this file - it might free it now */ entropy_core_file_cache_remove_reference (obj->md5); } ecore_hash_destroy (gui_hash); ecore_list_destroy (list); entropy_notify_unlock_loop (comp->core->notify); }