Example #1
0
int evolve_gui_init()
{
   evolve = calloc(1, sizeof(Evolve));
   evolve->emissions = eina_hash_string_superfast_new(NULL);
   evolve->callbacks = eina_hash_string_superfast_new(NULL);
   evolve->parents = eina_hash_string_superfast_new(NULL);

   return 1;
}
Example #2
0
/*============================================================================*
 *                                 Global                                     *
 *============================================================================*/
void eon_script_init(void)
{
    _scripts = eina_hash_string_superfast_new(NULL);
#ifdef BUILD_SCRIPT_NEKO
    //script_neko_init();
#endif
}
Example #3
0
static Eina_Bool _lng_start(Language_XML *xml)
{
    Language_XML_Node *node;

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

    if (!xml->current && xml->top) return EINA_FALSE;

    node = calloc(sizeof(Language_XML_Node), 1);
    if (!node)
    {
        E_FREE(node);
        return EINA_FALSE;
    }

    node->attributes = eina_hash_string_superfast_new(free);
    node->parent = xml->current;

    if (!xml->top)
        xml->current = xml->top = node;
    else
    {
        xml->current->children = eina_list_append( xml->current->children, node );
        xml->current = node;
    }

    return EINA_TRUE;
}
Example #4
0
static Oid *
_oid_track(Edje * ed, Evas_Object * o)
{
   Oid *oi;

   char buf[64];

   SI_RETURN(NULL);

   oi = calloc(1, sizeof(Oid));
   if (!oi)
      return NULL;
   oi->oid = _oid_alloc(ed);
   if (!oi->oid)
     {
	free(oi);
	return NULL;
     }
   oi->ed = ed;
   oi->obj = o;
   evas_object_smart_member_add(oi->obj, oi->ed->obj);
   evas_object_clip_set(oi->obj, oi->ed->base->clipper);
   evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
   snprintf(buf, sizeof(buf), "%i", oi->oid);
   if (!si->oid.hash)
      si->oid.hash = eina_hash_string_superfast_new(NULL);
   eina_hash_add(si->oid.hash, buf, oi);
   return oi;
}
Example #5
0
EAPI void
elixir_context_add(const char *key, const void *data)
{
   if (!context) context = eina_hash_string_superfast_new(NULL);

   eina_hash_add(context, key, data);
}
Example #6
0
/**
 * @internal
 * @param datadirs List of XDG data dirs
 * @param datahome Path to XDG data home directory
 * @return Returns no value
 * @brief Read all glob files in XDG data/home dirs.
 * Also reads the /etc/mime.types file.
 */
static void
efreet_mime_load_globs(Eina_List *datadirs, const char *datahome)
{
    Eina_List *l;
    char buf[4096];
    const char *datadir = NULL;

    IF_FREE_HASH(wild);
    wild = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
    while (globs)
    {
        efreet_mime_glob_free(eina_list_data_get(globs));
        globs = eina_list_remove_list(globs, globs);
    }

    /*
     * This is here for legacy reasons.  It is mentioned briefly
     * in the spec and seems to still be quite valid.  It is
     * loaded first so the globs files will override anything
     * in here.
    */
    efreet_mime_mime_types_load("/etc/mime.types");

    datadir = datahome;
    snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
    efreet_mime_shared_mimeinfo_globs_load(buf);

    EINA_LIST_FOREACH(datadirs, l, datadir)
    {
        snprintf(buf, sizeof(buf), "%s/mime/globs", datadir);
        efreet_mime_shared_mimeinfo_globs_load(buf);
    }
/* externally accessible functions */
E_API void
e_datastore_set(char *key, void *data)
{
   if (!store) store = eina_hash_string_superfast_new(NULL);
   eina_hash_del(store, key, NULL);
   eina_hash_add(store, key, data);
}
Example #8
0
Eina_Bool
etui_modules_init(void)
{
    _etui_providers = eina_hash_string_superfast_new(NULL);
    if (!_etui_providers)
    {
        ERR("Could not allocate providers hash table.");
        return EINA_FALSE;
    }

    /* TODO : STATIC modules */
#ifdef ETUI_BUILD_STATIC_PDF
    etui_module_pdf_init();
#endif

#ifdef ETUI_BUILD_STATIC_PS
    etui_module_ps_init();
#endif

#ifdef ETUI_BUILD_STATIC_IMG
    etui_module_img_init();
#endif

#ifdef ETUI_BUILD_STATIC_DJVU
    etui_module_djvu_init();
#endif

#ifdef ETUI_BUILD_STATIC_EPUB
    etui_module_epub_init();
#endif

    return EINA_TRUE;
}
Example #9
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 #10
0
/* externally accessible functions */
EINTERN int
e_thumb_init(void)
{
   _exe_del_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
                                              _e_thumb_cb_exe_event_del,
                                              NULL);
   _thumbs = eina_hash_string_superfast_new(NULL);
   return 1;
}
Example #11
0
EINTERN int
e_popup_init(void)
{
   _e_popup_window_shape_handler = 
     ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE,
			     _e_popup_cb_window_shape, NULL);
   if (!_e_popup_hash) _e_popup_hash = eina_hash_string_superfast_new(NULL);
   return 1;
}
/* Internal wrapper for eina_hash */
static Eina_Hash*
_eet_eina_hash_add(Eina_Hash *hash, const char *key, const void *data)
{
    if (!hash) hash = eina_hash_string_superfast_new(NULL);
    if (!hash) return NULL;

    eina_hash_add(hash, key, data);
    return hash;
}
Example #13
0
int
enna_activity_init(void)
{
   if (++_activity_init_count != 1)
     return _activity_init_count;

   _activities = eina_hash_string_superfast_new((Eina_Free_Cb)_activity_free_cb);

   return _activity_init_count;
}
Config::Config()
{
    //Init eet for States file
    eet_init();
    initEetDescriptors();

    //read config hash table
    cache_states = eina_hash_string_superfast_new(_eina_hash_free_cb);
    loadStateCache();

    saveCacheTimer = new EcoreTimer(60.0, [=]() { saveStateCache(); });
}
Example #15
0
/*============================================================================*
 *                                 Global                                     *
 *============================================================================*/
