aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/temperature/e_mod_main.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-02-25 11:03:47 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-02-25 11:03:47 +0000
commitdb419867dde088460976d3fdff29156ace4be93e (patch)
tree6d9f8f7ce0cfc84454f26302e02477a1d8439116 /src/modules/temperature/e_mod_main.c
parentDummy icons for now. (diff)
downloadenlightenment-db419867dde088460976d3fdff29156ace4be93e.tar.gz
* estickies,
* etk, * PROTO/exalt, * E-MODULES-EXTRA/diskio, * E-MODULES-EXTRA/drawer, * E-MODULES-EXTRA/penguins, * E-MODULES-EXTRA/slideshow, * E-MODULES-EXTRA/mail, * E-MODULES-EXTRA/forecasts, * E-MODULES-EXTRA/iiirk, * E-MODULES-EXTRA/places, * e, * ewl, * ecore, * elitaire, * entrance, * e_dbus, * efreet: Here we go, move from Ecore_List to Eina_List. NOTE: This patch is huge, I did test it a lot, and I hope nothing is broken. But if you think something change after this commit, please contact me ASAP. SVN revision: 39200
Diffstat (limited to 'src/modules/temperature/e_mod_main.c')
-rw-r--r--src/modules/temperature/e_mod_main.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c
index d6eb92163..f5e78f7b0 100644
--- a/src/modules/temperature/e_mod_main.c
+++ b/src/modules/temperature/e_mod_main.c
@@ -69,7 +69,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
temperature_config->faces = eina_hash_string_superfast_new(NULL);
eina_hash_direct_add(temperature_config->faces, inst->id, inst);
}
- if (!inst->id) eina_stringshare_add(id);
+ 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);
@@ -375,17 +375,16 @@ temperature_face_update_config(Config_Face *inst)
inst);
}
-Ecore_List *
+Eina_List *
temperature_get_bus_files(const char* bus)
{
- Ecore_List *result, *therms;
+ Eina_List *result, *therms;
char path[PATH_MAX];
char busdir[PATH_MAX];
- result = ecore_list_new();
+ result = NULL;
if (result)
{
- ecore_list_free_cb_set(result, free);
snprintf(busdir, sizeof(busdir), "/sys/bus/%s/devices", bus);
/* Look through all the devices for the given bus. */
therms = ecore_file_ls(busdir);
@@ -393,19 +392,16 @@ temperature_get_bus_files(const char* bus)
{
char *name;
- while ((name = ecore_list_next(therms)))
+ EINA_LIST_FREE(therms, name)
{
- Ecore_List *files;
+ Eina_List *files;
+ char *file;
/* Search each device for temp*_input, these should be
* temperature devices. */
snprintf(path, sizeof(path), "%s/%s", busdir, name);
files = ecore_file_ls(path);
- if (files)
- {
- char *file;
-
- while ((file = ecore_list_next(files)))
+ EINA_LIST_FREE(files, file)
{
if ((!strncmp("temp", file, 4)) &&
(!strcmp("_input", &file[strlen(file) - 6])))
@@ -415,15 +411,14 @@ temperature_get_bus_files(const char* bus)
snprintf(path, sizeof(path),
"%s/%s/%s", busdir, name, file);
f = strdup(path);
- if (f) ecore_list_append(result, f);
- }
+ if (f) result = eina_list_append(result, f);
}
- ecore_list_destroy(files);
+ free(file);
}
+
+ free(name);
}
- ecore_list_destroy(therms);
}
- ecore_list_first_goto(result);
}
return result;
}