From 5512597c7d227638034ba8b4ab4c9732acf75110 Mon Sep 17 00:00:00 2001 From: barbieri Date: Mon, 15 Mar 2010 20:45:15 +0000 Subject: [PATCH] e_dbus/ofono: change bool to Eina_Bool MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit By: João Paulo Rechi Vita git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@47257 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/e_dbus_ofono_test.c | 2 +- src/lib/ofono/E_Ofono.h | 51 ++++++++-------- src/lib/ofono/e_ofono.c | 4 +- src/lib/ofono/e_ofono_element.c | 112 ++++++++++++++++++------------------ src/lib/ofono/e_ofono_manager.c | 6 +- src/lib/ofono/e_ofono_modem.c | 14 ++--- src/lib/ofono/e_ofono_network_reg.c | 16 +++--- src/lib/ofono/e_ofono_private.h | 14 ++--- 8 files changed, 109 insertions(+), 110 deletions(-) diff --git a/src/bin/e_dbus_ofono_test.c b/src/bin/e_dbus_ofono_test.c index d3773cd..97606ea 100644 --- a/src/bin/e_dbus_ofono_test.c +++ b/src/bin/e_dbus_ofono_test.c @@ -95,7 +95,7 @@ _on_cmd_get_all(char *cmd, char *args) E_Ofono_Element **elements; char *type; unsigned int count; - bool ret; + Eina_Bool ret; if (!args) type = NULL; diff --git a/src/lib/ofono/E_Ofono.h b/src/lib/ofono/E_Ofono.h index 5aab65d..edf5872 100644 --- a/src/lib/ofono/E_Ofono.h +++ b/src/lib/ofono/E_Ofono.h @@ -2,7 +2,6 @@ #define E_OFONO_H #include -#include #include #include @@ -70,28 +69,28 @@ extern "C" { /* Manager Methods */ EAPI E_Ofono_Element *e_ofono_manager_get(void) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_manager_modems_get(Eina_Array **array); + EAPI Eina_Bool e_ofono_manager_modems_get(Eina_Array **array); /* Modem Methods */ - EAPI bool e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_modem_name_get(const E_Ofono_Element *element, const char **name) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_modem_name_get(const E_Ofono_Element *element, const char **name) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; /* NetworkRegistration Methods */ - EAPI bool e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_netreg_strength_get(const E_Ofono_Element *element, char *strength) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_netreg_strength_get(const E_Ofono_Element *element, char *strength) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; /* Low-Level API: * * Should just be used to work around problems until proper solution * is made into e_ofono. */ - EAPI bool e_ofono_manager_sync_elements(void); + EAPI Eina_Bool e_ofono_manager_sync_elements(void); - EAPI bool e_ofono_elements_get_all(unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_elements_get_all_type(const char *type, unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_elements_get_all(unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_elements_get_all_type(const char *type, unsigned int *count, E_Ofono_Element ***p_elements) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; EAPI E_Ofono_Element *e_ofono_element_get(const char *path, const char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; EAPI void e_ofono_element_listener_add(E_Ofono_Element *element, void (*cb)(void *data, const E_Ofono_Element *element), const void *data, void (*free_data)(void *data)) EINA_ARG_NONNULL(1, 2); @@ -103,24 +102,24 @@ extern "C" { EAPI void e_ofono_element_print(FILE *fp, const E_Ofono_Element *element) EINA_ARG_NONNULL(1, 2); - EAPI bool e_ofono_element_properties_sync(E_Ofono_Element *element) EINA_ARG_NONNULL(1); - EAPI bool e_ofono_element_properties_sync_full(E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1); + EAPI Eina_Bool e_ofono_element_properties_sync(E_Ofono_Element *element) EINA_ARG_NONNULL(1); + EAPI Eina_Bool e_ofono_element_properties_sync_full(E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1); - EAPI bool e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int type, const void *value) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int type, const void *value) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; - EAPI void e_ofono_element_properties_list(const E_Ofono_Element *element, bool (*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) EINA_ARG_NONNULL(1, 2); + EAPI void e_ofono_element_properties_list(const E_Ofono_Element *element, Eina_Bool (*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) EINA_ARG_NONNULL(1, 2); - EAPI bool e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, const char *dict_name, const char *key_name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_property_get(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *name, int *type) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, const char *dict_name, const char *key_name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_property_get(const E_Ofono_Element *element, const char *name, int *type, void *value) EINA_ARG_NONNULL(1, 2, 4) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_is_manager(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_is_modem(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; - EAPI bool e_ofono_element_is_netreg(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_is_manager(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_is_modem(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; + EAPI Eina_Bool e_ofono_element_is_netreg(const E_Ofono_Element *element) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; #ifdef __cplusplus } diff --git a/src/lib/ofono/e_ofono.c b/src/lib/ofono/e_ofono.c index ba62cf3..de2f2aa 100644 --- a/src/lib/ofono/e_ofono.c +++ b/src/lib/ofono/e_ofono.c @@ -59,9 +59,9 @@ e_ofono_system_bus_name_get(void) * * This will not remove stale elements. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_manager_sync_elements(void) { E_Ofono_Element *manager; diff --git a/src/lib/ofono/e_ofono_element.c b/src/lib/ofono/e_ofono_element.c index 3c2f058..13ab991 100644 --- a/src/lib/ofono/e_ofono_element.c +++ b/src/lib/ofono/e_ofono_element.c @@ -43,7 +43,7 @@ struct _E_Ofono_Element_Property const char *name; int type; union { - bool boolean; + Eina_Bool boolean; const char *str; unsigned short u16; unsigned int u32; @@ -59,7 +59,7 @@ struct _E_Ofono_Element_Dict_Entry const char *name; int type; union { - bool boolean; + Eina_Bool boolean; const char *str; unsigned short u16; unsigned int u32; @@ -318,7 +318,7 @@ _e_ofono_element_dict_entry_new(DBusMessageIter *itr) switch (t) { case DBUS_TYPE_BOOLEAN: - entry->value.boolean = (bool)(long)value; + entry->value.boolean = (Eina_Bool)(long)value; break; case DBUS_TYPE_BYTE: entry->value.byte = (unsigned char)(long)value; @@ -479,7 +479,7 @@ _e_ofono_element_array_match(E_Ofono_Array *old, E_Ofono_Array *new, const char void *item_old, *item_new; Eina_List *l; void *data; - bool interfaces = 0; + Eina_Bool interfaces = 0; if (!old) return; @@ -523,7 +523,7 @@ _e_ofono_element_array_match(E_Ofono_Array *old, E_Ofono_Array *new, const char for(; i_new < eina_array_count_get(new->array); iter_new++, i_new++) { - bool found = 0; + Eina_Bool found = 0; item_new = *iter_new; if (!item_new) break; @@ -592,7 +592,7 @@ _e_ofono_element_array_match(E_Ofono_Array *old, E_Ofono_Array *new, const char } } -static bool +static Eina_Bool _e_ofono_element_property_update(E_Ofono_Element_Property *property, int type, void *data, E_Ofono_Element *element) { int changed = 0; @@ -614,9 +614,9 @@ _e_ofono_element_property_update(E_Ofono_Element_Property *property, int type, v switch (type) { case DBUS_TYPE_BOOLEAN: - if (changed || property->value.boolean != (bool)(long)data) + if (changed || property->value.boolean != (Eina_Bool)(long)data) { - property->value.boolean = (bool)(long)data; + property->value.boolean = (Eina_Bool)(long)data; changed = 1; } break; @@ -756,7 +756,7 @@ e_ofono_element_bytes_array_get_stringshared(const E_Ofono_Element *element, con return ret; } -bool +Eina_Bool e_ofono_element_objects_array_get_stringshared(const E_Ofono_Element *element, const char *property, unsigned int *count, E_Ofono_Element ***elements) { E_Ofono_Element **ret, **p; @@ -818,7 +818,7 @@ e_ofono_element_objects_array_get_stringshared(const E_Ofono_Element *element, c } /* strings are just pointers (references), no strdup or stringshare_add/ref */ -bool +Eina_Bool e_ofono_element_strings_array_get_stringshared(const E_Ofono_Element *element, const char *property, unsigned int *count, const char ***strings) { const char **ret, **p; @@ -1098,9 +1098,9 @@ e_ofono_element_unref(E_Ofono_Element *element) * If this call fails (returns 0), pending callbacks will not be called, * not even with error messages. * - * @return 1 on success, 0 on failure. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_message_send(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, DBusMessage *msg, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) { E_Ofono_Element_Call_Data *data; @@ -1159,7 +1159,7 @@ e_ofono_element_message_send(E_Ofono_Element *element, const char *method_name, } } -bool +Eina_Bool e_ofono_element_call_full(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) { DBusMessage *msg; @@ -1178,7 +1178,7 @@ e_ofono_element_call_full(E_Ofono_Element *element, const char *method_name, con (element, method_name, interface, cb, msg, pending, user_cb, user_data); } -static bool +static Eina_Bool _e_ofono_element_property_value_add(E_Ofono_Element *element, const char *name, int type, void *value) { E_Ofono_Element_Property *p; @@ -1377,9 +1377,9 @@ _e_ofono_element_get_properties_callback(void *user_data, DBusMessage *msg, DBus * @param cb function to call when server replies or some error happens. * @param data data to give to cb when it is called. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_sync_properties_full(E_Ofono_Element *element, E_DBus_Method_Return_Cb cb, const void *data) { const char name[] = "GetProperties"; @@ -1400,9 +1400,9 @@ e_ofono_element_sync_properties_full(E_Ofono_Element *element, E_DBus_Method_Ret * * @param element to call method on server. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_properties_sync(E_Ofono_Element *element) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -1425,9 +1425,9 @@ e_ofono_element_properties_sync(E_Ofono_Element *element) * @param cb function to call when server replies or some error happens. * @param data data to give to cb when it is called. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *prop, const char *key, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) { const char name[] = "SetProperty"; @@ -1502,9 +1502,9 @@ e_ofono_element_property_dict_set_full(E_Ofono_Element *element, const char *pro * @param cb function to call when server replies or some error happens. * @param data data to give to cb when it is called. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, int type, const void *value, E_DBus_Method_Return_Cb cb, const void *data) { const char name[] = "SetProperty"; @@ -1531,7 +1531,7 @@ e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, in dbus_message_iter_append_basic(&v, type, &value); else if (type == DBUS_TYPE_BOOLEAN) { - unsigned int b = *(char *)value; + unsigned int b = *(Eina_Bool *)value; dbus_message_iter_append_basic(&v, type, &b); } else @@ -1555,9 +1555,9 @@ e_ofono_element_property_set_full(E_Ofono_Element *element, const char *prop, in * @param value pointer to value, just like regular DBus, see * dbus_message_iter_append_basic(). * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int type, const void *value) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -1566,7 +1566,7 @@ e_ofono_element_property_set(E_Ofono_Element *element, const char *prop, int typ (element, prop, type, value, NULL, NULL); } -bool +Eina_Bool e_ofono_element_call_with_path(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) { DBusMessageIter itr; @@ -1591,7 +1591,7 @@ e_ofono_element_call_with_path(E_Ofono_Element *element, const char *method_name (element, method_name, NULL, cb, msg, pending, user_cb, user_data); } -bool +Eina_Bool e_ofono_element_call_with_string(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) { DBusMessageIter itr; @@ -1616,7 +1616,7 @@ e_ofono_element_call_with_string(E_Ofono_Element *element, const char *method_na (element, method_name, NULL, cb, msg, pending, user_cb, user_data); } -bool +Eina_Bool e_ofono_element_call_with_path_and_string(E_Ofono_Element *element, const char *method_name, const char *path, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) { DBusMessageIter itr; @@ -1653,9 +1653,9 @@ e_ofono_element_call_with_path_and_string(E_Ofono_Element *element, const char * * @param name property name, must be previously stringshared * @param type will contain the value type. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, const char *name, int *type) { const E_Ofono_Element_Property *p; @@ -1688,12 +1688,12 @@ e_ofono_element_property_type_get_stringshared(const E_Ofono_Element *element, c * @param name property name * @param type will contain the value type. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *name, int *type) { - bool ret; + Eina_Bool ret; name = eina_stringshare_add(name); ret = e_ofono_element_property_type_get_stringshared(element, name, type); eina_stringshare_del(name); @@ -1701,7 +1701,7 @@ e_ofono_element_property_type_get(const E_Ofono_Element *element, const char *na } void -e_ofono_element_list_properties(const E_Ofono_Element *element, bool (*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) +e_ofono_element_list_properties(const E_Ofono_Element *element, Eina_Bool (*cb)(void *data, const E_Ofono_Element *element, const char *name, int type, const void *value), const void *data) { const E_Ofono_Element_Property *p; @@ -1721,7 +1721,7 @@ e_ofono_element_list_properties(const E_Ofono_Element *element, bool (*cb)(void value = &p->value.path; break; case DBUS_TYPE_BOOLEAN: - value = (void *)p->value.boolean; + value = (void *)(unsigned long)p->value.boolean; break; case DBUS_TYPE_UINT16: value = &p->value.u16; @@ -1753,11 +1753,11 @@ e_ofono_element_list_properties(const E_Ofono_Element *element, bool (*cb)(void * @param key key inside dict, must be previously stringshared * @param type if provided it will contain the value type. * @param value where to store the property value, must be a pointer to the - * exact type, (bool *) for booleans, (char **) for strings, and so on. + * exact type, (Eina_Bool *) for booleans, (char **) for strings, and so on. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, const char *dict_name, const char *key, int *type, void *value) { const E_Ofono_Element_Property *p; @@ -1802,7 +1802,7 @@ e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, c switch (entry->type) { case DBUS_TYPE_BOOLEAN: - *(bool *)value = entry->value.boolean; + *(Eina_Bool *)value = entry->value.boolean; return 1; case DBUS_TYPE_BYTE: *(unsigned char *)value = entry->value.byte; @@ -1844,11 +1844,11 @@ e_ofono_element_property_dict_get_stringshared(const E_Ofono_Element *element, c * @param name property name, must be previously stringshared * @param type if provided it will contain the value type. * @param value where to store the property value, must be a pointer to the - * exact type, (bool *) for booleans, (char **) for strings, and so on. + * exact type, (Eina_Bool *) for booleans, (char **) for strings, and so on. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const char *name, int *type, void *value) { const E_Ofono_Element_Property *p; @@ -1867,7 +1867,7 @@ e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const switch (p->type) { case DBUS_TYPE_BOOLEAN: - *(bool *)value = p->value.boolean; + *(Eina_Bool *)value = p->value.boolean; return 1; case DBUS_TYPE_BYTE: *(unsigned char *)value = p->value.byte; @@ -1912,14 +1912,14 @@ e_ofono_element_property_get_stringshared(const E_Ofono_Element *element, const * @param name property name * @param type if provided it will contain the value type. * @param value where to store the property value, must be a pointer to the - * exact type, (bool *) for booleans, (char **) for strings, and so on. + * exact type, (Eina_Bool *) for booleans, (char **) for strings, and so on. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_element_property_get(const E_Ofono_Element *element, const char *name, int *type, void *value) { - bool ret; + Eina_Bool ret; name = eina_stringshare_add(name); ret = e_ofono_element_property_get_stringshared (element, name, type, value); @@ -1961,7 +1961,7 @@ e_ofono_elements_for_each(Eina_Hash_Foreach cb, const void *user_data) (elements, (Eina_Hash_Foreach) _e_ofono_elements_for_each, &data); } -static bool +static Eina_Bool _e_ofono_elements_get_allocate(unsigned int *count, E_Ofono_Element ***p_elements) { *count = eina_hash_population(elements); @@ -2006,9 +2006,9 @@ _e_ofono_elements_get_all(Eina_Hash *hash __UNUSED__, const char *key __UNUSED__ * @param p_elements array with all elements, these are not referenced * and in no particular order, just set if return is 1. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_elements_get_all(unsigned int *count, E_Ofono_Element ***p_elements) { E_Ofono_Element **p; @@ -2059,11 +2059,11 @@ _e_ofono_elements_get_all_type(Eina_Hash *hash __UNUSED__, const char *key __UNU * @param p_elements array with all elements, these are not referenced * and in no particular order, just set if return is 1. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. * * @see e_ofono_elements_get_all() */ -bool +Eina_Bool e_ofono_elements_get_all_type(const char *type, unsigned int *count, E_Ofono_Element ***p_elements) { struct e_ofono_elements_get_all_str_data data; @@ -2311,27 +2311,27 @@ e_ofono_elements_shutdown(void) elements = NULL; } -static inline bool +static inline Eina_Bool _e_ofono_element_is(const E_Ofono_Element *element, const char *interface) { return element->interface == interface; } -bool +Eina_Bool e_ofono_element_is_manager(const E_Ofono_Element *element) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); return _e_ofono_element_is(element, e_ofono_iface_manager); } -bool +Eina_Bool e_ofono_element_is_modem(const E_Ofono_Element *element) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); return _e_ofono_element_is(element, e_ofono_iface_modem); } -bool +Eina_Bool e_ofono_element_is_netreg(const E_Ofono_Element *element) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); diff --git a/src/lib/ofono/e_ofono_manager.c b/src/lib/ofono/e_ofono_manager.c index 225b338..794c9fe 100644 --- a/src/lib/ofono/e_ofono_manager.c +++ b/src/lib/ofono/e_ofono_manager.c @@ -23,14 +23,14 @@ e_ofono_manager_get(void) * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_manager_modems_get(Eina_Array **array) { E_Ofono_Element *element; E_Ofono_Array *a; - bool r; + Eina_Bool r; EINA_SAFETY_ON_NULL_RETURN_VAL(array, 0); diff --git a/src/lib/ofono/e_ofono_modem.c b/src/lib/ofono/e_ofono_modem.c index 0aaab1e..196f4f0 100644 --- a/src/lib/ofono/e_ofono_modem.c +++ b/src/lib/ofono/e_ofono_modem.c @@ -6,13 +6,13 @@ * Get property "Powered" value. * * @param powered where to store the property value, must be a pointer - * to bool (bool *), it will not be allocated or + * to Eina_Bool (Eina_Bool *), it will not be allocated or * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -30,9 +30,9 @@ e_ofono_modem_powered_get(const E_Ofono_Element *element, Eina_Bool *powered) * @param cb function to call when server replies or some error happens. * @param data data to give to cb when it is called. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Method_Return_Cb cb, const void *data) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -54,9 +54,9 @@ e_ofono_modem_powered_set(E_Ofono_Element *element, Eina_Bool powered, E_DBus_Me * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_modem_name_get(const E_Ofono_Element *element, const char **name) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); diff --git a/src/lib/ofono/e_ofono_network_reg.c b/src/lib/ofono/e_ofono_network_reg.c index 0187f38..31c7ead 100644 --- a/src/lib/ofono/e_ofono_network_reg.c +++ b/src/lib/ofono/e_ofono_network_reg.c @@ -12,9 +12,9 @@ * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -36,9 +36,9 @@ e_ofono_netreg_mode_get(const E_Ofono_Element *element, const char **mode) * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -60,9 +60,9 @@ e_ofono_netreg_status_get(const E_Ofono_Element *element, const char **status) * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); @@ -80,9 +80,9 @@ e_ofono_netreg_operator_get(const E_Ofono_Element *element, const char **op) * copied and references will be valid until element changes, * so copy it if you want to use it later. * - * @return 1 on success, 0 otherwise. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -bool +Eina_Bool e_ofono_netreg_strength_get(const E_Ofono_Element *element, char *strength) { EINA_SAFETY_ON_NULL_RETURN_VAL(element, 0); diff --git a/src/lib/ofono/e_ofono_private.h b/src/lib/ofono/e_ofono_private.h index 0cb0728..99f35d8 100644 --- a/src/lib/ofono/e_ofono_private.h +++ b/src/lib/ofono/e_ofono_private.h @@ -64,7 +64,7 @@ Eina_Array *array; }; - static inline bool + static inline Eina_Bool __dbus_callback_check_and_init(const char *file, int line, const char *function, DBusMessage *msg, DBusMessageIter *itr, DBusError *err) { if (!msg) @@ -98,7 +98,7 @@ __dbus_callback_check_and_init(__FILE__, __LINE__, __FUNCTION__, \ msg, itr, err) - static inline bool + static inline Eina_Bool __dbus_iter_type_check(const char *file, int line, const char *function, int type, int expected, const char *expected_name) { if (type == expected) @@ -124,9 +124,9 @@ E_Ofono_Element *e_ofono_element_register(const char *path, const char *interface); void e_ofono_element_unregister(E_Ofono_Element *element); - bool e_ofono_element_message_send(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, DBusMessage *msg, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); + Eina_Bool e_ofono_element_message_send(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, DBusMessage *msg, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); - bool e_ofono_element_call_full(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); - bool e_ofono_element_call_with_path(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); - bool e_ofono_element_call_with_string(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); -bool e_ofono_element_call_with_path_and_string(E_Ofono_Element *element, const char *method_name, const char *path, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); + Eina_Bool e_ofono_element_call_full(E_Ofono_Element *element, const char *method_name, const char *interface, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); + Eina_Bool e_ofono_element_call_with_path(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); + Eina_Bool e_ofono_element_call_with_string(E_Ofono_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); + Eina_Bool e_ofono_element_call_with_path_and_string(E_Ofono_Element *element, const char *method_name, const char *path, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data); -- 2.7.4