+2013-10-11 Carsten Haitzler (The Rasterman)
+
+ * deprecate/remove all the eina_error setting (and getting)
+ within efl no one uses it and it frankly it much more pain
+ than it's worth. the api's are still there, and efl api's still
+ fail as they did before.. they just don't ALSO set eina_error.
+
2013-10-11 Cedric Bail
* Eina: add Eina_Spinlock API,
- Remove support for DirectFB, XRender, WinCE, Glew, Direct3d, X11-16 and X11-8.
* Ecore_DirectFB:
- Removed
+ * Eina error status:
+ - eina error status from efl now don't also report error in addition to return.
Improvements:
* EFL:
while (eina_hash_find(client_list, &client->id))
client->id = _client_id++;
- if (!eina_hash_add(client_list, &client->id, client))
- {
- Eina_Error err = eina_error_get();
- ERR("Could not add client to the list: \"%s\"",
- eina_error_msg_get(err));
- free(client);
- close(fd);
- return;
- }
+ eina_hash_add(client_list, &client->id, client);
cserve2_fd_watch_add(fd, FD_READ | FD_ERROR, cserve2_message_handler,
client);
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789"));
if (!phone)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting phone for Raul Seixas\n");
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the phone number
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222"));
if (phone)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing phone for Raul Seixas\n");
- else
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789"));
if (!phone)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting phone for Raul Seixas\n");
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the phone number
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222"));
if (phone)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing phone for Raul Seixas\n");
- else
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 01 234-56789"));
if (!phone)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting phone for Raul Seixas\n");
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the phone number
- eina_error_set(0);
phone = eina_hash_set(phone_book, "Raul Seixas",
strdup("+55 02 222-22222"));
if (phone)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing phone for Raul Seixas\n");
- else
- {
- printf("No previous phone found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous phone found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
int32_t id5 = 5;
- eina_error_set(0);
phone = eina_hash_set(phone_book, &id5,
strdup("+55 01 234-56789"));
if (!phone)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous phone found for id5. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting phone for Raul Seixas\n");
+ printf("No previous phone found for id5. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the phone number
- eina_error_set(0);
phone = eina_hash_set(phone_book, &id5,
strdup("+55 02 222-22222"));
if (phone)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing phone for id5\n");
- else
- {
- printf("No previous phone found for id5. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous phone found for id5. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
int64_t id5 = 5;
- eina_error_set(0);
phone = eina_hash_set(phone_book, &id5,
strdup("+55 01 234-56789"));
if (!phone)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous phone found for id5. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting phone for Raul Seixas\n");
+ printf("No previous phone found for id5. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the phone number
- eina_error_set(0);
phone = eina_hash_set(phone_book, &id5,
strdup("+55 02 222-22222"));
if (phone)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing phone for id5\n");
- else
- {
- printf("No previous phone found for id5. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous phone found for id5. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
// Modify or add an entry to the hash with eina_hash_set
// Let's first add a new entry
- eina_error_set(0);
Phone_Entry *p1 = malloc(sizeof(*p1));
p1->name = "Raul Seixas";
p1->number = "+55 01 234-56789";
strdup("raulzito"));
if (!nick)
{
- Eina_Error err = eina_error_get();
- if (!err)
- {
- printf("No previous nick found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
- else
- printf("Error when setting nick for Raul Seixas\n");
+ printf("No previous nick found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
else
{
printf("\n");
// Now change the nick
- eina_error_set(0);
nick = eina_hash_set(phone_book, &p1,
strdup("raulzao"));
if (nick)
}
else
{
- Eina_Error err = eina_error_get();
- if (err)
- printf("Error when changing nick for Raul Seixas\n");
- else
- {
- printf("No previous nick found for Raul Seixas. ");
- printf("Creating new entry.\n");
- }
+ printf("No previous nick found for Raul Seixas. ");
+ printf("Creating new entry.\n");
}
// There are many ways to iterate over our Phone book.
{
struct timezone v = *(struct timezone*)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v.tz_minuteswest;
other_mem = buf; /* required due &buf == buf */
return eina_value_type_pset(convert, convert_mem, &other_mem);
}
-
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
static const char EDJE_EDIT_ERROR_GROUP_REFERENCED_STR[] = "Group still in use";
static const char EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST_STR[] = "Group does not exist";
-EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0 ;
+EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0;
EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0;
EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0;
if (ret) *ret = EINA_TRUE;
}
-static void
-_edje_edit_error_register(void)
-{
- EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST =
- eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST_STR);
- EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED =
- eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED_STR);
- EDJE_EDIT_ERROR_GROUP_REFERENCED =
- eina_error_msg_static_register(EDJE_EDIT_ERROR_GROUP_REFERENCED_STR);
-}
-
EAPI Evas_Object *
edje_edit_object_add(Evas *evas)
{
eed->base = eo_data_ref(obj, EDJE_OBJ_CLASS);
eo_do_super(obj, MY_CLASS, eo_constructor());
- eina_error_set(0);
-
- if (!EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST)
- _edje_edit_error_register();
}
static void
EAPI void
edje_edit_string_list_free(Eina_List *lst)
{
- eina_error_set(0);
//printf("FREE LIST: \n");
while (lst)
{
EAPI void
edje_edit_string_free(const char *str)
{
- eina_error_set(0);
-
if (str) eina_stringshare_del(str);
}
EAPI const char*
edje_edit_compiler_get(Evas_Object *obj)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(0);
return eina_stringshare_add(ed->file->compiler);
}
int search;
//Code *cd;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD GROUP: %s \n", name);
char buf[64], **keys;
int count;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
/* if (eina_hash_find(ed->file->collection_hash, group_name)) */
/* return EINA_FALSE; */
- if (strcmp(ed->group, group_name) == 0)
- {
- eina_error_set(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED);
- return EINA_FALSE;
- }
-
+ if (strcmp(ed->group, group_name) == 0) return EINA_FALSE;
e = eina_hash_find(ed->file->collection, group_name);
- if (!e)
- {
- eina_error_set(EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST);
- return EINA_FALSE;
- }
-
- if (e->id == ed->collection->id)
- {
- eina_error_set(EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED);
- return EINA_FALSE;
- }
-
- if (e->ref)
- {
- eina_error_set(EDJE_EDIT_ERROR_GROUP_REFERENCED);
- return EINA_FALSE;
- }
+ if (!e) return EINA_FALSE;
+ if (e->id == ed->collection->id) return EINA_FALSE;
+ if (e->ref) return EINA_FALSE;
_edje_edit_group_references_update(obj, group_name, NULL);
EAPI Eina_Bool
edje_edit_group_exist(Evas_Object *obj, const char *group)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (eina_hash_find(ed->file->collection, group))
Edje_Part_Collection_Directory_Entry *pce;
Edje_Part_Collection *pc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!new_name) return EINA_FALSE;
EAPI int \
edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \
{ \
- eina_error_set(0); \
GET_ED_OR_RETURN(-1); \
if (!ed->collection) return -1; \
return ed->collection->prop.Class.Value; \
EAPI void \
edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \
{ \
- eina_error_set(0); \
GET_ED_OR_RETURN(); \
ed->collection->prop.Class.Value = v; \
}
Eina_List *datas = NULL;
const char *key;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->collection || !ed->collection->data)
Eina_List *datas = NULL;
const char *key;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->data)
{
Edje_String *es;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!key || !ed->file || !ed->collection)
{
Edje_String *es;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !ed->file)
{
Edje_String *value;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!key || !ed->file || !ed->collection)
{
Edje_String *value;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !ed->file || !ed->file->data)
{
Edje_String *value;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!key || !ed->file || !ed->collection)
{
Edje_String *value;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!itemname || !ed->file || !ed->file->data)
{
Edje_String *es;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!key || !value || !ed->file || !ed->collection)
{
Edje_String *es;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !value || !ed->file || !ed->file->data)
EAPI Eina_Bool
edje_edit_group_data_name_set(Evas_Object *obj, const char *key, const char *new_key)
{
-
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!key || !new_key || !ed->file || !ed->collection) {
EAPI Eina_Bool
edje_edit_data_name_set(Evas_Object *obj, const char *itemname, const char *newname)
{
-
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !newname || !ed->file || !ed->file->data)
Eina_List *l;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->color_classes)
Eina_List *l;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
Eina_List *l;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
Edje_Color_Class *c;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!name || !ed->file)
Eina_List *l;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!name || !ed->file || !ed->file->color_classes)
Eina_List *l;
Edje_Color_Class *cc;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
Eina_List *l;
Edje_Style *s;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->styles)
{
Edje_Style *s;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD STYLE '%s'\n", style);
{
Edje_Style *s;
- eina_error_set(0);
-
GET_ED_OR_RETURN();
//printf("DEL STYLE '%s'\n", style);
Edje_Style *s;
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->styles || !style)
return NULL;
{
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN();
//printf("SET TAG NAME for '%s' FOR STYLE '%s'\n", tag, style);
{
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
//printf("GET TAG '%s' FOR STYLE '%s'\n", tag, style);
{
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN();
//printf("SET TAG VALUE for '%s' FOR STYLE '%s'\n", tag, style);
Edje_Style *s;
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD TAG '%s' IN STYLE '%s'\n", tag_name, style);
Edje_Style *s;
Edje_Style_Tag *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN();
//printf("DEL TAG '%s' IN STYLE '%s'\n", tag, style);
Eina_List *externals = NULL;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->external_dir)
unsigned int freeid;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
e = _edje_edit_external_get(ed, external);
{
Edje_External_Directory_Entry *e;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
e = _edje_edit_external_get(ed, external);
Eina_List *parts = NULL;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
//printf("EE: Found %d parts\n", ed->table_parts_size);
EAPI Eina_Bool
edje_edit_part_name_set(Evas_Object *obj, const char* part, const char* new_name)
{
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
EAPI const char * \
edje_edit_part_api_##Value##_get(Evas_Object *obj, const char *part) \
{ \
- eina_error_set(0); \
GET_RP_OR_RETURN(NULL); \
return eina_stringshare_add(rp->part->api.Value); \
} \
EAPI Eina_Bool \
edje_edit_part_api_##Value##_set(Evas_Object *obj, const char *part, const char *s) \
{ \
- eina_error_set(0); \
GET_RP_OR_RETURN(EINA_FALSE); \
_edje_if_string_free(ed, rp->part->api.Value); \
rp->part->api.Value = eina_stringshare_add(s); \
EAPI Eina_Bool
edje_edit_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type)
{
- eina_error_set(0);
-
if (type == EDJE_PART_TYPE_EXTERNAL)
return EINA_FALSE;
return _edje_edit_real_part_add(obj, name, type, NULL);
EAPI Eina_Bool
edje_edit_part_external_add(Evas_Object *obj, const char *name, const char *source)
{
- eina_error_set(0);
-
if (!source)
return EINA_FALSE;
return _edje_edit_real_part_add(obj, name, EDJE_PART_TYPE_EXTERNAL, source);
unsigned int id;
unsigned int i;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
EAPI Eina_Bool
edje_edit_part_exist(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
return EINA_TRUE;
}
{
Edje_Real_Part *prev;
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
if (rp->part->id < 1) return NULL;
{
Edje_Real_Part *next;
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
if ((unsigned int) rp->part->id >= ed->table_parts_size - 1) return 0;
Edje_Real_Part *prev;
Edje_Part *swap;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
Edje_Real_Part *next;
Edje_Part *swap;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
EAPI Edje_Part_Type
edje_edit_part_type_get(Evas_Object *obj, const char *part)
{
-
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
return rp->part->type;
}
EAPI const char *
edje_edit_part_selected_state_get(Evas_Object *obj, const char *part, double *value)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(NULL);
if (!rp->chosen_description)
{
Edje_Part_Description_Common *pd;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
{
Edje_Real_Part *clip = NULL;
- eina_error_set(0);
-
GET_RP_OR_RETURN(NULL);
//printf("Get clip_to for part: %s [to_id: %d]\n", part, rp->part->clip_to_id);
Edje_Real_Part *clip;
Evas_Object *o, *oo;
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
/* unset clipping */
EAPI Eina_Bool
edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get mouse_events for part: %s [%d]\n", part, rp->part->mouse_events);
return rp->part->mouse_events;
EAPI void
edje_edit_part_mouse_events_set(Evas_Object *obj, const char *part, Eina_Bool mouse_events)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
if (!rp->object) return;
EAPI Eina_Bool
edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get repeat_events for part: %s [%d]\n", part, rp->part->repeat_events);
EAPI void
edje_edit_part_repeat_events_set(Evas_Object *obj, const char *part, Eina_Bool repeat_events)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
if (!rp->object) return;
EAPI Evas_Event_Flags
edje_edit_part_ignore_flags_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
return rp->part->ignore_flags;
EAPI void
edje_edit_part_ignore_flags_set(Evas_Object *obj, const char *part, Evas_Event_Flags ignore_flags)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
if (!rp->object) return;
EAPI void
edje_edit_part_scale_set(Evas_Object *obj, const char *part, Eina_Bool scale)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
rp->part->scale = scale;
EAPI Eina_Bool
edje_edit_part_scale_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
return rp->part->scale;
EAPI const char *
edje_edit_part_source_get(Evas_Object *obj, const char *part)
{
- //Edje_Real_Part *clip = NULL;
- eina_error_set(0);
-
GET_RP_OR_RETURN(NULL);
//printf("Get source for part: %s\n", part);
EAPI Eina_Bool
edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(EINA_FALSE);
Evas_Object *child_obj;
EAPI int
edje_edit_part_drag_x_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
//printf("Get dragX for part: %s\n", part);
return rp->part->dragable.x;
EAPI void
edje_edit_part_drag_x_set(Evas_Object *obj, const char *part, int drag)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
//printf("Set dragX for part: %s\n", part);
rp->part->dragable.x = drag;
EAPI int
edje_edit_part_drag_y_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
//printf("Get dragY for part: %s\n", part);
return rp->part->dragable.y;
EAPI void
edje_edit_part_drag_y_set(Evas_Object *obj, const char *part, int drag)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
//printf("Set dragY for part: %s\n", part);
rp->part->dragable.y = drag;
EAPI int \
edje_edit_part_drag_##Class##_##Value##_get(Evas_Object *obj, const char *part) \
{ \
- eina_error_set(0); \
GET_RP_OR_RETURN(0); \
return rp->part->dragable.Class##_##Value; \
} \
EAPI void \
edje_edit_part_drag_##Class##_##Value##_set(Evas_Object *obj, const char *part, int v) \
{ \
- eina_error_set(0); \
GET_RP_OR_RETURN(); \
rp->part->dragable.Class##_##Value = v; \
}
{ \
Edje_Real_Part *p; \
\
- eina_error_set(0); \
- \
GET_RP_OR_RETURN(NULL); \
\
if (rp->part->dragable.Id##_id < 0) \
{ \
Edje_Real_Part *e_part; \
\
- eina_error_set(0); \
- \
GET_RP_OR_RETURN(); \
if (!e) \
{ \
Eina_List *states = NULL;
unsigned int i;
- eina_error_set(0);
-
GET_RP_OR_RETURN(NULL);
//Is there a better place to put this? maybe edje_edit_init() ?
int part_id;
int i;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
//printf("Set name of state: %s in part: %s [new name: %s]\n",
// part, state, new_name);
Edje_Part_Description_Common *pd;
unsigned int i;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
EAPI Eina_Bool
edje_edit_state_exist(Evas_Object *obj, const char *part, const char *state, double value)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
return EINA_TRUE;
}
Edje_Part_Description_Common *pdfrom, *pdto;
Edje_External_Param *p;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_RP_OR_RETURN(EINA_FALSE);
EAPI double \
edje_edit_state_##Sub##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(0); \
return TO_DOUBLE(pd->Sub.relative_##Value); \
} \
EAPI void \
edje_edit_state_##Sub##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
pd->Sub.relative_##Value = FROM_DOUBLE(v); \
edje_object_calc_force(obj); \
EAPI int \
edje_edit_state_##Sub##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(0); \
return pd->Sub.offset_##Value; \
} \
EAPI void \
edje_edit_state_##Sub##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
pd->Sub.offset_##Value = TO_INT(FROM_DOUBLE(v)); \
edje_object_calc_force(obj); \
{ \
Edje_Real_Part *rel; \
\
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(NULL); \
\
if (pd->Sub.id_##Value == -1) return NULL; \
{ \
Edje_Real_Part *relp; \
\
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(); \
\
if (to) \
EAPI void \
edje_edit_state_##Code##_get(Evas_Object *obj, const char *part, const char *state, double value, int *r, int *g, int *b, int *a) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
\
if (r) *r = pd->Code.r; \
EAPI void \
edje_edit_state_##Code##_set(Evas_Object *obj, const char *part, const char *state, double value, int r, int g, int b, int a) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
\
if (r > -1 && r < 256) pd->Code.r = r; \
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
EAPI double \
edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(0); \
return TO_DOUBLE(pd->Class.Value); \
} \
EAPI void \
edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
pd->Class.Value = FROM_DOUBLE(v); \
edje_object_calc_force(obj); \
EAPI int \
edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(0); \
return pd->Class.Value; \
} \
EAPI void \
edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, int v) \
{ \
- eina_error_set(0); \
GET_PD_OR_RETURN(); \
pd->Class.Value = v; \
edje_object_calc_force(obj); \
EAPI double \
edje_edit_state_fill_##Type##_relative_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(0); \
\
switch (rp->part->type) \
EAPI void \
edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(); \
\
switch (rp->part->type) \
EAPI int \
edje_edit_state_fill_##Type##_offset_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
{ \
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(0); \
\
switch (rp->part->type) \
EAPI void \
edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
{ \
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(); \
\
switch (rp->part->type) \
EAPI Eina_Bool
edje_edit_state_visible_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
//printf("Get state visible flag of part: %s state: %s\n", part, state);
EAPI void
edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN();
//printf("Set state visible flag of part: %s state: %s to: %d\n", part, state, visible);
if (visible) pd->visible = 1;
EAPI unsigned char
edje_edit_state_aspect_pref_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN(0);
//printf("GET ASPECT_PREF of state '%s' [%d]\n", state, pd->aspect.prefer);
EAPI void
edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN();
//printf("SET ASPECT_PREF of state '%s' [to: %d]\n", state, pref);
EAPI const char*
edje_edit_state_color_class_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
//printf("Get ColorClass of part: %s state: %s\n", part, state);
return eina_stringshare_add(pd->color_class);
EAPI void
edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class)
{
- eina_error_set(0);
-
GET_PD_OR_RETURN();
//printf("Set ColorClass of part: %s state: %s [to: %s]\n", part, state, color_class);
_edje_if_string_free(ed, pd->color_class);
{
Edje_Part_Description_External *external;
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p;
Eina_List *l;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
Edje_External_Param *p = NULL, old_p = { 0, 0, 0, 0, 0 };
int found = 0;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
EAPI Eina_Bool
edje_edit_state_external_param_int_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, int val)
{
- eina_error_set(0);
return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_INT, val);
}
EAPI Eina_Bool
edje_edit_state_external_param_bool_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, Eina_Bool val)
{
- eina_error_set(0);
return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_BOOL, (int)val);
}
EAPI Eina_Bool
edje_edit_state_external_param_double_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, double val)
{
- eina_error_set(0);
return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, val);
}
EAPI Eina_Bool
edje_edit_state_external_param_string_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, const char *val)
{
- eina_error_set(0);
return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_STRING, val);
}
EAPI Eina_Bool
edje_edit_state_external_param_choice_set(Evas_Object *obj, const char *part, const char *state, double value, const char *param, const char *val)
{
- eina_error_set(0);
return edje_edit_state_external_param_set(obj, part, state, value, param, EDJE_EXTERNAL_PARAM_TYPE_CHOICE, val);
}
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
//printf("SET TEXT of state: %s\n", state);
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN(-1);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
//printf("SET TEXT_SIZE of state: %s [%d]\n", state, size);
{ \
Edje_Part_Description_Text *txt; \
\
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(0); \
\
if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
{ \
Edje_Part_Description_Text *txt; \
\
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(); \
\
if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
{ \
Edje_Part_Description_Text *txt; \
\
- eina_error_set(0); \
- \
GET_PD_OR_RETURN(EINA_FALSE); \
\
if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
Eina_List *fonts = NULL;
Edje_Font_Directory_Entry *f;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file || !ed->file->fonts) return NULL;
struct stat st;
Edje_Font_Directory_Entry *fnt;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
INF("ADD FONT: %s", path);
{
Edje_Font_Directory_Entry *fnt;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
INF("DEL FONT: %s", alias);
Edje_Font_Directory_Entry *f;
const char *str = NULL;
- eina_error_set(0);
-
if (!alias) return NULL;
GET_ED_OR_RETURN(NULL);
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
{
Edje_Part_Description_Text *txt;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
EAPI Edje_Text_Effect
edje_edit_part_effect_get(Evas_Object *obj, const char *part)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN(0);
//printf("GET EFFECT of part: %s\n", part);
EAPI void
edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect effect)
{
- eina_error_set(0);
-
GET_RP_OR_RETURN();
//printf("SET EFFECT of part: %s [%d]\n", part, effect);
Eina_List *images = NULL;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
if (!ed->file) return NULL;
int free_id = -1;
char *name;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!path) return EINA_FALSE;
Edje_Image_Directory_Entry *de;
unsigned int i;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_ED_OR_RETURN(EINA_FALSE);
{
Edje_Image_Directory_Entry *de;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
if (!name) return EINA_FALSE;
EAPI int
edje_edit_image_id_get(Evas_Object *obj, const char *image_name)
{
- eina_error_set(0);
-
GET_EED_OR_RETURN(-1);
return _edje_image_id_find(eed, image_name);
Edje_Image_Directory_Entry *de = NULL;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(-1);
if (!ed->file) return -1;
Edje_Image_Directory_Entry *de;
unsigned int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(-1);
// Gets the Image Entry
Edje_Part_Description_Image *img;
const char *image;
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
Edje_Part_Description_Image *img;
int id;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if (!image) return;
const char *name;
unsigned int i;
- eina_error_set(0);
-
GET_PD_OR_RETURN(NULL);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
Edje_Part_Image_Id *i;
int id;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
unsigned int i;
int search;
- eina_error_set(0);
-
GET_PD_OR_RETURN(EINA_FALSE);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
{
Edje_Part_Description_Image *img;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
{
Edje_Part_Description_Image *img;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
{
Edje_Part_Description_Image *img;
- eina_error_set(0);
-
GET_PD_OR_RETURN(0);
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
{
Edje_Part_Description_Image *img;
- eina_error_set(0);
-
GET_PD_OR_RETURN();
if (rp->part->type != EDJE_PART_TYPE_IMAGE)
Eina_List *progs = NULL;
int i;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
//printf("EE: Found %d programs\n", ed->table_programs_size);
{
Edje_Program *epr;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD PROGRAM [new name: %s]\n", name);
int id, i;
int old_id = -1;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI Eina_Bool
edje_edit_program_exist(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
return EINA_TRUE;
EAPI Eina_Bool
edje_edit_program_run(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI Eina_Bool
edje_edit_program_name_set(Evas_Object *obj, const char *prog, const char* new_name)
{
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_source_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->source) return NULL;
EAPI Eina_Bool
edje_edit_program_source_set(Evas_Object *obj, const char *prog, const char *source)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_filter_part_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->filter.part) return NULL;
EAPI Eina_Bool
edje_edit_program_filter_part_set(Evas_Object *obj, const char *prog, const char *filter_part)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_filter_state_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->filter.state) return NULL;
EAPI Eina_Bool
edje_edit_program_filter_state_set(Evas_Object *obj, const char *prog, const char *filter_state)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_signal_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->signal) return NULL;
EAPI Eina_Bool
edje_edit_program_signal_set(Evas_Object *obj, const char *prog, const char *sig)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_state_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->state) return NULL;
EAPI Eina_Bool
edje_edit_program_state_set(Evas_Object *obj, const char *prog, const char *state)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI const char *
edje_edit_program_state2_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
if (!epr->state2) return NULL;
EAPI Eina_Bool
edje_edit_program_state2_set(Evas_Object *obj, const char *prog, const char *state2)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI double
edje_edit_program_value_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(-1);
//printf("GET VALUE for program: %s [%s %.2f]\n", prog, epr->state, epr->value);
EAPI Eina_Bool
edje_edit_program_value_set(Evas_Object *obj, const char *prog, double value)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET VALUE for program: %s [%.2f]\n", prog, value);
EAPI double
edje_edit_program_value2_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(-1);
//printf("GET VALUE2 for program: %s [%s %.2f]\n", prog, epr->state2, epr->value2);
EAPI Eina_Bool
edje_edit_program_value2_set(Evas_Object *obj, const char *prog, double value)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET VALUE for program: %s [%.2f]\n", prog, value);
EAPI double
edje_edit_program_in_from_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(0);
//printf("GET IN.FROM for program: %s [%f]\n", prog, epr->in.from);
EAPI Eina_Bool
edje_edit_program_in_from_set(Evas_Object *obj, const char *prog, double seconds)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET IN.FROM for program: %s [%f]\n", prog, epr->in.from);
EAPI double
edje_edit_program_in_range_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(0);
//printf("GET IN.RANGE for program: %s [%f]\n", prog, epr->in.range);
EAPI Eina_Bool
edje_edit_program_in_range_set(Evas_Object *obj, const char *prog, double seconds)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET IN.RANGE for program: %s [%f]\n", prog, epr->in.range);
EAPI Edje_Tween_Mode
edje_edit_program_transition_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(-1);
//printf("GET TRANSITION for program: %s [%d]\n", prog, epr->tween.mode);
EAPI Eina_Bool
edje_edit_program_transition_set(Evas_Object *obj, const char *prog, Edje_Tween_Mode transition)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("GET TRANSITION for program: %s [%d]\n", prog, epr->tween.mode);
EAPI double
edje_edit_program_transition_time_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(-1);
//printf("GET TRANSITION_TIME for program: %s [%.4f]\n", prog, epr->tween.time);
EAPI Eina_Bool
edje_edit_program_transition_time_set(Evas_Object *obj, const char *prog, double seconds)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("GET TRANSITION_TIME for program: %s [%.4f]\n", prog, epr->tween.time);
EAPI Edje_Action_Type
edje_edit_program_action_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(-1);
//printf("GET ACTION for program: %s [%d]\n", prog, epr->action);
{
Program_Script *ps;
- eina_error_set(0);
-
GET_EED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
Eina_List *l, *targets = NULL;
Edje_Program_Target *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
GET_EPR_OR_RETURN(NULL);
EAPI Eina_Bool
edje_edit_program_targets_clear(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
while (epr->targets)
int id;
Edje_Program_Target *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
Eina_List *l;
Edje_Program_Target *t;
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
Eina_List *l, *afters = NULL;
Edje_Program_After *a;
- eina_error_set(0);
-
GET_ED_OR_RETURN(NULL);
GET_EPR_OR_RETURN(NULL);
EAPI Eina_Bool
edje_edit_program_afters_clear(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
while (epr->after)
Edje_Program *af;
Edje_Program_After *a;
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
af = _edje_program_get_byname(obj, after);
Edje_Program_After *a;
Eina_List *l;
- eina_error_set(0);
-
GET_EPR_OR_RETURN(EINA_FALSE);
af = _edje_program_get_byname(obj, after);
EAPI const char *
edje_edit_program_api_name_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
return eina_stringshare_add(epr->api.name);
EAPI const char *
edje_edit_program_api_description_get(Evas_Object *obj, const char *prog)
{
- eina_error_set(0);
-
GET_EPR_OR_RETURN(NULL);
return eina_stringshare_add(epr->api.description);
EAPI Eina_Bool
edje_edit_program_api_name_set(Evas_Object *obj, const char *prog, const char* name)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI Eina_Bool
edje_edit_program_api_description_set(Evas_Object *obj, const char *prog, const char *description)
{
- eina_error_set(0);
-
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
EAPI char *
edje_edit_script_get(Evas_Object *obj)
{
- eina_error_set(0);
-
GET_EED_OR_RETURN(NULL);
GET_ED_OR_RETURN(NULL);
EAPI void
edje_edit_script_set(Evas_Object *obj, const char *code)
{
- eina_error_set(0);
-
GET_EED_OR_RETURN();
free(eed->embryo_source);
{
Program_Script *ps;
- eina_error_set(0);
-
GET_EED_OR_RETURN(NULL);
GET_EPR_OR_RETURN(NULL);
{
Program_Script *ps;
- eina_error_set(0);
-
GET_EED_OR_RETURN();
GET_EPR_OR_RETURN();
EAPI Eina_Bool
edje_edit_save(Evas_Object *obj)
{
- eina_error_set(0);
-
return _edje_edit_internal_save(obj, 1);
}
EAPI Eina_Bool
edje_edit_save_all(Evas_Object *obj)
{
- eina_error_set(0);
-
return _edje_edit_internal_save(obj, 0);
}
unsigned int i;
int j;
*/
- eina_error_set(0);
-
GET_EED_OR_RETURN();
_edje_generate_source(obj);
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
EINA_MAGIC_CHECK_ARRAY(array);
total = array->total + array->step;
- eina_error_set(0);
tmp = realloc(array->data, sizeof (void *) * total);
- if (EINA_UNLIKELY(!tmp))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return 0;
- }
+ if (EINA_UNLIKELY(!tmp)) return 0;
array->total = total;
array->data = tmp;
{
Eina_Array *array;
- eina_error_set(0);
array = malloc(sizeof (Eina_Array));
- if (!array)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!array) return NULL;
EINA_MAGIC_SET(array, EINA_MAGIC_ARRAY);
return EINA_TRUE;
}
- eina_error_set(0);
tmp = malloc(sizeof (void *) * array->total);
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!tmp) return EINA_FALSE;
memcpy(tmp, array->data, limit * sizeof(void *));
total = limit;
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
EINA_MAGIC_CHECK_ARRAY(array);
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Array));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_ARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
EINA_MAGIC_CHECK_ARRAY(array);
- eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_Array));
- if (!ac)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!ac) return NULL;
EINA_MAGIC_SET(ac, EINA_MAGIC_ARRAY_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
* another element will increase the buffer by @p step elements again.
*
* This function return a valid array on success, or @c NULL if memory
- * allocation fails. In that case, the error is set
- * to #EINA_ERROR_OUT_OF_MEMORY.
+ * allocation fails.
*/
EAPI Eina_Array *eina_array_new(unsigned int step) EINA_WARN_UNUSED_RESULT EINA_MALLOC EINA_WARN_UNUSED_RESULT;
* check of @p array. If it is @c NULL or invalid, the program may crash.
*
* If it wasn't able to remove items due to an allocation failure, it will
- * return #EINA_FALSE and the error is set to #EINA_ERROR_OUT_OF_MEMORY.
+ * return #EINA_FALSE.
*/
EAPI Eina_Bool eina_array_remove(Eina_Array * array,
Eina_Bool (*keep)(void *data, void *gdata),
* This function returns a newly allocated iterator associated to
* @p array. If @p array is @c NULL or the count member of @p array is
* less or equal than 0, this function returns @c NULL. If the memory can
- * not be allocated, NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
- * set. Otherwise, a valid iterator is returned.
+ * not be allocated, NULL is returned. Otherwise, a valid iterator is returned.
*/
EAPI Eina_Iterator *eina_array_iterator_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
* This function returns a newly allocated accessor associated to
* @p array. If @p array is @c NULL or the count member of @p array is
* less or equal than 0, this function returns @c NULL. If the memory can
- * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
- * set. Otherwise, a valid accessor is returned.
+ * not be allocated, @c NULL is returned Otherwise, a valid accessor is
+ * returned.
*/
EAPI Eina_Accessor *eina_array_accessor_new(const Eina_Array *array) EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
{
Eina_Benchmark *new;
- eina_error_set(0);
new = calloc(1, sizeof (Eina_Benchmark));
- if (!new)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!new) return NULL;
new->name = name;
new->run = run;
if (count_step == 0)
return EINA_FALSE;
- eina_error_set(0);
run = calloc(1, sizeof (Eina_Run));
- if (!run)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!run) return EINA_FALSE;
run->cb = bench_cb;
run->name = name;
* to name the gnuplot file that eina_benchmark_run() will create.
*
* This function return a valid benchmark on success, or @c NULL if
- * memory allocation fails. In that case, the error is set
- * to #EINA_ERROR_OUT_OF_MEMORY.
- *
+ * memory allocation fails.
+ *
* When the new module is not needed anymore, use
* eina_benchmark_free() to free the allocated memory.
*/
* increasing by @p count_step from @p count_start to @p count_end is passed to @p
* bench_cb when eina_benchmark_run() is called.
*
- * If @p bench is @c NULL, this function returns immediately. If the
- * allocation of the memory of the test to add fails, the error is set
- * to #EINA_ERROR_OUT_OF_MEMORY. This function returns #EINA_FALSE
- * on failure, #EINA_TRUE otherwise.
+ * If @p bench is @c NULL, this function returns immediately.
+ * This function returns #EINA_FALSE on failure, #EINA_TRUE otherwise.
*/
EAPI Eina_Bool eina_benchmark_register(Eina_Benchmark *bench,
const char *name,
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_binbuf_free().
+ * returned. To free the resources, use eina_binbuf_free().
*
* @see eina_binbuf_free()
* @see eina_binbuf_append()
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_binbuf_free().
+ * returned. To free the resources, use eina_binbuf_free().
*
* @see eina_binbuf_manage_new()
* @since 1.2.0
EAPI Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND = 0;
EAPI Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH = 0;
-static const char EINA_ERROR_CONVERT_0X_NOT_FOUND_STR[] =
- "Error during string conversion to float, First '0x' was not found.";
-static const char EINA_ERROR_CONVERT_P_NOT_FOUND_STR[] =
- "Error during string conversion to float, First 'p' was not found.";
-static const char EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH_STR[] =
- "Error outrun string limit during conversion string conversion to float.";
-
/**
* @endcond
*/
* This function sets up the convert module of Eina. It is called by
* eina_init().
*
- * This function sets up the error module of Eina and registers the
- * errors #EINA_ERROR_CONVERT_0X_NOT_FOUND, #EINA_ERROR_CONVERT_P_NOT_FOUND
- * and #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH.
- *
* @see eina_init()
*/
Eina_Bool
EINA_LOG_ERR("Could not register log domain: eina_convert");
return EINA_FALSE;
}
-
-#define EEMR(n) n = eina_error_msg_static_register(n ## _STR)
- EEMR(EINA_ERROR_CONVERT_0X_NOT_FOUND);
- EEMR(EINA_ERROR_CONVERT_P_NOT_FOUND);
- EEMR(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH);
-#undef EEMR
-
return EINA_TRUE;
}
if (strncmp(str, "0x", 2))
{
- eina_error_set(EINA_ERROR_CONVERT_0X_NOT_FOUND);
DBG("'0x' not found in '%s'", src);
return EINA_FALSE;
}
/* Compute the exponent. */
if (*str != 'p')
{
- eina_error_set(EINA_ERROR_CONVERT_P_NOT_FOUND);
DBG("'p' not found in '%s'", src);
return EINA_FALSE;
}
return EINA_TRUE;
on_length_error:
- eina_error_set(EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH);
return EINA_FALSE;
}
* @{
*/
-/**
- * @var EINA_ERROR_CONVERT_P_NOT_FOUND
- * Error identifier corresponding to string not containing 'p'.
- */
-
EAPI extern Eina_Error EINA_ERROR_CONVERT_P_NOT_FOUND;
-
-/**
- * @var EINA_ERROR_CONVERT_0X_NOT_FOUND
- * Error identifier corresponding to string not containing '0x'.
- */
EAPI extern Eina_Error EINA_ERROR_CONVERT_0X_NOT_FOUND;
-
-/**
- * @var EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH
- * Error identifier corresponding to length of the string being too small.
- */
EAPI extern Eina_Error EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH;
/**
* The mantiss and exponent are stored in the buffers pointed
* respectively by @p m and @p e.
*
- * If the string is invalid, the error is set to:
- *
- * @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found,
- * @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found,
- * @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not
- * correct.
- *
- * In those cases, #EINA_FALSE is returned, otherwise #EINA_TRUE is
+ * If the string is invalid #EINA_FALSE is returned, otherwise #EINA_TRUE is
* returned.
*/
EAPI Eina_Bool eina_convert_atod(const char *src,
* The mantiss and exponent are stored in the buffers pointed
* respectively by @p m and @p e.
*
- * If the string is invalid, the error is set to:
- *
- * @li #EINA_ERROR_CONVERT_0X_NOT_FOUND if no 0x is found,
- * @li #EINA_ERROR_CONVERT_P_NOT_FOUND if no p is found,
- * @li #EINA_ERROR_CONVERT_OUTRUN_STRING_LENGTH if @p length is not
- * correct.
- *
- * In those cases, or if @p fp is @c NULL, #EINA_FALSE is returned,
+ * If the string is invalid, #EINA_FALSE is returned,
* otherwise @p fp is computed and #EINA_TRUE is returned.
*
* @note The code uses eina_convert_atod() and do the correct bit
#include "eina_config.h"
#include "eina_private.h"
#include "eina_inlist.h"
-#include "eina_error.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
#include "eina_safety_checks.h"
};
#ifdef _WIN32
-static const char EINA_ERROR_COUNTER_WINDOWS_STR[] =
- "Change your OS, you moron !";
-static int EINA_ERROR_COUNTER_WINDOWS = 0;
LARGE_INTEGER _eina_counter_frequency;
#endif
* eina_counter_init(). It is called by eina_init().
*
* This function sets up the error module of Eina and only on Windows,
- * it initializes the high precision timer. It also registers, only on
- * Windows, the error #EINA_ERROR_COUNTER_WINDOWS. It is also called
+ * it initializes the high precision timer. It is also called
* by eina_init(). It returns 0 on failure, otherwise it returns the
* number of times it has already been called.
*
eina_counter_init(void)
{
#ifdef _WIN32
- EINA_ERROR_COUNTER_WINDOWS = eina_error_msg_static_register(
- EINA_ERROR_COUNTER_WINDOWS_STR);
- if (!QueryPerformanceFrequency(&_eina_counter_frequency))
- {
- eina_error_set(EINA_ERROR_COUNTER_WINDOWS);
- return EINA_FALSE;
- }
-
+ if (!QueryPerformanceFrequency(&_eina_counter_frequency)) return EINA_FALSE;
#endif /* _WIN2 */
return EINA_TRUE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
length = strlen(name) + 1;
-
- eina_error_set(0);
counter = calloc(1, sizeof (Eina_Counter) + length);
- if (!counter)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!counter) return NULL;
counter->name = (char *)(counter + 1);
memcpy((char *)counter->name, name, length);
Eina_Nano_Time tp;
EINA_SAFETY_ON_NULL_RETURN(counter);
- if (_eina_time_get(&tp) != 0)
- return;
+ if (_eina_time_get(&tp) != 0) return;
- eina_error_set(0);
clk = calloc(1, sizeof (Eina_Clock));
- if (!clk)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return;
- }
+ if (!clk) return;
counter->clocks = eina_inlist_prepend(counter->clocks, EINA_INLIST_GET(clk));
*
* This function returns a new counter. It is characterized by @p
* name. If @p name is @c NULL, the function returns @c NULL
- * immediately. If memory allocation fails, @c NULL is returned and the
- * error is set to #EINA_ERROR_OUT_OF_MEMORY.
+ * immediately. If memory allocation fails, @c NULL is returned.
*
* Whe the new counter is not needed anymore, use eina_counter_free() to
* free the allocated memory.
*
* This function adds the clock associated to @p counter in a list. If
* the memory needed by that clock can not be allocated, the function
- * returns and the error is set to #EINA_ERROR_OUT_OF_MEMORY.
+ * returns and nothing is done.
*
* To stop the timing, eina_counter_stop() must be called with the
* same counter.
#include "eina_config.h"
#include "eina_private.h"
#include "eina_rbtree.h"
-#include "eina_error.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
#include "eina_safety_checks.h"
{
Eina_Hash_Element *new_hash_element = NULL;
Eina_Hash_Head *hash_head;
- Eina_Error error = 0;
int original_key;
int hash_num;
EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
EINA_MAGIC_CHECK_HASH(hash);
- error = EINA_ERROR_OUT_OF_MEMORY;
-
/* Apply eina mask to hash. */
original_key = key_hash;
hash_num = key_hash & hash->mask;
return EINA_TRUE;
on_error:
- eina_error_set(error);
return EINA_FALSE;
}
/* FIXME: Use mempool. */
Eina_Hash *new;
- eina_error_set(0);
EINA_SAFETY_ON_NULL_RETURN_VAL(key_cmp_cb, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key_hash_cb, NULL);
EINA_SAFETY_ON_TRUE_RETURN_VAL(buckets_power_size <= 2, NULL);
return new;
on_error:
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return NULL;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash);
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT(_eina_hash_iterator_data_get_content);
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash);
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT(
EINA_SAFETY_ON_NULL_RETURN_VAL(hash, NULL);
EINA_MAGIC_CHECK_HASH(hash);
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Hash));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
it->hash = hash;
it->get_content = FUNC_ITERATOR_GET_CONTENT(
* @return The new hash table.
*
* This function creates a new hash table using user-defined callbacks
- * to manage the hash table. On failure, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. If @p key_cmp_cb or @p key_hash_cb
+ * to manage the hash table. On failure, @c NULL is returned.
+ * If @p key_cmp_cb or @p key_hash_cb
* are @c NULL, @c NULL is returned. If @p buckets_power_size is
* smaller or equal than 2, or if it is greater or equal than 17,
* @c NULL is returned.
* values as unique. Failure to use sufficient uniqueness will
* result in unexpected results when inserting data pointers accessed
* with eina_hash_find(), and removed with eina_hash_del(). Key
- * strings are case sensitive. If an error occurs, eina_error_get()
- * should be used to determine if an allocation error occurred during
- * this function. This function returns #EINA_FALSE if an error
+ * strings are case sensitive. This function returns #EINA_FALSE if an error
* occurred, #EINA_TRUE otherwise.
*/
EAPI Eina_Bool eina_hash_add(Eina_Hash *hash,
* with eina_hash_find(), and removed with eina_hash_del(). This
* function does not make a copy of @p key, so it must be a string
* constant or stored elsewhere ( in the object being added). Key
- * strings are case sensitive. If an error occurs, eina_error_get()
- * should be used to determine if an allocation error occurred during
- * this function. This function returns #EINA_FALSE if an error
+ * strings are case sensitive. This function returns #EINA_FALSE if an error
* occurred, #EINA_TRUE otherwise.
*/
EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash,
* This function modifies the data of @p key with @p data in @p
* hash. If no entry is found, @p data is added to @p hash with the
* key @p key. On success this function returns the old entry,
- * otherwise it returns @c NULL. To check for errors, use
- * eina_error_get().
+ * otherwise it returns @c NULL.
*/
EAPI void *eina_hash_set(Eina_Hash *hash,
const void *key,
* not forget to count '\\0' for string when setting the value of
* @p key_length. @p key_hash is expected to always match
* @p key. Otherwise, one cannot be sure to find it again with @ref
- * eina_hash_find_by_hash. Key strings are case sensitive. If an error
- * occurs, eina_error_get() should be used to determine if an
- * allocation error occurred during this function. This function
+ * eina_hash_find_by_hash. Key strings are case sensitive. This function
* returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
* @see eina_hash_add()
* not forget to count '\\0' for string when setting the value of
* @p key_length. @p key_hash is expected to always match
* @p key. Otherwise, one cannot be sure to find it again with @ref
- * eina_hash_find_by_hash. Key strings are case sensitive. If an error
- * occurs, eina_error_get() should be used to determine if an
- * allocation error occurred during this function. This function
+ * eina_hash_find_by_hash. Key strings are case sensitive. This function
* returns #EINA_FALSE if an error occurred, #EINA_TRUE otherwise.
*
* @see eina_hash_direct_add()
* valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the hash structure changes then the iterator becomes
* invalid! That is, if you add or remove items this iterator
* valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the hash structure changes then the iterator becomes
* invalid. That is, if you add or remove items this iterator behavior
* valid iterator that will always return false on
* eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @note iterator data will provide values as Eina_Hash_Tuple that should not
* be modified!
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY); \
return __VA_ARGS__; \
} \
- eina_error_set(0); \
} \
while(0)
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ITERATOR); \
return __VA_ARGS__; \
} \
- eina_error_set(0); \
} \
while(0)
EINA_MAGIC_FAIL(d, EINA_MAGIC_INARRAY_ACCESSOR); \
return __VA_ARGS__; \
} \
- eina_error_set(0); \
} \
while(0)
new_max = ((new_size / array->step) + 1) * array->step;
tmp = realloc(array->members, new_max * array->member_size);
- if ((!tmp) && (new_max > 0))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if ((!tmp) && (new_max > 0)) return EINA_FALSE;
array->members = tmp;
array->max = new_max;
EINA_SAFETY_ON_TRUE_RETURN_VAL(member_size == 0, NULL);
ret = malloc(sizeof(*ret));
- if (!ret)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
- eina_error_set(0);
+ if (!ret) return NULL;
_eina_inarray_setup(ret, member_size, step);
return ret;
}
EINA_MAGIC_CHECK_INARRAY(array, NULL);
- eina_error_set(0);
it = calloc(1, sizeof(Eina_Iterator_Inarray));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
EINA_MAGIC_CHECK_INARRAY(array, NULL);
- eina_error_set(0);
it = calloc(1, sizeof(Eina_Iterator_Inarray));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_INARRAY_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
EINA_MAGIC_CHECK_INARRAY(array, NULL);
- eina_error_set(0);
ac = calloc(1, sizeof(Eina_Accessor_Inarray));
- if (!ac)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!ac) return NULL;
EINA_MAGIC_SET(ac, EINA_MAGIC_INARRAY_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
*
* If the @a step is 0, then a safe default is chosen.
*
- * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
- * set. If @a member_size is zero, then @c NULL is returned.
+ * On failure, @c NULL is returned. If @a member_size is zero, then @c NULL
+ * is returned.
*
* @see eina_inarray_free()
*
* This function returns a newly allocated iterator associated to
* @p array.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the array structure changes then the iterator becomes
* invalid! That is, if you add or remove members this
* Unlike eina_inarray_iterator_new(), this will walk the array backwards.
*
* If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the array structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator
* This function returns a newly allocated accessor associated to
* @p array.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid accessor is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid accessor is returned.
*
* @since 1.2
*/
* reasons, there is no check of @p array. If it is @c NULL or
* invalid, the program may crash. If @p data is @c NULL, or if an
* allocation is necessary and fails, #EINA_FALSE is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, #EINA_TRUE is
- * returned.
+ * Otherwise, #EINA_TRUE is returned.
*/
static inline Eina_Bool
{ \
if (type->method) \
type->method(type, ##__VA_ARGS__); \
- else \
- eina_error_set(no_method_err); \
} \
while (0)
{ \
if (type->method) \
return type->method(type, ##__VA_ARGS__); \
- eina_error_set(no_method_err); \
return def_ret; \
} \
while (0)
if (EINA_VALUE_TYPE_DEFAULT(type))
{
- eina_error_set(0);
return EINA_TRUE;
}
EINA_VALUE_TYPE_DISPATCH_RETURN(type, setup,
- EINA_ERROR_VALUE_FAILED, EINA_FALSE, mem);
+ 0, EINA_FALSE, mem);
}
static inline void
}
else if (type->value_size > 8)
eina_value_inner_free(type->value_size, mem);
- eina_error_set(0);
return;
}
- EINA_VALUE_TYPE_DISPATCH(type, flush, EINA_ERROR_VALUE_FAILED, mem);
+ EINA_VALUE_TYPE_DISPATCH(type, flush, 0, mem);
if (type->value_size > 8)
eina_value_inner_free(type->value_size, mem);
value->type = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(b, -1);
EINA_SAFETY_ON_FALSE_RETURN_VAL(a->type == b->type, -1);
- eina_error_set(0);
type = a->type;
pa = eina_value_memory_get(a);
pb = eina_value_memory_get(b);
}
#endif
- EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, EINA_ERROR_VALUE_FAILED,
+ EINA_VALUE_TYPE_DISPATCH_RETURN(type, compare, 0,
EINA_FALSE, pa, pb);
}
type = value->type;
mem = eina_value_memory_get(value);
- eina_error_set(0);
#ifndef EINA_VALUE_NO_OPTIMIZE
if (type == EINA_VALUE_TYPE_UCHAR)
{
else
{
char *tmp = strdup(str);
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!tmp) return EINA_FALSE;
free(value->value.ptr);
value->value.ptr = tmp;
}
}
#endif
- EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, EINA_ERROR_VALUE_FAILED,
+ EINA_VALUE_TYPE_DISPATCH_RETURN(value, vset, 0,
EINA_FALSE, mem, args);
}
type = value->type;
mem = eina_value_memory_get(value);
ptr = va_arg(args, void *);
- eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type))
{
memcpy(ptr, mem, type->value_size);
return EINA_TRUE;
}
- EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED,
+ EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0,
EINA_FALSE, mem, ptr);
}
type = value->type;
mem = eina_value_memory_get(value);
- eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type))
{
else
{
char *tmp = strdup(str);
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!tmp) return EINA_FALSE;
free(value->value.ptr);
value->value.ptr = tmp;
}
return EINA_TRUE;
}
- EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, EINA_ERROR_VALUE_FAILED,
+ EINA_VALUE_TYPE_DISPATCH_RETURN(value, pset, 0,
EINA_FALSE, mem, ptr);
}
type = value->type;
mem = eina_value_memory_get(value);
- eina_error_set(0);
if (EINA_VALUE_TYPE_DEFAULT(type))
{
memcpy(ptr, mem, type->value_size);
return EINA_TRUE;
}
- EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, EINA_ERROR_VALUE_FAILED,
+ EINA_VALUE_TYPE_DISPATCH_RETURN(value, pget, 0,
EINA_FALSE, mem, ptr);
}
if (!mem)
{
mem = malloc(desc->subtype->value_size);
- if (!mem)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!mem) return EINA_FALSE;
if (!eina_hash_add(desc->hash, key, mem))
{
free(mem);
if (!mem)
{
mem = malloc(desc->subtype->value_size);
- if (!mem)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!mem) return EINA_FALSE;
if (!eina_hash_add(desc->hash, key, mem))
{
free(mem);
eina_value_type_setup(const Eina_Value_Type *type, void *mem)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->setup)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->setup) return EINA_FALSE;
return type->setup(type, mem);
}
eina_value_type_flush(const Eina_Value_Type *type, void *mem)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->flush)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->flush) return EINA_FALSE;
return type->flush(type, mem);
}
eina_value_type_copy(const Eina_Value_Type *type, const void *src, void *dst)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->copy)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->copy) return EINA_FALSE;
return type->copy(type, src, dst);
}
eina_value_type_compare(const Eina_Value_Type *type, const void *a, const void *b)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->compare)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->compare) return EINA_FALSE;
return type->compare(type, a, b);
}
eina_value_type_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, const void *type_mem, void *convert_mem)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->convert_to)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->convert_to) return EINA_FALSE;
return type->convert_to(type, convert, type_mem, convert_mem);
}
eina_value_type_convert_from(const Eina_Value_Type *type, const Eina_Value_Type *convert, void *type_mem, const void *convert_mem)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->convert_from)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->convert_from) return EINA_FALSE;
return type->convert_from(type, convert, type_mem, convert_mem);
}
eina_value_type_vset(const Eina_Value_Type *type, void *mem, va_list args)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->vset)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->vset) return EINA_FALSE;
return type->vset(type, mem, args);
}
eina_value_type_pset(const Eina_Value_Type *type, void *mem, const void *ptr)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->pset)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->pset) return EINA_FALSE;
return type->pset(type, mem, ptr);
}
eina_value_type_pget(const Eina_Value_Type *type, const void *mem, void *ptr)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(type), EINA_FALSE);
- if (!type->pget)
- {
- eina_error_set(EINA_ERROR_VALUE_FAILED);
- return EINA_FALSE;
- }
+ if (!type->pget) return EINA_FALSE;
return type->pget(type, mem, ptr);
}
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
EINA_SAFETY_ON_NULL_RETURN_VAL(item, list);
if (EINA_UNLIKELY((item != list) && (!item->prev) && (!item->next)))
{
- eina_error_set(EINA_ERROR_SAFETY_FAILED);
EINA_LOG_ERR("safety check failed: item %p does not appear to be part of an inlist!", item);
return list;
}
{
Eina_Iterator_Inlist *it;
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Inlist));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
it->head = list;
it->current = list;
{
Eina_Accessor_Inlist *ac;
- eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_Inlist));
- if (!ac)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!ac) return NULL;
ac->head = list;
ac->current = list;
* will always return false on eina_iterator_next(), thus keeping API
* sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
- * is returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the list structure changes then the iterator becomes
* invalid, and if you add or remove nodes iterator
* This function returns a newly allocated accessor associated to
* @p in_list. If @p in_list is @c NULL or the count member of @p in_list is
* less or equal than @c 0, this function returns @c NULL. If the memory can
- * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
- * set. Otherwise, a valid accessor is returned.
+ * not be allocated, @c NULL is returned and Otherwise, a valid accessor is
+ * returned.
*/
EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
* sorted and the result will be sorted. If @p list is @c NULLL, item
* is returned. On success, a new list pointer that should be
* used in place of the one given to this function is
- * returned. Otherwise, the old pointer is returned. See eina_error_get().
+ * returned. Otherwise, the old pointer is returned.
*
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance. As said in eina_list_search_sorted_near_list(),
* list with an updated state.. If @p list is @c NULLL, item
* is returned. On success, a new list pointer that should be
* used in place of the one given to this function is
- * returned. Otherwise, the old pointer is returned. See eina_error_get().
+ * returned. Otherwise, the old pointer is returned.
*
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance. As said in eina_list_search_sorted_near_list(),
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_mempool.h"
{
Eina_List *l, *new_l;
- eina_error_set(0);
new_l = _eina_list_mempool_list_new(list);
- if (!new_l)
- return list;
+ if (!new_l) return list;
new_l->next = NULL;
new_l->data = (void *)data;
{
Eina_List *new_l;
- eina_error_set(0);
new_l = _eina_list_mempool_list_new(list);
- if (!new_l)
- return list;
+ if (!new_l) return list;
new_l->prev = NULL;
new_l->next = list;
if ((!list) || (!relative))
return eina_list_append(list, data);
- eina_error_set(0);
new_l = _eina_list_mempool_list_new(list);
- if (!new_l)
- return list;
+ if (!new_l) return list;
EINA_MAGIC_CHECK_LIST(relative, NULL);
new_l->next = relative->next;
if ((!list) || (!relative))
return eina_list_prepend(list, data);
- eina_error_set(0);
new_l = _eina_list_mempool_list_new(list);
- if (!new_l)
- return list;
+ if (!new_l) return list;
EINA_MAGIC_CHECK_LIST(relative, NULL);
{
Eina_Iterator_List *it;
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_List));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
{
Eina_Iterator_List *it;
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_List));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_LIST_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
- eina_error_set(0);
ac = calloc(1, sizeof (Eina_Accessor_List));
- if (!ac)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!ac) return NULL;
EINA_MAGIC_SET(ac, EINA_MAGIC_LIST_ACCESSOR);
EINA_MAGIC_SET(&ac->accessor, EINA_MAGIC_ACCESSOR);
* extern void *my_data;
*
* list = eina_list_append(list, my_data);
- * if (eina_error_get())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* @endcode
*
* @warning @p list must be a pointer to the first element of the list(or NULL).
* extern void *my_data;
*
* list = eina_list_prepend(list, my_data);
- * if (eina_error_get())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* @endcode
*
* @warning @p list must be a pointer to the first element of the list.
* extern void *relative_member;
*
* list = eina_list_append(list, relative_member);
- * if (eina_error_get())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* list = eina_list_append_relative(list, my_data, relative_member);
- * if (eina_error_get())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* @endcode
*
* @warning @p list must be a pointer to the first element of the list.
* extern void *relative_member;
*
* list = eina_list_append(list, relative_member);
- * if (eina_error_get_error())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* list = eina_list_prepend_relative(list, my_data, relative_member);
- * if (eina_error_get())
- * {
- * fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
- * exit(-1);
- * }
* @endcode
*
* @warning @p list must be a pointer to the first element of the list.
* sorted and the result will be sorted. If @p list is @c NULLL, a new
* list is returned. On success, a new list pointer that should be
* used in place of the one given to this function is
- * returned. Otherwise, the old pointer is returned. See eina_error_get().
+ * returned. Otherwise, the old pointer is returned.
*
* @note O(log2(n)) comparisons (calls to @p func) average/worst case
* performance as it uses eina_list_search_sorted_near_list() and thus
* will always return false on eina_iterator_next(), thus keeping API
* sane.
*
- * If the memory can not be allocated, NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
- * is returned.
+ * If the memory can not be allocated, NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning @p list must be a pointer to the first element of the list.
*
*
* Unlike eina_list_iterator_new(), this will walk the list backwards.
*
- * If the memory can not be allocated, NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator
- * is returned.
+ * If the memory can not be allocated, NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning @p list must be a pointer to the first element of the list.
*
* This function returns a newly allocated accessor associated to
* @p list. If @p list is @c NULL or the count member of @p list is
* less or equal than 0, this function returns @c NULL. If the memory can
- * not be allocated, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY is
- * set. Otherwise, a valid accessor is returned.
+ * not be allocated, @c NULL is returned Otherwise, a valid accessor is
+ * returned.
*
* @warning @p list must be a pointer to the first element of the list.
*/
do { \
if (EINA_UNLIKELY(!eina_main_loop_is())) \
{ \
- eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
EINA_LOG_ERR("You are calling %s from outside" \
"of the main loop threads in %s at line %i", \
__FUNCTION__, \
do { \
if (EINA_UNLIKELY(!eina_main_loop_is())) \
{ \
- eina_error_set(EINA_ERROR_NOT_MAIN_LOOP); \
EINA_LOG_ERR("You are calling %s from outside" \
"of the main loop threads in %s at line %i", \
__FUNCTION__, \
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
EAPI Eina_Error EINA_ERROR_MAGIC_FAILED = 0;
-static const char EINA_ERROR_MAGIC_FAILED_STR[] = "Magic check failed.";
-
/**
* @internal
* @brief Initialize the magic string module.
EINA_LOG_ERR("Could not register log domain: eina_magic_string");
return EINA_FALSE;
}
- EINA_ERROR_MAGIC_FAILED = eina_error_msg_static_register(
- EINA_ERROR_MAGIC_FAILED_STR);
-
return EINA_TRUE;
}
const char *fnc,
int line)
{
- eina_error_set(EINA_ERROR_MAGIC_FAILED);
if (!d)
eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR,
file, fnc, line,
*/
#define EINA_MAGIC_NONE 0x1234fedc
-/**
- * @var EINA_ERROR_MAGIC_FAILED
- * Error identifier corresponding to magic check failure.
- */
EAPI extern Eina_Error EINA_ERROR_MAGIC_FAILED;
-
#ifdef EINA_MAGIC_DEBUG
/**
EAPI Eina_Error EINA_ERROR_NOT_MAIN_LOOP = 0;
EAPI unsigned int eina_seed = 0;
-static const char EINA_ERROR_NOT_MAIN_LOOP_STR[] = "Main loop thread check failed.";
-
#ifdef EFL_HAVE_THREADS
# ifdef _WIN32
EAPI DWORD _eina_main_loop;
return 0;
}
- EINA_ERROR_NOT_MAIN_LOOP = eina_error_msg_static_register(
- EINA_ERROR_NOT_MAIN_LOOP_STR);
-
#ifdef EFL_HAVE_THREADS
# ifdef _WIN32
_eina_main_loop = GetCurrentThreadId();
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_magic.h"
#include "eina_mempool.h"
EINA_SAFETY_ON_FALSE_RETURN_VAL(cols > 0, NULL);
m = malloc(sizeof(Eina_Matrixsparse));
- if (!m)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!m) return NULL;
EINA_MAGIC_SET(m, EINA_MAGIC_MATRIXSPARSE);
m->free.func = free_func;
m->free.user_data = (void *)user_data;
- eina_error_set(0);
return m;
}
Eina_Matrixsparse_Iterator *it;
it = calloc(1, sizeof(*it));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
Eina_Matrixsparse_Iterator_Complete *it;
it = calloc(1, sizeof(*it));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(it, EINA_MAGIC_MATRIXSPARSE_ITERATOR);
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
* eina_matrixsparse_cell_idx_clear() and possible others.
* @param user_data given to @a free_func as first parameter.
*
- * @return Newly allocated matrix or @c NULL if allocation failed and eina_error
- * is set.
+ * @return Newly allocated matrix or @c NULL if allocation failed.
*/
EAPI Eina_Matrixsparse *eina_matrixsparse_new(unsigned long rows,
unsigned long cols,
Eina_Mempool_Backend *be = NULL;
Eina_Mempool *mp;
- Eina_Error err = EINA_ERROR_NOT_MEMPOOL_MODULE;
-
- eina_error_set(0);
if (getenv("EINA_MEMPOOL_PASS"))
{
be = eina_hash_find(_backends, "pass_through");
else be = eina_hash_find(_backends, name);
if ((!be) || (!be->init)) goto on_error;
- err = EINA_ERROR_OUT_OF_MEMORY;
mp = calloc(1, sizeof(Eina_Mempool));
- if (!mp)
- goto on_error;
+ if (!mp) goto on_error;
/* Work around ABI incompability introduced in Eina 1.1 */
#define SBP(Property) mp->backend.Property = be->Property;
}
mp->backend_data = mp->backend.init(context, options, args);
-
return mp;
on_error:
- eina_error_set(err);
return NULL;
}
EAPI Eina_Error EINA_ERROR_NOT_MEMPOOL_MODULE = 0;
-static const char EINA_ERROR_NOT_MEMPOOL_MODULE_STR[] =
- "Not a memory pool module.";
-
/**
* @endcond
*/
return 0;
}
- EINA_ERROR_NOT_MEMPOOL_MODULE = eina_error_msg_static_register(
- EINA_ERROR_NOT_MEMPOOL_MODULE_STR);
_backends = eina_hash_string_superfast_new(NULL);
/* dynamic backends */
#include "eina_config.h"
#include "eina_private.h"
#include "eina_alloca.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_mempool.h"
#include "eina_lock.h"
return EINA_FALSE;
}
-static const char EINA_ERROR_MODEL_FAILED_STR[] = "Model check failed.";
-static const char EINA_ERROR_MODEL_METHOD_MISSING_STR[] = "Model method is missing.";
-static const char EINA_MAGIC_MODEL_STR[] = "Eina Model";
-
static void _eina_model_unref(Eina_Model *model);
/**
}
*cmp = eina_value_compare(&atmp, &btmp);
- if (eina_error_get() != 0)
+ if (*cmp == -2)
{
char *astr = eina_value_to_string(&atmp);
char *bstr = eina_value_to_string(&btmp);
}
*cmp = eina_model_compare(achild, bchild);
- if (eina_error_get())
+ if (*cmp == -2)
{
ERR("Could not compare children #%d %p (%s) and %p (%s) "
"from models %p (%s) and %p (%s)", i,
goto on_init_fail_lock_debug;
}
- EINA_ERROR_MODEL_FAILED = eina_error_msg_static_register(
- EINA_ERROR_MODEL_FAILED_STR);
- EINA_ERROR_MODEL_METHOD_MISSING = eina_error_msg_static_register(
- EINA_ERROR_MODEL_METHOD_MISSING_STR);
-
EINA_MODEL_TYPE_BASE = &_EINA_MODEL_TYPE_BASE;
EINA_MODEL_TYPE_MIXIN = &_EINA_MODEL_TYPE_MIXIN;
EINA_MODEL_TYPE_GENERIC = &_EINA_MODEL_TYPE_GENERIC;
#define EINA_MODEL_TYPE_CALL_OPTIONAL_RETURN(model, method, def_retval, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
DBG("Optional method" # method "() not implemented for model %p (%s)", \
#define EINA_MODEL_TYPE_CALL_OPTIONAL(model, method, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \
#define EINA_MODEL_TYPE_CALL_MANDATORY_RETURN(model, method, def_retval, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \
return def_retval; \
#define EINA_MODEL_TYPE_CALL_MANDATORY(model, method, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \
{ \
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
CRITICAL("Mandatory method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \
} \
#define EINA_MODEL_TYPE_CALL_RETURN(model, method, def_retval, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
return model->desc->ops.type.method(model, ## __VA_ARGS__); \
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
ERR("Method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \
return def_retval; \
#define EINA_MODEL_TYPE_CALL(model, method, ...) \
do \
{ \
- eina_error_set(0); \
if (model->desc->ops.type.method) \
model->desc->ops.type.method(model, ## __VA_ARGS__); \
else \
{ \
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING); \
ERR("Method" # method "() not implemented for model %p (%s)", \
model, model->desc->cache.types[0]->name); \
} \
ERR("Models %p (%s) and %p (%s) can't compare",
a, desc_a->cache.types[0]->name,
b, desc_b->cache.types[0]->name);
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
- return -1;
+ return -2;
}
else if ((desc_a->ops.type.compare) && (desc_b->ops.type.compare))
{
ERR("Could not compare models %p (%s) and %p (%s)",
a, desc_a->cache.types[0]->name,
b, desc_b->cache.types[0]->name);
- eina_error_set(EINA_ERROR_MODEL_FAILED);
- return -1;
+ return -2;
}
return cmp;
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.load)
{
ret = model->desc->ops.type.load(model);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method load() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.unload)
{
ret = model->desc->ops.type.unload(model);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method unload() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type), EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.property_set)
{
ret = model->desc->ops.type.property_set(model, name, value);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method property_set() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.property_del)
{
ret = model->desc->ops.type.property_del(model, name);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method property_del() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
EINA_MODEL_INSTANCE_CHECK_VAL(child, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.child_set)
{
ret = model->desc->ops.type.child_set(model, position, child);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method child_set() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.child_del)
{
ret = model->desc->ops.type.child_del(model, position);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method child_del() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
EINA_MODEL_INSTANCE_CHECK_VAL(model, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
- eina_error_set(0);
if (model->desc->ops.type.child_insert_at)
{
ret = model->desc->ops.type.child_insert_at(model, position, child);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method child_insert_at() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
if (position < 0)
return -1;
- eina_error_set(0);
if (model->desc->ops.type.child_insert_at)
{
ret = model->desc->ops.type.child_insert_at(model, position, child);
}
else
{
- eina_error_set(EINA_ERROR_MODEL_METHOD_MISSING);
ret = EINA_FALSE;
ERR("Method child_insert_at() not implemented for model %p (%s)",
model, model->desc->cache.types[0]->name);
* @{
*/
-/**
- * @var EINA_ERROR_MODEL_FAILED
- * Defined when model-specific errors happens.
- */
EAPI extern Eina_Error EINA_ERROR_MODEL_FAILED;
-
-/**
- * @var EINA_ERROR_MODEL_METHOD_MISSING
- * Defined when model-specific errors happens.
- */
EAPI extern Eina_Error EINA_ERROR_MODEL_METHOD_MISSING;
/**
#include "eina_config.h"
#include "eina_private.h"
#include "eina_alloca.h"
-#include "eina_error.h"
#include "eina_file.h"
#include "eina_log.h"
* @cond LOCAL
*/
-static const char EINA_ERROR_WRONG_MODULE_STR[] =
- "Wrong file format or no file module found";
-static const char EINA_ERROR_MODULE_INIT_FAILED_STR[] =
- "Module initialisation function failed";
-
EAPI Eina_Error EINA_ERROR_WRONG_MODULE = 0;
EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED = 0;
* This function sets up the module loader module of Eina. It is
* called by eina_init().
*
- * This function sets up the module module of Eina. It also registers
- * the errors #EINA_ERROR_WRONG_MODULE and #EINA_ERROR_MODULE_INIT_FAILED.
+ * This function sets up the module module of Eina.
*
* @see eina_init()
*/
EINA_LOG_ERR("Could not register log domain: eina_module");
return EINA_FALSE;
}
-
-#define EEMR(n) n = eina_error_msg_static_register(n ## _STR)
- EEMR(EINA_ERROR_WRONG_MODULE);
- EEMR(EINA_ERROR_MODULE_INIT_FAILED);
-#undef EEMR
-
return EINA_TRUE;
}
{
WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
- eina_error_set(EINA_ERROR_WRONG_MODULE);
return EINA_FALSE;
}
WRN("could not find eina's entry symbol %s inside module %s, or the init function failed",
EINA_MODULE_SYMBOL_INIT, m->file);
- eina_error_set(EINA_ERROR_MODULE_INIT_FAILED);
dlclose(dl_handle);
return EINA_FALSE;
ok:
loaded:
m->ref++;
DBG("ref %d", m->ref);
-
- eina_error_set(0);
return EINA_TRUE;
#else
(void) m;
*/
#define EINA_MODULE_SHUTDOWN(f) EAPI Eina_Module_Shutdown __eina_module_shutdown = &f
-/**
- * @var EINA_ERROR_WRONG_MODULE
- * Error identifier corresponding to a wrong module.
- */
extern EAPI Eina_Error EINA_ERROR_WRONG_MODULE;
-
-/**
- * @var EINA_ERROR_MODULE_INIT_FAILED
- * Error identifier corresponding to a failure during the initialisation of a module.
- */
extern EAPI Eina_Error EINA_ERROR_MODULE_INIT_FAILED;
/**
*
* This function load the shared file object passed in
* eina_module_new(). If it is a internal Eina module (like the
- * mempools), it also initialize it. It the shared file object can not
- * be loaded, the error #EINA_ERROR_WRONG_MODULE is set and
- * and #EINA_FALSE is returned. If it is a internal Eina module and the
- * module can not be initialized, the error #EINA_ERROR_MODULE_INIT_FAILED
- * is set and #EINA_FALSE is returned. If the module has already been loaded,
- * it's reference counter is increased by one and #EINA_TRUE is returned.
- * If @p module is @c NULL, the function returns immediately #EINA_FALSE.
+ * mempools), it also initialize it. If the shared file object can not
+ * be loaded, #EINA_FALSE is returned. If it is an internal Eina module and the
+ * module can not be initialized, #EINA_FALSE is returned. If the module has
+ * already been loaded, it's reference counter is increased by one and
+ * #EINA_TRUE is returned. If @p module is @c NULL, the function returns
+ * immediately #EINA_FALSE.
*
* When the symbols of the shared file objects are not needed
* anymore, call eina_module_unload() to unload the module.
{
Eina_Iterator_Rbtree_List *new;
- eina_error_set(0);
new = eina_trash_pop(&it->trash);
if (!new)
{
new = malloc(sizeof (Eina_Iterator_Rbtree_List));
- if (!new)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!new) return NULL;
}
new->tree = (Eina_Rbtree *)tree;
Eina_Iterator_Rbtree_List *first;
Eina_Iterator_Rbtree *it;
- eina_error_set(0);
it = calloc(1, sizeof (Eina_Iterator_Rbtree));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
eina_trash_init(&it->trash);
* NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator
* NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator
* NULL, this function still returns a valid iterator that will always
* return false on eina_iterator_next(), thus keeping API sane.
*
- * If the memory can not be allocated, @c NULL is returned
- * and #EINA_ERROR_OUT_OF_MEMORY is set. Otherwise, a valid iterator is
- * returned.
+ * If the memory can not be allocated, @c NULL is returned.
+ * Otherwise, a valid iterator is returned.
*
* @warning if the rbtree structure changes then the iterator becomes
* invalid! That is, if you add or remove nodes this iterator
Eina_Bool
eina_safety_checks_init(void)
{
- EINA_ERROR_SAFETY_FAILED = eina_error_msg_static_register(
- EINA_ERROR_SAFETY_FAILED_STR);
return EINA_TRUE;
}
* // all these files will emit warning from EINA_ARG_NONNULL()
* #include <Evas.h> // third party headers
* #include <Ecore.h>
- * #include <eina_error.h> // eina own header
*
* #include <eina_safety_checks.h>
* // all these files below will NOT emit warning from EINA_ARG_NONNULL(),
* options to @c configure script.
*
* Whenever these macros capture an error, EINA_LOG_ERR() will be
- * called and @c eina_error set to @c EINA_ERROR_SAFETY_FAILED and can
- * be checked with eina_error_get() after call.
- *
+ * called.
+ *
* @see EINA_SAFETY_ON_NULL_RETURN(), EINA_SAFETY_ON_NULL_RETURN_VAL()
* and other macros.
*
#include "eina_config.h"
#include "eina_error.h"
-/**
- * @var EINA_ERROR_SAFETY_FAILED
- * Error identifier corresponding to safety check failure.
- */
EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
#ifdef EINA_SAFETY_CHECKS
{ \
if (EINA_UNLIKELY((exp) == NULL)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
return; \
} \
{ \
if (EINA_UNLIKELY((exp) == NULL)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
return (val); \
} \
{ \
if (EINA_UNLIKELY((exp) == NULL)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " == NULL"); \
goto label; \
} \
{ \
if (EINA_UNLIKELY(exp)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
return; \
} \
{ \
if (EINA_UNLIKELY(exp)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
return val; \
} \
{ \
if (EINA_UNLIKELY(exp)) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is true"); \
goto label; \
} \
{ \
if (EINA_UNLIKELY(!(exp))) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
return; \
} \
{ \
if (EINA_UNLIKELY(!(exp))) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
return val; \
} \
{ \
if (EINA_UNLIKELY(!(exp))) \
{ \
- eina_error_set(EINA_ERROR_SAFETY_FAILED); \
EINA_LOG_ERR("%s", "safety check failed: " # exp " is false"); \
goto label; \
} \
#include "eina_private.h"
#include "eina_hash.h"
#include "eina_rbtree.h"
-#include "eina_error.h"
#include "eina_lock.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
const size_t head_size = offsetof(Eina_Share_Common_Head, builtin_node.str);
head = malloc(head_size + slen);
- if (!head)
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
-
return head;
}
const size_t node_size = offsetof(Eina_Share_Common_Node, str);
node = malloc(node_size + slen + null_size);
- if (!node)
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
-
return node;
}
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_free().
+ * returned. To free the resources, use eina_strbuf_free().
*
* @see eina_strbuf_free()
* @see eina_strbuf_append()
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_free().
+ * returned. To free the resources, use eina_strbuf_free().
*
* @see eina_strbuf_free()
* @see eina_strbuf_append()
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_free().
+ * returned. To free the resources, use eina_strbuf_free().
*
* @see eina_strbuf_manage_new()
* @since 1.2.0
#include "eina_private.h"
#include "eina_str.h"
#include "eina_magic.h"
-#include "eina_error.h"
#include "eina_safety_checks.h"
#include "eina_strbuf.h"
#include "eina_strbuf_common.h"
buf->size = EINA_STRBUF_INIT_SIZE;
buf->step = EINA_STRBUF_INIT_STEP;
- eina_error_set(0);
buf->buf = calloc(csize, buf->size);
- if (EINA_UNLIKELY(!buf->buf))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
-
+ if (EINA_UNLIKELY(!buf->buf)) return EINA_FALSE;
return EINA_TRUE;
}
/* reallocate the buffer to the new size */
buffer = realloc(buf->buf, new_size * csize);
- if (EINA_UNLIKELY(!buffer))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (EINA_UNLIKELY(!buffer)) return EINA_FALSE;
buf->buf = buffer;
buf->size = new_size;
buf->step = new_step;
- eina_error_set(0);
return EINA_TRUE;
}
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_common_free().
+ * returned. To free the resources, use eina_strbuf_common_free().
*
* @see eina_strbuf_common_free()
* @see eina_strbuf_common_append()
{
Eina_Strbuf *buf;
- eina_error_set(0);
buf = malloc(sizeof(Eina_Strbuf));
- if (EINA_UNLIKELY(!buf))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (EINA_UNLIKELY(!buf)) return NULL;
if (EINA_UNLIKELY(!_eina_strbuf_common_init(csize, buf)))
{
eina_strbuf_common_free(buf);
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_common_free().
+ * returned. To free the resources, use eina_strbuf_common_free().
*
* @see eina_strbuf_common_free()
* @see eina_strbuf_common_append()
{
Eina_Strbuf *buf;
- eina_error_set(0);
buf = malloc(sizeof(Eina_Strbuf));
- if (EINA_UNLIKELY(!buf))
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
- if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
+ if (EINA_UNLIKELY(!buf)) return NULL;
+ if (EINA_UNLIKELY(!_eina_strbuf_common_manage_init(csize, buf, str, len)))
{
eina_strbuf_common_free(buf);
return NULL;
#include "eina_config.h"
#include "eina_private.h"
#include "eina_alloca.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_lock.h"
#include "eina_share_common.h"
void *tmp;
tmp = realloc((void *)bucket->strings, size * sizeof(bucket->strings[0]));
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return 0;
- }
-
+ if (!tmp) return 0;
bucket->strings = tmp;
tmp = realloc(bucket->lengths, size * sizeof(bucket->lengths[0]));
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return 0;
- }
-
+ if (!tmp) return 0;
bucket->lengths = tmp;
tmp = realloc(bucket->references, size * sizeof(bucket->references[0]));
- if (!tmp)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return 0;
- }
-
+ if (!tmp) return 0;
bucket->references = tmp;
bucket->size = size;
if (!bucket)
{
*p_bucket = bucket = calloc(1, sizeof(*bucket));
- if (!bucket)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!bucket) return NULL;
}
if (bucket->count + 1 >= bucket->size)
}
snew = malloc(length + 1);
- if (!snew)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!snew) return NULL;
memcpy(snew, str, length);
snew[length] = '\0';
#include <stdlib.h>
#include "eina_config.h"
-#include "eina_error.h"
#include "eina_thread.h"
#include "eina_sched.h"
#ifdef _WIN32
#include "eina_safety_checks.h"
#include "eina_thread.h"
-EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED = 0;
-EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = 0;
-EAPI Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = 0;
-EAPI Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK = 0;
-EAPI Eina_Error EINA_ERROR_THREAD_JOIN_INVALID = 0;
-
-static const char EINA_ERROR_THREAD_CREATION_FAILED_STR[] = "Generic error creating thread";
-static const char EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR[] = "No resources to create thread";
-static const char EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR[] = "No permissions to create thread";
-static const char EINA_ERROR_THREAD_JOIN_DEADLOCK_STR[] = "Deadlock detected";
-static const char EINA_ERROR_THREAD_JOIN_INVALID_STR[] = "Invalid thread to join";
-
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
void *ret;
tw = _eina_thread_win32_find(t);
- if (!tw)
- {
- eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
- return NULL;
- }
+ if (!tw) return NULL;
WaitForSingleObject(tw->thread, INFINITE);
CloseHandle(tw->thread);
void *ret = NULL;
int err = pthread_join(t, &ret);
- if (err == 0)
- return ret;
- else if (err == EDEADLK)
- eina_error_set(EINA_ERROR_THREAD_JOIN_DEADLOCK);
- else
- eina_error_set(EINA_ERROR_THREAD_JOIN_INVALID);
-
+ if (err == 0) return ret;
return NULL;
}
err = pthread_create(t, &attr, func, data);
pthread_attr_destroy(&attr);
- if (err == 0)
- return EINA_TRUE;
- else if (err == EAGAIN)
- eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES);
- else if (err == EPERM)
- eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS);
- else
- eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED);
+ if (err == 0) return EINA_TRUE;
return EINA_FALSE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(t, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(func, EINA_FALSE);
- eina_error_set(0);
-
c = malloc(sizeof (Eina_Thread_Call));
- if (!c)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return EINA_FALSE;
- }
+ if (!c) return EINA_FALSE;
c->func = func;
c->data = data;
return EINA_TRUE;
free(c);
- if (eina_error_get() == 0)
- eina_error_set(EINA_ERROR_THREAD_CREATION_FAILED);
-
return EINA_FALSE;
}
EAPI void *
eina_thread_join(Eina_Thread t)
{
- eina_error_set(0);
return _eina_thread_join(t);
}
Eina_Bool
eina_thread_init(void)
{
- EINA_ERROR_THREAD_CREATION_FAILED = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_STR);
- EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES_STR);
- EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS = eina_error_msg_static_register(EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS_STR);
- EINA_ERROR_THREAD_JOIN_DEADLOCK = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_DEADLOCK_STR);
- EINA_ERROR_THREAD_JOIN_INVALID = eina_error_msg_static_register(EINA_ERROR_THREAD_JOIN_INVALID_STR);
-
return EINA_TRUE;
}
* @{
*/
-/**
- * @var EINA_ERROR_THREAD_CREATION_FAILED
- * Generic error happened and thread couldn't be created.
- * @since 1.8
- */
-EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED;
-
-/**
- * @var EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES
- * System lacked resources to create thread.
- * @since 1.8
- */
-EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_RESOURCES;
-
-/**
- * @var EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS
- * System lacked permissions to create thread.
- * @since 1.8
- */
-EAPI extern Eina_Error EINA_ERROR_THREAD_CREATION_FAILED_PERMISSIONS;
-
-/**
- * @var EINA_ERROR_THREAD_JOIN_DEADLOCK
- * The system has detected a deadlock situation where both threads
- * would wait each other. Or the thread wanted to wait for itself.
- * @since 1.8
- */
-EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_DEADLOCK;
-
-/**
- * @var EINA_ERROR_THREAD_JOIN_INVALID
- * One of the following happened:
- * @li thread is not a joinable.
- * @li thread does not exist.
- * @li another thread is already waiting for that thread.
- * @since 1.8
- */
-EAPI extern Eina_Error EINA_ERROR_THREAD_JOIN_INVALID;
-
-
typedef unsigned long int Eina_Thread;
typedef void *(*Eina_Thread_Cb)(void *data, Eina_Thread t);
#include "eina_config.h"
#include "eina_private.h"
#include "eina_tiler.h"
-#include "eina_error.h"
/*============================================================================*
* Local *
return NULL;
it = calloc(1, sizeof(*it));
- if (!it)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!it) return NULL;
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
#include "eina_config.h"
#include "eina_private.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_lock.h"
#include "eina_share_common.h"
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_ustrbuf_free().
+ * returned. To free the resources, use eina_ustrbuf_free().
*
* @see eina_ustrbuf_free()
* @see eina_ustrbuf_append()
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_strbuf_free().
+ * returned. To free the resources, use eina_strbuf_free().
*
* @see eina_ustrbuf_free()
* @see eina_ustrbuf_append()
* @return Newly allocated string buffer instance.
*
* This function creates a new string buffer. On error, @c NULL is
- * returned and Eina error is set to #EINA_ERROR_OUT_OF_MEMORY. To
- * free the resources, use eina_ustrbuf_free().
+ * returned. To free the resources, use eina_ustrbuf_free().
*
* @see eina_ustrbuf_manage_new()
* @since 1.2.0
#include "eina_config.h"
#include "eina_private.h"
#include "eina_alloca.h"
-#include "eina_error.h"
#include "eina_log.h"
#include "eina_strbuf.h"
#include "eina_mempool.h"
{
const unsigned char v = *(const unsigned char *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const unsigned short v = *(const unsigned short *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const unsigned int v = *(const unsigned int *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const unsigned long v = *(const unsigned long *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const uint64_t v = *(const uint64_t *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const signed char v = *(const signed char *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const short v = *(const short *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const int v = *(const int *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const long v = *(const long *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const int64_t v = *(const int64_t *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const float v = *(const float *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const double v = *(const double *)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
{
const char *v = *(const char **)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
*d = strdup(*s);
if (*d == NULL)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
}
{
char **tmem = mem;
const char *str = va_arg(args, const char *);
- eina_error_set(0);
+
if (str == *tmem) return EINA_TRUE;
if (!str)
{
char *tmp = strdup(str);
if (!tmp)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
free(*tmem);
{
char **tmem = mem;
const char * const *str = ptr;
- eina_error_set(0);
+
if (*str == *tmem) return EINA_TRUE;
if (!*str)
{
char *tmp = strdup(*str);
if (!tmp)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
free(*tmem);
if (!subtype->copy)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
if (eva_a->subtype != eva_b->subtype)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
subtype = eva_a->subtype;
if (!subtype->compare)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0;
}
if (!ret)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return EINA_TRUE;
const Eina_Value_Array *desc = ptr;
Eina_Inarray *desc_array;
- eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE;
if (!subtype->copy)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
if (eva_a->subtype != eva_b->subtype)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
subtype = eva_a->subtype;
if (!subtype->compare)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0;
}
if (!ret)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return EINA_TRUE;
Eina_Value_List *tmem = mem;
const Eina_Value_List *desc = ptr;
- eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE;
if (!s->subtype->copy)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
if (eva_a->subtype != eva_b->subtype)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
if (!eva_a->subtype->compare)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return 0;
}
if (!ret)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
return EINA_TRUE;
Eina_Value_Hash *tmem = mem;
const Eina_Value_Hash *desc = ptr;
- eina_error_set(0);
if ((!tmem->subtype) && (!desc->subtype))
return EINA_TRUE;
{
struct timeval v = _eina_value_type_timeval_fix(type_mem);
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_UCHAR)
{
unsigned char other_mem = v.tv_sec;
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
}
size_t minsize;
if (ta->ops != tb->ops)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
if ((ops) && (ops->compare))
{
const Eina_Value_Blob *tmem = type_mem;
- eina_error_set(0);
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING)
{
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
}
desc.memory = buf = malloc(desc.size);
if (!desc.memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
memcpy(buf, str, desc.size);
desc.memory = buf = malloc(desc.size);
if (!desc.memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
memcpy(buf, a->array->members, desc.size);
desc.memory = buf = malloc(desc.size);
if (!desc.memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
memcpy(buf, b->memory, desc.size);
desc.memory = buf = malloc(convert->value_size);
if (!desc.memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
if (!eina_value_type_pget(convert, convert_mem, buf))
Eina_Value_Blob *tmem = mem;
const Eina_Value_Blob *desc = ptr;
- eina_error_set(0);
if ((tmem->memory) && (tmem->memory == desc->memory))
{
tmem->ops = desc->ops;
d->memory = malloc(s->desc->size);
if (!d->memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
return 0;
else if (ta->desc != tb->desc)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
if (ta->desc->ops != tb->desc->ops)
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return -1;
}
if ((!ta->memory) && (!tb->memory))
{
const Eina_Value_Struct *tmem = type_mem;
- eina_error_set(0);
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING)
{
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
}
if (!_eina_value_type_struct_desc_check(desc->desc))
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
- eina_error_set(0);
if ((tmem->memory) && (tmem->memory == desc->memory))
{
tmem->desc = desc->desc;
if (!tmem->memory)
{
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
return EINA_FALSE;
}
{
const Eina_Model *v = *(const Eina_Model **)type_mem;
- eina_error_set(0);
-
if (convert == EINA_VALUE_TYPE_STRINGSHARE ||
convert == EINA_VALUE_TYPE_STRING)
{
}
else
{
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
Eina_Model **tmem = mem;
Eina_Model **p = (Eina_Model **)ptr;
- eina_error_set(0);
if (*tmem == *p) return EINA_TRUE;
if (*p) eina_model_ref(*p);
_eina_value_blob_operations_malloc_copy(const Eina_Value_Blob_Operations *ops EINA_UNUSED, const void *memory, size_t size)
{
void *ret = malloc(size);
- if (!ret)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!ret) return NULL;
memcpy(ret, memory, size);
return ret;
}
* @endcond
*/
-static const char EINA_ERROR_VALUE_FAILED_STR[] = "Value check failed.";
-
/**
*/
goto on_init_fail_hash;
}
- EINA_ERROR_VALUE_FAILED = eina_error_msg_static_register(
- EINA_ERROR_VALUE_FAILED_STR);
-
EINA_VALUE_TYPE_UCHAR = _EINA_VALUE_TYPE_BASICS + 0;
EINA_VALUE_TYPE_USHORT = _EINA_VALUE_TYPE_BASICS + 1;
EINA_VALUE_TYPE_UINT = _EINA_VALUE_TYPE_BASICS + 2;
eina_value_new(const Eina_Value_Type *type)
{
Eina_Value *value = eina_mempool_malloc(_eina_value_mp, sizeof(Eina_Value));
- if (!value)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!value) return NULL;
if (!eina_value_setup(value, type))
{
free(value);
*/
EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT;
-/**
- * @var EINA_ERROR_VALUE_FAILED
- * Error identifier corresponding to value check failure.
- *
- * @since 1.2
- */
-EAPI extern int EINA_ERROR_VALUE_FAILED;
+EAPI extern Eina_Error EINA_ERROR_VALUE_FAILED;
/**
* @defgroup Eina_Value_Value_Group Generic Value management
* eg. #EINA_VALUE_TYPE_ARRAY uses eina_value_array_set(),
* eina_value_array_get() and so on.
*
- * On failure, @c NULL is returned and either #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, @c NULL is returned.
*
* @note this calls creates from mempool and then uses
* eina_value_setup(). Consider using eina_value_flush() and
* @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first.
*
- * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, #EINA_FALSE is returned.
*
* @see eina_value_flush()
*
* Create a new generic value storage of type array. The members are
* managed using the description specified by @a subtype.
*
- * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, @c NULL is returned.
*
* @note this creates from mempool and then uses
* eina_value_array_setup(). @see eina_value_free() @see
* @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first.
*
- * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, #EINA_FALSE is returned.
*
* @see eina_value_flush()
*
* Create a new generic value storage of type list. The members are
* managed using the description specified by @a subtype.
*
- * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, @c NULL is returned.
*
* @note this creates from mempool and then uses
* eina_value_list_setup().
* @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first.
*
- * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, #EINA_FALSE is returned.
*
* @see eina_value_flush()
*
* Create a new generic value storage of type hash. The members are
* managed using the description specified by @a subtype.
*
- * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, @c NULL is returned.
*
* @note this creates from mempool and then uses
* eina_value_hash_setup().
* @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first.
*
- * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, #EINA_FALSE is returned.
*
* @see eina_value_flush()
*
* Create a new generic value storage of type struct. The members are
* managed using the description specified by @a desc.
*
- * On failure, @c NULL is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, @c NULL is returned.
*
* @note this creates from mempool and then uses
* eina_value_struct_setup().
* @note Existing contents are ignored! If the value was previously used, then
* use eina_value_flush() first.
*
- * On failure, #EINA_FALSE is returned and #EINA_ERROR_OUT_OF_MEMORY
- * or #EINA_ERROR_VALUE_FAILED is set.
+ * On failure, #EINA_FALSE is returned.
*
* @see eina_value_flush()
*
free(inner_val);
return ret;
}
-
- eina_error_set(EINA_ERROR_VALUE_FAILED);
return EINA_FALSE;
}
}
}
obj->grabs = eina_list_append(obj->grabs, g);
- if (eina_error_get())
- {
- MERR_BAD();
- evas_mem_free(sizeof(Eina_List));
- obj->grabs = eina_list_append(obj->grabs, g);
- if (eina_error_get())
- {
- MERR_FATAL();
- free(g->keyname);
- free(g);
- return NULL;
- }
- }
obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
- if (eina_error_get())
- {
- MERR_BAD();
- evas_mem_free(sizeof(Eina_List));
- obj->layer->evas->grabs = eina_list_append(obj->layer->evas->grabs, g);
- if (eina_error_get())
- {
- MERR_FATAL();
- obj->grabs = eina_list_remove(obj->grabs, g);
- free(g->keyname);
- free(g);
- return NULL;
- }
- }
return g;
}
#include "eina_config.h"
#include "eina_inlist.h"
-#include "eina_error.h"
#include "eina_module.h"
#include "eina_mempool.h"
#include "eina_trash.h"
Chained_Pool *p;
unsigned char *ptr;
- eina_error_set(0);
p = malloc(pool->alloc_size);
- if (!p)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- return NULL;
- }
+ if (!p) return NULL;
#ifdef EINA_DEBUG_MALLOC
{
if (!pool->base)
{
pool->base = malloc(pool->item_size * pool->max);
- if (!pool->base)
- {
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- goto retry_smaller;
- }
+ if (!pool->base) goto retry_smaller;
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(pool->base, pool->item_size * pool->max);
#endif
}
retry_smaller:
- eina_error_set(0);
mem = malloc(sizeof(Eina_Inlist) + pool->item_size);
- if (!mem)
- eina_error_set(EINA_ERROR_OUT_OF_MEMORY);
- else
+ if (mem)
{
pool->over++;
/* Only need to zero list elements and not the payload here */
if (!vstream) return NULL;
ev->video_streams = eina_list_append(ev->video_streams, vstream);
- if (eina_error_get())
- {
- free(vstream);
- return NULL;
- }
return vstream;
}
astream = calloc(1, sizeof(Emotion_Audio_Stream));
if (!astream) continue;
ev->audio_streams = eina_list_append(ev->audio_streams, astream);
- if (eina_error_get())
- {
- free(astream);
- continue;
- }
astream->length_time = length_time;
astream->channels = channels;
eina_barrier_wait(&barrier);
eina_thread_join(wk1);
- ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk2);
- ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk3);
- ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk4);
- ck_assert_int_eq(eina_error_get(), 0);
eina_thread_join(wk5);
- ck_assert_int_eq(eina_error_get(), 0);
eina_barrier_free(&barrier);
"safety check failed: name == NULL");
cnt = eina_counter_new(NULL);
fail_if(cnt);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_counter_free",
"safety check failed: counter == NULL");
eina_counter_free(NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_counter_start",
"safety check failed: counter == NULL");
eina_counter_start(NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_counter_stop",
"safety check failed: counter == NULL");
eina_counter_stop(NULL, 0);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
"safety check failed: counter == NULL");
dump = eina_counter_dump(NULL);
fail_if(dump);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL");
ea = eina_file_split(NULL);
fail_if(ea);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp));
fail_if(tmp2 != NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
}
TEST_MAGIC_SAFETY("eina_inlist_remove",
"safety check failed: item == NULL");
lst = eina_inlist_remove(lst, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_append",
"safety check failed: new_l == NULL");
lst = eina_inlist_append(lst, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_append_relative",
"safety check failed: new_l == NULL");
lst = eina_inlist_append_relative(lst, NULL, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_prepend",
"safety check failed: new_l == NULL");
lst = eina_inlist_prepend(lst, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_prepend_relative",
"safety check failed: new_l == NULL");
lst = eina_inlist_prepend_relative(lst, NULL, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_find",
"safety check failed: item == NULL");
lst = eina_inlist_find(lst, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_demote",
"safety check failed: list == NULL");
lst = eina_inlist_demote(NULL, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_demote",
"safety check failed: item == NULL");
lst = eina_inlist_demote((void*)1L, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
lst = NULL;
TEST_MAGIC_SAFETY("eina_inlist_promote",
"safety check failed: list == NULL");
lst = eina_inlist_promote(NULL, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_promote",
"safety check failed: item == NULL");
lst = eina_inlist_promote((void*)1L, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
lst = NULL;
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
"safety check failed: item == NULL");
lst = eina_inlist_sorted_insert(NULL, NULL, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
TEST_MAGIC_SAFETY("eina_inlist_sorted_insert",
"safety check failed: func == NULL");
lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
lst = NULL;
TEST_MAGIC_SAFETY("eina_magic_string_set",
"safety check failed: magic_name == NULL");
eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
fail_unless(ctx.did);
#ifdef SHOW_LOG
"safety check failed: magic_name == NULL");
eina_magic_string_set(EINA_MAGIC_TEST2, NULL);
fail_unless(ctx.did);
- fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED);
#endif
eina_magic_string_set(EINA_MAGIC_TEST2, EINA_MAGIC_STRING);