void eon_engine_init(void)
{
	_engines = eina_hash_string_superfast_new(NULL);
	/* now the canvas engines */
#ifdef BUILD_ENGINE_SDL
	engine_sdl_init();
#endif
#ifdef BUILD_ENGINE_IPC
#endif
#ifdef BUILD_ENGINE_BUFFER
#endif
}
Example #16
0
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
   Evas_Object *o;
   E_Gadcon_Client *gcc;
   Config_Face *inst;

   inst = eina_hash_find(temperature_config->faces, id);
   if (!inst)
     {
        inst = E_NEW(Config_Face, 1);
        inst->id = eina_stringshare_add(id);
        inst->poll_interval = 128;
        inst->low = 30;
        inst->high = 80;
        inst->sensor_type = SENSOR_TYPE_NONE;
        inst->sensor_name = NULL;
        inst->temp = -900;
        inst->units = CELSIUS;
#ifdef HAVE_EEZE
        inst->backend = UDEV;
#endif
        if (!temperature_config->faces)
          temperature_config->faces = eina_hash_string_superfast_new(NULL);
        eina_hash_direct_add(temperature_config->faces, inst->id, inst);
     }
   if (!inst->id) inst->id = eina_stringshare_add(id);
   E_CONFIG_LIMIT(inst->poll_interval, 1, 1024);
   E_CONFIG_LIMIT(inst->low, 0, 100);
   E_CONFIG_LIMIT(inst->high, 0, 220);
   E_CONFIG_LIMIT(inst->units, CELSIUS, FAHRENHEIT);
#ifdef HAVE_EEZE
   E_CONFIG_LIMIT(inst->backend, TEMPGET, UDEV);
