forked from enlightenment/enlightenment
Init some vars to NULL.
Minor formatting fixes. SVN revision: 32075
This commit is contained in:
parent
44f2074c49
commit
15672179f7
|
@ -246,25 +246,24 @@ e_fm2_mime_handler_glob_del(E_Fm2_Mime_Handler *handler, const char *glob)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the list of mime handlers for a mime */
|
/* get the list of mime handlers for a mime.
|
||||||
|
NOTE: the list should be free()'ed */
|
||||||
EAPI Evas_List *
|
EAPI Evas_List *
|
||||||
e_fm2_mime_handler_mime_handlers_get(const char *mime)
|
e_fm2_mime_handler_mime_handlers_get(const char *mime)
|
||||||
{
|
{
|
||||||
if ((!mime) || (!_mime_handlers))
|
if ((!mime) || (!_mime_handlers)) return NULL;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return evas_hash_find(_mime_handlers, mime);
|
return evas_hash_find(_mime_handlers, mime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the list of glob handlers for a glob. NOTE: the list should be free()'ed */
|
/* get the list of glob handlers for a glob.
|
||||||
|
NOTE: the list should be free()'ed */
|
||||||
EAPI Evas_List *
|
EAPI Evas_List *
|
||||||
e_fm2_mime_handler_glob_handlers_get(const char *glob)
|
e_fm2_mime_handler_glob_handlers_get(const char *glob)
|
||||||
{
|
{
|
||||||
E_Fm2_Mime_Handler_Tuple *tuple;
|
E_Fm2_Mime_Handler_Tuple *tuple = NULL;
|
||||||
Evas_List *handlers;
|
Evas_List *handlers = NULL;
|
||||||
|
|
||||||
if ((!glob) || (!_glob_handlers))
|
if ((!glob) || (!_glob_handlers)) return NULL;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
tuple = E_NEW(E_Fm2_Mime_Handler_Tuple, 1);
|
tuple = E_NEW(E_Fm2_Mime_Handler_Tuple, 1);
|
||||||
tuple->list = NULL;
|
tuple->list = NULL;
|
||||||
|
@ -279,7 +278,7 @@ e_fm2_mime_handler_glob_handlers_get(const char *glob)
|
||||||
EAPI Evas_Bool
|
EAPI Evas_Bool
|
||||||
e_fm2_mime_handler_call(E_Fm2_Mime_Handler *handler, Evas_Object *obj, const char *path)
|
e_fm2_mime_handler_call(E_Fm2_Mime_Handler *handler, Evas_Object *obj, const char *path)
|
||||||
{
|
{
|
||||||
if (!handler || !obj || !path || !handler->action_func)
|
if ((!handler) || (!obj) || (!path) || (!handler->action_func))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (handler->test_func)
|
if (handler->test_func)
|
||||||
|
@ -301,19 +300,17 @@ e_fm2_mime_handler_call(E_Fm2_Mime_Handler *handler, Evas_Object *obj, const cha
|
||||||
EAPI void
|
EAPI void
|
||||||
e_fm2_mime_handler_mime_handlers_call_all(Evas_Object *obj, const char *path, const char *mime)
|
e_fm2_mime_handler_mime_handlers_call_all(Evas_Object *obj, const char *path, const char *mime)
|
||||||
{
|
{
|
||||||
Evas_List *handlers;
|
Evas_List *handlers = NULL;
|
||||||
Evas_List *l;
|
Evas_List *l = NULL;
|
||||||
|
|
||||||
if ((!obj) || (!path) || (!mime))
|
if ((!obj) || (!path) || (!mime)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
handlers = e_fm2_mime_handler_mime_handlers_get(mime);
|
handlers = e_fm2_mime_handler_mime_handlers_get(mime);
|
||||||
if (!handlers)
|
if (!handlers) return;
|
||||||
return;
|
|
||||||
|
|
||||||
for (l = handlers; l; l = l->next)
|
for (l = handlers; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Fm2_Mime_Handler *handler;
|
E_Fm2_Mime_Handler *handler = NULL;
|
||||||
|
|
||||||
handler = l->data;
|
handler = l->data;
|
||||||
if (!handler) continue;
|
if (!handler) continue;
|
||||||
|
@ -326,19 +323,17 @@ e_fm2_mime_handler_mime_handlers_call_all(Evas_Object *obj, const char *path, co
|
||||||
EAPI void
|
EAPI void
|
||||||
e_fm2_mime_handler_glob_handlers_call_all(Evas_Object *obj, const char *path, const char *glob)
|
e_fm2_mime_handler_glob_handlers_call_all(Evas_Object *obj, const char *path, const char *glob)
|
||||||
{
|
{
|
||||||
Evas_List *handlers;
|
Evas_List *handlers = NULL;
|
||||||
Evas_List *l;
|
Evas_List *l = NULL;
|
||||||
|
|
||||||
if ((!obj) || (!path) || (!glob))
|
if ((!obj) || (!path) || (!glob)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
handlers = e_fm2_mime_handler_glob_handlers_get(glob);
|
handlers = e_fm2_mime_handler_glob_handlers_get(glob);
|
||||||
if (!handlers)
|
if (!handlers) return;
|
||||||
return;
|
|
||||||
|
|
||||||
for (l = handlers; l; l = l->next)
|
for (l = handlers; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Fm2_Mime_Handler *handler;
|
E_Fm2_Mime_Handler *handler = NULL;
|
||||||
|
|
||||||
handler = l->data;
|
handler = l->data;
|
||||||
if (!handler) continue;
|
if (!handler) continue;
|
||||||
|
@ -349,16 +344,16 @@ e_fm2_mime_handler_glob_handlers_call_all(Evas_Object *obj, const char *path, co
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
/* used to loop a glob hash and determine if the glob handler matches the filename */
|
/* used to loop a glob hash and determine if the glob handler matches the filename */
|
||||||
static Evas_Bool _e_fm2_mime_handler_glob_match_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata)
|
static Evas_Bool
|
||||||
|
_e_fm2_mime_handler_glob_match_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata)
|
||||||
{
|
{
|
||||||
E_Fm2_Mime_Handler_Tuple *tuple;
|
E_Fm2_Mime_Handler_Tuple *tuple;
|
||||||
|
Evas_List *handlers = NULL;
|
||||||
|
Evas_List *l = NULL;
|
||||||
|
|
||||||
tuple = fdata;
|
tuple = fdata;
|
||||||
if (e_util_glob_match(tuple->str, key))
|
if (e_util_glob_match(tuple->str, key))
|
||||||
{
|
{
|
||||||
Evas_List *handlers;
|
|
||||||
Evas_List *l;
|
|
||||||
|
|
||||||
handlers = data;
|
handlers = data;
|
||||||
for (l = handlers; l; l = l->next)
|
for (l = handlers; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue