Example #1
0
/* will dlclose all the modules loaded and free all the structs */
void
evas_module_shutdown(void)
{
   Eina_Module *en;
   char *path;
   int i;

   for (i = 0; evas_static_module[i].shutdown; ++i)
     evas_static_module[i].shutdown();

   EINA_LIST_FREE(eina_evas_modules, en)
     eina_module_free(en);

   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]);
   evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER]);
   evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER]);
   evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_OBJECT]);
   evas_modules[EVAS_MODULE_TYPE_OBJECT] = NULL;

   EINA_LIST_FREE(evas_module_paths, path)
     free(path);

   eina_array_free(evas_engines);
   evas_engines = NULL;
}
EOLIAN static void
_efl_net_control_technology_efl_object_destructor(Eo *o, Efl_Net_Control_Technology_Data *pd)
{
   Eldbus_Pending *p;
   Eldbus_Signal_Handler *sh;

   EINA_LIST_FREE(pd->pending, p)
     eldbus_pending_cancel(p);

   EINA_LIST_FREE(pd->signal_handlers, sh)
     eldbus_signal_handler_del(sh);

   if (pd->proxy)
     {
        Eldbus_Object *obj = eldbus_proxy_object_get(pd->proxy);
        eldbus_proxy_unref(pd->proxy);
        pd->proxy = NULL;
        eldbus_object_unref(obj);
     }

   efl_destructor(efl_super(o, MY_CLASS));
   eina_stringshare_replace(&pd->path, NULL);
   eina_stringshare_replace(&pd->name, NULL);
   eina_stringshare_replace(&pd->tethering.identifier, NULL);
   eina_stringshare_replace(&pd->tethering.passphrase, NULL);
}
Example #3
0
EAPI void
ecore_imf_context_del(Ecore_IMF_Context *ctx)
{
   Ecore_IMF_Func_Node *fn;

   if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
     {
        ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
                         "ecore_imf_context_del");
        return;
     }

   if (show_req_ctx == ctx)
     show_req_ctx = NULL;

   if (ctx->klass->del) ctx->klass->del(ctx);

   if (ctx->callbacks)
     {
        EINA_LIST_FREE(ctx->callbacks, fn)
           free(fn);
     }

   if (ctx->input_panel_callbacks)
     {
        EINA_LIST_FREE(ctx->input_panel_callbacks, fn)
           free(fn);
     }

   ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
   free(ctx);
}
Example #4
0
/**
 * Destroys a Ecore_Con_Url connection object.
 *
 * @ingroup Ecore_Con_Url_Group
 *
 * @see ecore_con_url_new()
 */
EAPI void
ecore_con_url_destroy(Ecore_Con_Url *url_con)
{
#ifdef HAVE_CURL
   char *s;

   if (!url_con) return;
   if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
     {
	ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_destroy");
	return;
     }

   ECORE_MAGIC_SET(url_con, ECORE_MAGIC_NONE);
   if(url_con->fd != -1)
     {
	FD_CLR(url_con->fd, &_current_fd_set);
	if (url_con->fd_handler)
	  ecore_main_fd_handler_del(url_con->fd_handler);
	url_con->fd = -1;
	url_con->fd_handler = NULL;
     }

   if (url_con->post)
     curl_formfree(url_con->post);
   url_con->post = NULL;
   
   if (url_con->curl_easy)
     {
	// FIXME: For an unknown reason, progress continue to arrive after destruction
	// this prevent any further call to the callback.
	curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL);

	if (url_con->active)
	  {
	     url_con->active = 0;

	     curl_multi_remove_handle(curlm, url_con->curl_easy);
	  }
	curl_easy_cleanup(url_con->curl_easy);
     }
   _url_con_list = eina_list_remove(_url_con_list, url_con);
   curl_slist_free_all(url_con->headers);
   EINA_LIST_FREE(url_con->additional_headers, s)
     free(s);
   EINA_LIST_FREE(url_con->response_headers, s)
     free(s);
   free(url_con->url);
   free(url_con);
#else
   return;
   url_con = NULL;