#endif

   o = edje_object_add(gc->evas);
   e_theme_edje_object_set(o, "base/theme/modules/temperature",
                           "e/modules/temperature/main");

   gcc = e_gadcon_client_new(gc, name, id, style, o);
   gcc->data = inst;

   inst->gcc = gcc;
   inst->o_temp = o;
   inst->module = temperature_config->module;
   inst->have_temp = EINA_FALSE;
   temperature_face_update_config(inst);

   evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
                                  _temperature_face_cb_mouse_down, inst);
   return gcc;
}
Example #17
0
Eina_Bool
eet_loader_init(void)
{
   if (!elixir_loader_register(&eet_loader))
     return EINA_FALSE;

   eina_init();
   eet_init();

   stack = eina_array_new(4);
   cache = eina_hash_string_superfast_new(EINA_FREE_CB(_elixir_eet_filename_free));

   return EINA_TRUE;
}
Example #18
0
EAPI Eina_Bool
efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char *data)
{
    EINA_SAFETY_ON_NULL_RETURN_VAL(desktop, EINA_FALSE);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(strncmp(key, "X-", 2), EINA_FALSE);

    if (!desktop->x)
        desktop->x = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));

    eina_hash_del_by_key(desktop->x, key);
    eina_hash_add(desktop->x, key, eina_stringshare_add(data));

    return EINA_TRUE;
}
Example #19
0
EAPI Eina_Bool
efreet_desktop_x_field_set(Efreet_Desktop *desktop, const char *key, const char *data)
{
    if (!desktop || strncmp(key, "X-", 2))
        return EINA_FALSE;

    if (!desktop->x)
        desktop->x = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));

    eina_hash_del_by_key(desktop->x, key);
    eina_hash_add(desktop->x, key, eina_stringshare_add(data));

    return EINA_TRUE;
}
static Efl_Object*
_eldbus_model_arguments_efl_object_constructor(Eo *obj, Eldbus_Model_Arguments_Data *pd)
{
   obj = efl_constructor(efl_super(obj, MY_CLASS));

   pd->obj = obj;
   pd->properties_array = NULL;
   pd->properties_hash = eina_hash_string_superfast_new(EINA_FREE_CB(_eldbus_model_arguments_hash_free));
   pd->pending_list = NULL;
   pd->proxy = NULL;
   pd->arguments = NULL;
   pd->name = NULL;
   return obj;
}
static Eina_Bool
_xre_xcb_font_pool_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
   char             buf[256];
   Eina_Hash       *pool;
   XR_Font_Surface *fs;

   fs = fdata;
   pool = data;
   snprintf(buf, sizeof(buf), "@%p@/@%x@", fs->xinf->x11.connection, fs->xinf->x11.root);
   eina_hash_del(pool, buf, fs);
   if (!hash) hash = eina_hash_string_superfast_new(NULL);
   eina_hash_modify(hash, key, pool);
   return 1;
}
Example #22
0
File: irc.c Project: Limsik/e17
EMAPI int
protocol_init(Emote_Protocol *p)
{
   unsigned int i;
   m = p;

   ecore_con_init();

   _irc_servers = eina_hash_string_superfast_new(NULL);

   for (i = 0; i < (sizeof(_em_events)/sizeof(Emote_Event_Type)); ++i)
      emote_event_handler_add(_em_events[i], _irc_event_handler, NULL);

   return 1;
}
Example #23
0
int
efreet_util_init(void)
{
    if (init++) return init;
    _efreet_utils_log_dom = eina_log_domain_register
      ("efreet_util", EFREET_DEFAULT_LOG_COLOR);
    if (_efreet_utils_log_dom < 0)
    {
        ERROR("Efreet: Could not create a log domain for efreet_util");
        return 0;
    }

    file_id_by_desktop_path = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));

    return init;
}
Example #24
0
EAPI int
efreet_mime_init(void)
{
    if (++_efreet_mime_init_count != 1)
        return _efreet_mime_init_count;

    if (!ecore_init())
        return --_efreet_mime_init_count;

    if (!ecore_file_init())
        goto shutdown_ecore;

    if (!efreet_init())
        goto shutdown_ecore_file;

    _efreet_mime_log_dom = eina_log_domain_register
      ("efreet_mime", EFREET_DEFAULT_LOG_COLOR);

    if (_efreet_mime_log_dom < 0)
    {
        EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_mime.");
        goto shutdown_efreet;
    }

    efreet_mime_endianess = efreet_mime_endian_check();

    monitors = eina_hash_string_superfast_new(EINA_FREE_CB(ecore_file_monitor_del));

    efreet_mime_type_cache_clear();

    if (!efreet_mime_init_files())
        goto unregister_log_domain;

    return _efreet_mime_init_count;

unregister_log_domain:
    eina_log_domain_unregister(_efreet_mime_log_dom);
    _efreet_mime_log_dom = -1;
shutdown_efreet:
    efreet_shutdown();
shutdown_ecore_file:
    ecore_file_shutdown();
shutdown_ecore:
    ecore_shutdown();

    return --_efreet_mime_init_count;
}
Example #25
0
gint ed_curl_get(char *screen_name, char *password, http_request * request, int account_id) {
	CURLcode res;
	CURL *ua=NULL;
	char *key=NULL, *redir_url=NULL;

	if(!request)
		return 2;

	if(!request->url || strlen(request->url) <= 0)
		return 3;

	if(!user_agents) user_agents = eina_hash_string_superfast_new(user_agent_free);

	res = asprintf(&key, "%d", account_id);
	if(res!=-1) {
		ua = (CURL*)eina_hash_find(user_agents, key);
		free(key);
	} else return(6);

	if(!ua) {
		if(debug > 3) printf("No handler, baking a new one\n");
		ua = ed_curl_init(screen_name, password, request, account_id);
		if(!ua) return(6);

		curl_easy_setopt(ua, CURLOPT_HTTPGET,	1L				);
		curl_easy_setopt(ua, CURLOPT_POST,		0L				);
	} else
		if(debug > 3) printf("Already have a handler\n");

	if(debug > 3) printf("Prepping URL\n");
	curl_easy_setopt(ua, CURLOPT_URL,		request->url	);
	if(debug > 3) printf("Prepping content destination\n");
	curl_easy_setopt(ua, CURLOPT_WRITEDATA, (void *)&(request->content)	);

	if(debug > 3) printf("Fetching URL %s...\n", request->url);
	res = curl_easy_perform(ua);

	if(res == 0) {
		res = curl_easy_getinfo(ua, CURLINFO_RESPONSE_CODE, &request->response_code);
		if(CURLE_OK == curl_easy_getinfo(ua, CURLINFO_REDIRECT_URL, &redir_url) && redir_url)
			request->redir_url = strdup(redir_url);
		if(debug > 3) printf("Response code: %ld\n", request->response_code);
		return(request->content.size>0?0:-1);
	}

	return(-1);
}
Example #26
0
static Eina_Bool
_config_init(Email_Config *cfg)
{
    Eina_Bool chk;

    chk = eina_spinlock_new(&cfg->lock);
    if (EINA_UNLIKELY(!chk))
    {
        CRI("Failed to create spinlock");
        goto fail;
    }

    cfg->user_config = eina_hash_string_superfast_new(_free_cb);

    return EINA_TRUE;
fail:
    return EINA_FALSE;
}
EAPI E_Config_DD *
e_config_descriptor_new(const char *name, int size)
{
   Eet_Data_Descriptor_Class eddc;
   E_Config_DD *edd;

   if (!eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), name, size))
     return NULL;

   /* FIXME: We can directly map string inside an Eet_File and reuse it.
      But this need a break in all user of config every where in E.
    */

   edd = (E_Config_DD *)eet_data_descriptor_stream_new(&eddc);

   if (!config_hash) config_hash = eina_hash_string_superfast_new(NULL);
   eina_hash_set(config_hash, name, edd);
   return edd;
}
Example #28
0
EINTERN int
e_icon_init(void)
{
#ifdef USE_ICON_CACHE

   Eet_File *ef;
   char buf[PATH_MAX];

#undef T
#undef D
#define T Cache_Item
#define D cache_item_edd
   D = E_CONFIG_DD_NEW("Cache_Item", T);
   E_CONFIG_VAL(D, T, timestamp, UINT);
#undef T
#undef D
#define T Cache
#define D cache_edd
   D = E_CONFIG_DD_NEW("Cache", T);
   E_CONFIG_HASH(D, T, hash, cache_item_edd);
#undef T
#undef D

   e_user_dir_concat_static(buf, "icon_cache.eet");

   ef = eet_open(buf, EET_FILE_MODE_READ_WRITE);
   if (!ef) return 1;  /* not critical */

   _cache = eet_data_read(ef, cache_edd, "idx");
   if (!_cache)
     _cache = E_NEW(Cache, 1);

   if (!_cache->hash)
     _cache->hash = eina_hash_string_superfast_new(_e_icon_cache_item_free);

   eet_close(ef);

   _cache->file = strdup(buf);

   _cache->ef = NULL;
#endif
   return 1;
}
Example #29
0
const char *
evas_font_dir_cache_find(char *dir, char *font)
{
   Evas_Font_Dir *fd = NULL;

   if (!font_dirs) font_dirs = eina_hash_string_superfast_new(NULL);
   else fd = eina_hash_find(font_dirs, dir);
   fd = object_text_font_cache_dir_update(dir, fd);
   if (fd)
     {
	Evas_Font *fn;

	fn = object_text_font_cache_font_find(fd, font);
	if (fn)
	  {
	     return fn->path;
	  }
     }
   return NULL;
}
Example #30
0
EAPI void
e_stolen_win_add(Ecore_X_Window win)
{
   E_Stolen_Window *esw;

   esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win));
   if (esw)
     {
	esw->refcount++;
     }
   else
     {
	esw = E_NEW(E_Stolen_Window, 1);
	esw->win = win;
	esw->refcount = 1;
	if (!_e_stolen_windows) _e_stolen_windows = eina_hash_string_superfast_new(NULL);
	eina_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw);
     }
   return;
}