#endif
}
Example #5
0
static void
_fid_del(_Function_Id *fid)
{
   _Parameter_Desc *param;
   if (!fid) return;
   eina_stringshare_del(fid->name);
   eina_hash_free(fid->data);
   EINA_LIST_FREE(fid->keys, param) _param_del(param);
   EINA_LIST_FREE(fid->params, param) _param_del(param);
   free(fid);
}
Example #6
0
void
session_windows_list_clear(Session *session)
{
    EINA_SAFETY_ON_NULL_RETURN(session);
    Session_Window *data;
    EINA_LIST_FREE(session->windows, data) session_window_free(data);
}
Example #7
0
void
session_window_tabs_list_clear(Session_Window *session_window)
{
    EINA_SAFETY_ON_NULL_RETURN(session_window);
    Session_Item *data;
    EINA_LIST_FREE(session_window->tabs, data) session_item_free(data);
}
static int
_find_interface_class(int iclass)
{
   Eina_List *devs;
   char *name;

   devs = ecore_file_ls("/sys/bus/usb/devices");
   EINA_LIST_FREE(devs, name)
	  {
	     char buf[PATH_MAX];
	     FILE *f;

	     snprintf(buf, sizeof(buf), "%s/%s/%s",
		      "/sys/bus/usb/devices", name, "bInterfaceClass");
	     f = fopen(buf, "r");
	     if (f)
	       {
		  if (fgets(buf, sizeof(buf), f))
		    {
		       int id = -1;

		       sscanf(buf, "%x", &id);
		       if (iclass == id)
			 {
                            EINA_LIST_FREE(devs, name)
                              free(name);
			    fclose(f);
			    return 1;
			 }
		    }
		  fclose(f);
	       }

	free(name);
     }
Example #9
0
static void
clear_preedit(WaylandIMContext *imcontext)
{
   Ecore_IMF_Preedit_Attr *attr = NULL;

   imcontext->preedit_cursor = 0;

   if (imcontext->preedit_text)
     {
        free(imcontext->preedit_text);
        imcontext->preedit_text = NULL;
     }

   if (imcontext->preedit_commit)
     {
        free(imcontext->preedit_commit);
        imcontext->preedit_commit = NULL;
     }

   if (imcontext->preedit_attrs)
     {
        EINA_LIST_FREE(imcontext->preedit_attrs, attr)
           free(attr);
     }

   imcontext->preedit_attrs = NULL;
}
Example #10
0
static Eina_Bool
check_serial(WaylandIMContext *imcontext, uint32_t serial)
{
   Ecore_IMF_Preedit_Attr *attr;

   if ((imcontext->serial - serial) > 
       (imcontext->serial - imcontext->reset_serial))
     {
        EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom,
                          "outdated serial: %u, current: %u, reset: %u",
                          serial, imcontext->serial, imcontext->reset_serial);

        /* Clear pending data */
        imcontext->pending_commit.delete_index = 0;
        imcontext->pending_commit.delete_length = 0;
        imcontext->pending_commit.cursor = 0;
        imcontext->pending_commit.anchor = 0;

        imcontext->pending_preedit.cursor = 0;

        if (imcontext->pending_preedit.attrs)
          {
             EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) free(attr);
             imcontext->pending_preedit.attrs = NULL;
          }

        return EINA_FALSE;
     }

   return EINA_TRUE;
}
Example #11
0
static void
libclouseau_item_add(Evas_Object *o, Clouseau_Tree_Item *parent)
{
   Clouseau_Tree_Item *treeit;
   Eina_List *children;
   Evas_Object *child;

   treeit = calloc(1, sizeof(Clouseau_Tree_Item));
   if (!treeit) return ;

   treeit->ptr = (uintptr_t) o;
   treeit->is_obj = EINA_TRUE;

   treeit->name = eina_stringshare_add(evas_object_type_get(o));
   treeit->is_clipper = !!evas_object_clipees_get(o);
   treeit->is_visible = evas_object_visible_get(o);
   treeit->info = clouseau_object_information_get(treeit);

   parent->children = eina_list_append(parent->children, treeit);

   /* if (!evas_object_smart_data_get(o)) return ; */

   /* Do this only for smart object */
   children = evas_object_smart_members_get(o);
   EINA_LIST_FREE(children, child)
     libclouseau_item_add(child, treeit);
}
Example #12
0
static Eina_List *
_load_list(void)
{
   Eina_List *tree = NULL;
   Eina_List *ees;
   Ecore_Evas *ee;

   ees = ecore_evas_ecore_evas_list_get();

   EINA_LIST_FREE(ees, ee)
     {
        Eina_List *objs;
        Evas_Object *obj;
        Clouseau_Tree_Item *treeit;

        Evas *e;
        int w, h;

        e = ecore_evas_get(ee);
        evas_output_size_get(e, &w, &h);

        treeit = calloc(1, sizeof(Clouseau_Tree_Item));
        if (!treeit) continue ;

        treeit->name = eina_stringshare_add(ecore_evas_title_get(ee));
        treeit->ptr = (uintptr_t) ee;

        tree = eina_list_append(tree, treeit);

        objs = evas_objects_in_rectangle_get(e, SHRT_MIN, SHRT_MIN,
              USHRT_MAX, USHRT_MAX, EINA_TRUE, EINA_TRUE);

        EINA_LIST_FREE(objs, obj)
          libclouseau_item_add(obj, treeit);
    }
Example #13
0
int
main(int argc, char **argv)
{
   Eina_List *list = NULL;
   Eina_List *l;
   void *list_data;

   eina_init();

   list = eina_list_append(list, eina_stringshare_add("calvin"));
   list = eina_list_append(list, eina_stringshare_add("Leoben"));
   list = eina_list_append(list, eina_stringshare_add("D'Anna"));
   list = eina_list_append(list, eina_stringshare_add("Simon"));
   list = eina_list_append(list, eina_stringshare_add("Doral"));
   list = eina_list_append(list, eina_stringshare_add("Six"));
   list = eina_list_append(list, eina_stringshare_add("Sharon"));

   for(l = list; l; l = eina_list_next(l))
     printf("%s\n", (char*)l->data);

   for(l = eina_list_last(list); l; l = eina_list_prev(l))
      printf("%s\n", (char*)eina_list_data_get(l));

   EINA_LIST_FREE(list, list_data)
     eina_stringshare_del(list_data);

   eina_shutdown();

   return 0;
}
Example #14
0
static void
em_del(void *video)
{
   Emotion_Gstreamer_Video *ev = video;

   if (ev->threads)
     {
        Ecore_Thread *t;

        EINA_LIST_FREE(ev->threads, t)
          ecore_thread_cancel(t);

        ev->delete_me = EINA_TRUE;
        return;
     }

   if (ev->in != ev->out)
     {
        ev->delete_me = EINA_TRUE;
        return;
     }

   em_cleanup(ev);

   free(ev);
}
Example #15
0
static void
_evas_gl_preload_main_loop_wakeup(void)
{
   Evas_GL_Texture_Async_Preload *async;
   evas_gl_make_current_cb cb = async_gl_make_current;
   void *data = async_engine_data;
   Eina_Bool running = async_loader_running;

   if (running) evas_gl_preload_render_lock(cb, data);
   EINA_LIST_FREE(async_loader_todie, async)
     {
        Eo *target;

        EINA_LIST_FREE(async->tex->targets, target)
          eo_do(target, evas_obj_image_pixels_dirty_set(EINA_TRUE));
        async->im->cache_entry.flags.preload_done = 0;
        async->tex->was_preloaded = EINA_TRUE;

        async->tex->ptt->allocations = eina_list_remove(async->tex->ptt->allocations, async->tex->aptt);
        pt_unref(async->tex->ptt);
        async->tex->ptt = NULL;
        free(async->tex->aptt);
        async->tex->aptt = NULL;

        evas_gl_common_texture_free(async->tex, EINA_FALSE);
        evas_cache_image_drop(&async->im->cache_entry);
        free(async);
     }
Example #16
0
void
eabout_packages_free(Eina_List *list)
{
    package_t *data;
    EINA_LIST_FREE(list, data)
        eabout_package_item_free(data);
}
/**
 * @internal
 * @returns the number of initializations left for this system
 * @brief Attempts to shut down the subsystem if nothing else is using it
 */
void
efreet_desktop_shutdown(void)
{
    Efreet_Desktop_Type_Info *info;
    char *dir;

    if (efreet_desktop_exe_handler) ecore_event_handler_del(efreet_desktop_exe_handler);
    IF_RELEASE(desktop_environment);
    IF_FREE_HASH(efreet_desktop_cache);
    while (efreet_desktop_types)
    {
        info = eina_list_data_get(efreet_desktop_types);
        efreet_desktop_type_info_free(info);
        efreet_desktop_types = eina_list_remove_list(efreet_desktop_types,
                                                     efreet_desktop_types);
    }
    EINA_LIST_FREE(efreet_desktop_dirs, dir)
        eina_stringshare_del(dir);
    if (cache_monitor) ecore_file_monitor_del(cache_monitor);
    if (change_monitors) eina_hash_free(change_monitors);
    if (cache) eet_close(cache);
    efreet_desktop_edd_shutdown(desktop_edd);
    ecore_file_shutdown();
    eina_log_domain_unregister(_efreet_desktop_log_dom);
    IF_RELEASE(cache_file);
    IF_RELEASE(cache_dirs);
    if (efreet_desktop_job) ecore_job_del(efreet_desktop_job);
    efreet_desktop_job = NULL;
}
EINTERN int
e_backlight_shutdown(void)
{
   const char *s;

   if (bl_anim) ecore_animator_del(bl_anim);
   bl_anim = NULL;

   if (e_config->backlight.mode != E_BACKLIGHT_MODE_NORMAL)
     e_backlight_level_set(NULL, e_config->backlight.normal, 0.0);

   EINA_LIST_FREE(bl_devs, s)
     eina_stringshare_del(s);
#ifdef HAVE_EEZE
   if (bl_sysval) eina_stringshare_del(bl_sysval);
   bl_sysval = NULL;
   if (bl_sys_exit_handler) ecore_event_handler_del(bl_sys_exit_handler);
   bl_sys_exit_handler = NULL;
   bl_sys_set_exe = NULL;
   bl_sys_pending_set = EINA_FALSE;
   eeze_shutdown();
#endif

   return 1;
}
Example #19
0
void
e_int_config_wallpaper_web_del(E_Dialog *dia)
{
   Web *web;
   Ecore_File_Download_Job *job;
   Exchange_Object *wp;
   Eina_List *l;

   web = dia->data;
   e_int_config_wallpaper_web_done(web->parent);

   EINA_LIST_FOREACH(web->jobs, l, job)
     ecore_file_download_abort(job);

   EINA_LIST_FREE(web->objs, wp)
     exchange_object_free(wp);

   evas_object_del(web->list);
   evas_object_del(web->textblock);
   evas_object_del(web->image);

   E_FREE(web);
   e_object_unref(E_OBJECT(dia));
   exchange_shutdown();
}
Example #20
0
int main(int c, char **v)
{
   int wfd, rfd;
   Slave_Command cmd;
   void *params = NULL;
   Eina_Module *m;
   Eina_Bool quit = EINA_FALSE;

   if (c < 3)
     return 1;

   eina_init();
   pfx =  eina_prefix_new(v[0], main,
                          "EVAS", "evas", "checkme",
                          PACKAGE_BIN_DIR,
                          PACKAGE_LIB_DIR,
                          PACKAGE_DATA_DIR,
                          PACKAGE_DATA_DIR);

   loaders = eina_hash_string_superfast_new(NULL);
   evas_module_init();

   wfd = atoi(v[1]);
   rfd = atoi(v[2]);

   while (!quit)
     {
        if (!command_read(rfd, &cmd, &params))
          {
             error_send(wfd, CSERVE2_INVALID_COMMAND);
             return 1;
          }
        switch (cmd)
          {
           case IMAGE_OPEN:
             handle_image_open(wfd, params);
             break;
           case IMAGE_LOAD:
             handle_image_load(wfd, params);
             break;
           case SLAVE_QUIT:
             quit = EINA_TRUE;
             break;
           default:
             error_send(wfd, CSERVE2_INVALID_COMMAND);
          }
     }

   evas_module_shutdown();
   eina_hash_free(loaders);

   EINA_LIST_FREE(modules, m)
      eina_module_free(m);

   eina_prefix_free(pfx);
   eina_shutdown();

   return 0;
}
Example #21
0
EAPI void elm_code_line_tokens_clear(Elm_Code_Line *line)
{
   Elm_Code_Token *token;

   EINA_LIST_FREE(line->tokens, token)
     free(token);
   line->tokens = NULL;
}
Example #22
0
void
ecore_file_path_shutdown(void)
{
   char *dir;

   EINA_LIST_FREE(__ecore_file_path_bin, dir)
     eina_stringshare_del(dir);
}
Example #23
0
void language_xml_clear(Language_XML *xml)
{
    Language_XML_Node *n_cur;

    if ((!xml) || (!xml->current))
    {
        DBG("One of values is NULL, returning with error.");
        return;
    }

    xml->current = xml->top;

    n_cur = xml->current;
    if (!n_cur)
    {
        DBG("One of values is NULL, returning with error.");
        return;
    }

    n_cur = n_cur->parent;

    if (n_cur)
    {
        Language_XML_Node *c_parent = n_cur;
        Eina_List *c_list = c_parent->children;
        void *data;

        c_list = eina_list_data_find_list(c_list, xml->current);
        EINA_LIST_FREE(c_list, data) E_FREE(data);
        if (!(n_cur = eina_list_data_get(c_list)))
            if (!(n_cur = eina_list_last(c_list))) n_cur = c_parent;
    }
    else
    {
        xml->top = NULL;
        void *data;
        if (xml->current)
        {
            eina_hash_free(xml->current->attributes);
            EINA_LIST_FREE(xml->current->children, data) E_FREE(data);
            E_FREE(xml->current);
        }
    }

    xml->current = n_cur;
}
Example #24
0
static void
cfg_main_section_free (void)
{
    char *c;

    ENNA_FREE(enna_config->theme);
    ENNA_FREE(enna_config->engine);
    ENNA_FREE(enna_config->verbosity);
    ENNA_FREE(enna_config->log_file);

    EINA_LIST_FREE(enna_config->music_filters, c)
        ENNA_FREE(c);

    EINA_LIST_FREE(enna_config->video_filters, c)
        ENNA_FREE(c);

    EINA_LIST_FREE(enna_config->photo_filters, c)
        ENNA_FREE(c);
}
Example #25
0
void
free_string_list(void *data)
{
   E_Ukit_String_List_Return *ret = data;
   const char *x;

   if (!ret) return;
   EINA_LIST_FREE(ret->strings, x)
     eina_stringshare_del(x);
   free(ret);
}
Example #26
0
void
session_window_free(Session_Window *session_window)
{
    if (session_window->tabs)
    {
        Session_Item *tabs_elem;
        EINA_LIST_FREE(session_window->tabs, tabs_elem)
        session_item_free(tabs_elem);
    }
    free(session_window);
}
Example #27
0
void
session_free(Session *session)
{
    if (session->windows)
    {
        Session_Window *windows_elem;
        EINA_LIST_FREE(session->windows, windows_elem)
        session_window_free(windows_elem);
    }
    free(session);
}
Example #28
0
EAPI int
ecore_con_url_shutdown(void)
{
   Ecore_Con_Url *url_con;
   Ecore_Fd_Handler *fd_handler;
   if (_init_count == 0) return 0;
   --_init_count;
   if (_init_count) return _init_count;
   if (_curl_timer)
     {
        ecore_timer_del(_curl_timer);
        _curl_timer = NULL;
     }
   EINA_LIST_FREE(_url_con_list, url_con)
     ecore_con_url_free(url_con);
   EINA_LIST_FREE(_fd_hd_list, fd_handler)
     ecore_main_fd_handler_del(fd_handler);
   _c_shutdown();
   ecore_shutdown();
   return 0;
}
Example #29
0
File: main.c Project: Limsik/e17
void
environment_store(void)
{
    char *env;
    char **e;

    EINA_LIST_FREE(environment, env)
        free(env);

    for (e = environ; *e; e++)
        environment = eina_list_append(environment, strdup(*e));
}
int
main(int argc, char **argv)
{
    Eet_File *theme_ef;
    Eina_List *l = NULL;
    Efreet_Icon_Theme *theme;
    int i;

    efreet_cache_update = 0;

    if (!efreet_init()) return -1;

    theme_ef = eet_open(efreet_icon_theme_cache_file(), EET_FILE_MODE_READ);
    if (!theme_ef) return -1;

    if (argc > 1)
    {
        for (i = 1; i < argc; i++)
        {
            theme = eet_data_read(theme_ef, efreet_icon_theme_edd(EINA_FALSE), argv[i]);
            if (theme) l = eina_list_append(l, theme);
        }
    }
    else
    {
        char **keys;
        int num;

        keys = eet_list(theme_ef, "*", &num);
        if (keys)
        {
            for (i = 0; i < num; i++)
            {
                theme = eet_data_read(theme_ef, efreet_icon_theme_edd(EINA_FALSE), keys[i]);
                if (theme) l = eina_list_append(l, theme);
            }
            free(keys);
        }
    }

    EINA_LIST_FREE(l, theme)
    {
        void *data;

        dump(theme);

        /* free theme */
        eina_list_free(theme->paths);
        eina_list_free(theme->inherits);
        EINA_LIST_FREE(theme->directories, data)
        free(data);
        free(theme);
    }