edbus: Add EINA_ARG_NONNULL and EINA_WARN_UNUSED_RESULT to API
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>
Tue, 11 Dec 2012 19:49:33 +0000 (19:49 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Tue, 11 Dec 2012 19:49:33 +0000 (19:49 +0000)
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80681

src/lib/edbus_freedesktop.h
src/lib/edbus_message_eina_value.h
src/lib/edbus_message_helper.h
src/lib/edbus_proxy.h
src/lib/edbus_service.h
src/lib/edbus_signal_handler.h

index ff0a780..9a89337 100644 (file)
 #define EDBUS_NAME_REQUEST_REPLY_EXISTS           3 /**< Service is already in the queue */
 #define EDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER    4 /**< Service is already the primary owner */
 
-EAPI EDBus_Pending *edbus_name_request(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data);
+EAPI EDBus_Pending *edbus_name_request(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
 
 /* Replies to releasing a name */
 #define EDBUS_NAME_RELEASE_REPLY_RELEASED     1    /**< Service was released from the given name */
 #define EDBUS_NAME_RELEASE_REPLY_NON_EXISTENT 2    /**< The given name does not exist on the bus */
 #define EDBUS_NAME_RELEASE_REPLY_NOT_OWNER    3    /**< Service is not an owner of the given name */
 
-EAPI EDBus_Pending *edbus_name_release(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data);
-EAPI EDBus_Pending *edbus_name_owner_get(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data);
+EAPI EDBus_Pending *edbus_name_release(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
+EAPI EDBus_Pending *edbus_name_owner_get(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
 EAPI EDBus_Pending *edbus_name_owner_has(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data);
-EAPI EDBus_Pending *edbus_names_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data);
-EAPI EDBus_Pending *edbus_names_activatable_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data);
+EAPI EDBus_Pending *edbus_names_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
+EAPI EDBus_Pending *edbus_names_activatable_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
 
 /* Replies to service starts */
 #define EDBUS_NAME_START_REPLY_SUCCESS         1 /**< Service was auto started */
 #define EDBUS_NAME_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
 
-EAPI EDBus_Pending        *edbus_name_start(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data);
+EAPI EDBus_Pending        *edbus_name_start(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
 
 typedef void (*EDBus_Name_Owner_Changed_Cb)(void *data, const char *bus, const char *old_id, const char *new_id);
 
@@ -52,7 +52,7 @@ typedef void (*EDBus_Name_Owner_Changed_Cb)(void *data, const char *bus, const c
  * @param cb_data context data
  * @param allow_initial_call allow call callback with actual id of the bus
  */
-EAPI void                  edbus_name_owner_changed_callback_add(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call);
+EAPI void                  edbus_name_owner_changed_callback_add(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call) EINA_ARG_NONNULL(1, 2, 3);
 /**
  * Remove callback added with edbus_name_owner_changed_callback_add().
  *
@@ -61,14 +61,14 @@ EAPI void                  edbus_name_owner_changed_callback_add(EDBus_Connectio
  * @param cb callback
  * @param cb_data context data
  */
-EAPI void                  edbus_name_owner_changed_callback_del(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data);
+EAPI void                  edbus_name_owner_changed_callback_del(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2, 3);
 
 /**
  * @defgroup EDBus_FDO_Peer org.freedesktop.DBus.Peer
  *
  * @{
  */
-EAPI EDBus_Pending        *edbus_object_peer_ping(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1);
+EAPI EDBus_Pending        *edbus_object_peer_ping(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
 EAPI EDBus_Pending        *edbus_object_peer_machine_id_get(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
 /**
  * @}
@@ -97,7 +97,7 @@ EAPI EDBus_Pending        *edbus_object_introspect(EDBus_Object *obj, EDBus_Mess
  *
  * @note After enable, it will asynchrony get the properties values.
  */
-EAPI void edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable);
+EAPI void edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable) EINA_ARG_NONNULL(1);
 
 EAPI EDBus_Pending        *edbus_proxy_property_get(EDBus_Proxy *proxy, const char *name, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
 EAPI EDBus_Pending        *edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, char type, const void *value, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 4);
index ba11028..1875166 100644 (file)
@@ -10,7 +10,7 @@
  * @param msg Message
  * @return Eina_Value of type Eina_Value_Type_Struct
  */
-EAPI Eina_Value *edbus_message_to_eina_value(const EDBus_Message *msg);
+EAPI Eina_Value *edbus_message_to_eina_value(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
 
 /**
  * Convert Eina_Value to EDBus_Message
@@ -20,7 +20,7 @@ EAPI Eina_Value *edbus_message_to_eina_value(const EDBus_Message *msg);
  * @param value source of data, must be of type Eina_Value_Type_Struct
  * @return success or not
  */
-EAPI Eina_Bool edbus_message_from_eina_value(const char *signature, EDBus_Message *msg, const Eina_Value *value);
+EAPI Eina_Bool edbus_message_from_eina_value(const char *signature, EDBus_Message *msg, const Eina_Value *value) EINA_ARG_NONNULL(1, 2, 3);
 
 /**
  * @}
index 932e70a..a3a2455 100644 (file)
@@ -15,7 +15,7 @@ typedef void (*EDBus_Dict_Cb_Get)(void *data, const void *key, EDBus_Message_Ite
  * @param cb callback that will be called in each entry
  * @param data context data
  */
-EAPI void edbus_message_iter_dict_iterate(EDBus_Message_Iter *dict, const char *signature, EDBus_Dict_Cb_Get cb, const void *data);
+EAPI void edbus_message_iter_dict_iterate(EDBus_Message_Iter *dict, const char *signature, EDBus_Dict_Cb_Get cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
 
 /**
  * @}
index 86732b8..3f00015 100644 (file)
@@ -40,7 +40,7 @@ EAPI void                  edbus_proxy_cb_free_del(EDBus_Proxy *proxy, EDBus_Fre
 /**
  * @brief Constructs a new message to invoke a method on a remote interface.
  */
-EAPI EDBus_Message        *edbus_proxy_method_call_new(EDBus_Proxy *proxy, const char *member);
+EAPI EDBus_Message        *edbus_proxy_method_call_new(EDBus_Proxy *proxy, const char *member) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
 
 /**
  * @brief Send a message.
index 79ae61c..f2ec38e 100644 (file)
@@ -105,21 +105,21 @@ typedef struct _EDBus_Service_Interface_Desc
  *
  * @return Interface
  */
-EAPI EDBus_Service_Interface *edbus_service_interface_register(EDBus_Connection *conn, const char *path, const EDBus_Service_Interface_Desc *desc);
+EAPI EDBus_Service_Interface *edbus_service_interface_register(EDBus_Connection *conn, const char *path, const EDBus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3);
 
 /**
  * @brief Unregister a interface.
  * If this is the last interface of the object path, the object path will be
  * removed too.
  */
-EAPI void edbus_service_interface_unregister(EDBus_Service_Interface *iface);
+EAPI void edbus_service_interface_unregister(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
 /**
  * @brief Unregister all interfaces of the object path that this interface belongs
  * and the object path.
  */
-EAPI void edbus_service_object_unregister(EDBus_Service_Interface *iface);
-EAPI EDBus_Connection *edbus_service_connection_get(const EDBus_Service_Interface *iface);
-EAPI const char *edbus_service_object_path_get(const EDBus_Service_Interface *iface);
+EAPI void edbus_service_object_unregister(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
+EAPI EDBus_Connection *edbus_service_connection_get(const EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
+EAPI const char *edbus_service_object_path_get(const EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
 
 /**
  * @brief Emit a signal handler of the interface with non-complex types.
@@ -140,7 +140,7 @@ EAPI Eina_Bool edbus_service_signal_emit(EDBus_Service_Interface *iface, unsigne
  * @param iface interface of the signal
  * @param signal_id id of signal
  */
-EAPI EDBus_Message *edbus_service_signal_new(EDBus_Service_Interface *iface, unsigned int signal_id) EINA_ARG_NONNULL(1);
+EAPI EDBus_Message *edbus_service_signal_new(EDBus_Service_Interface *iface, unsigned int signal_id) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
 /**
  * @brief Send a signal message.
  */
@@ -154,7 +154,7 @@ EAPI Eina_Bool edbus_service_signal_send(EDBus_Service_Interface *iface, EDBus_M
  * @param key to identify data
  * @param data
  */
-EAPI void edbus_service_object_data_set(EDBus_Service_Interface *iface, const char *key, const void *data);
+EAPI void edbus_service_object_data_set(EDBus_Service_Interface *iface, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
 /**
  * @brief Get data stored in object path.
  *
@@ -163,7 +163,7 @@ EAPI void edbus_service_object_data_set(EDBus_Service_Interface *iface, const ch
  *
  * @return pointer to data if found otherwise NULL
  */
-EAPI void *edbus_service_object_data_get(const EDBus_Service_Interface *iface, const char *key);
+EAPI void *edbus_service_object_data_get(const EDBus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
 /**
  * @brief Del data stored in object path.
  *
@@ -172,16 +172,16 @@ EAPI void *edbus_service_object_data_get(const EDBus_Service_Interface *iface, c
  *
  * @return pointer to data if found otherwise NULL
  */
-EAPI void *edbus_service_object_data_del(EDBus_Service_Interface *iface, const char *key);
+EAPI void *edbus_service_object_data_del(EDBus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2);
 
 /**
  * Add property to changed list. *
  * A PropertiesChanged signal will be send on next idler iteration with all
  * properties in changed list.
  */
-EAPI Eina_Bool edbus_service_property_changed(EDBus_Service_Interface *iface, const char *name);
+EAPI Eina_Bool edbus_service_property_changed(EDBus_Service_Interface *iface, const char *name) EINA_ARG_NONNULL(1, 2);
 
-EAPI Eina_Bool edbus_service_property_invalidate_set(EDBus_Service_Interface *iface, const char *name, Eina_Bool is_invalidate);
+EAPI Eina_Bool edbus_service_property_invalidate_set(EDBus_Service_Interface *iface, const char *name, Eina_Bool is_invalidate) EINA_ARG_NONNULL(1, 2);
 
 /**
  * Attach ObjectManager interface.
@@ -189,7 +189,7 @@ EAPI Eina_Bool edbus_service_property_invalidate_set(EDBus_Service_Interface *if
  * @param iface ObjectManager will be attach in object path of this interface.
  * @return EINA_TRUE if success
  */
-EAPI Eina_Bool edbus_service_object_manager_attach(EDBus_Service_Interface *iface);
+EAPI Eina_Bool edbus_service_object_manager_attach(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
 
 /**
  * Detach ObjectManager interface.
@@ -197,7 +197,7 @@ EAPI Eina_Bool edbus_service_object_manager_attach(EDBus_Service_Interface *ifac
  * @param iface ObjectManager of object path of this interface will be detach.
  * @return EINA_TRUE if success
  */
-EAPI Eina_Bool edbus_service_object_manager_detach(EDBus_Service_Interface *iface);
+EAPI Eina_Bool edbus_service_object_manager_detach(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
 /**
  * @}
  */
index 8be91be..6798383 100644 (file)
@@ -67,7 +67,7 @@ EAPI Eina_Bool             edbus_signal_handler_match_extra_set(EDBus_Signal_Han
  * @note To information:
  * http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
  */
-EAPI Eina_Bool             edbus_signal_handler_match_extra_vset(EDBus_Signal_Handler *sh, va_list ap);
+EAPI Eina_Bool             edbus_signal_handler_match_extra_vset(EDBus_Signal_Handler *sh, va_list ap) EINA_ARG_NONNULL(1);
 
 /**
  * @brief Add a callback function to be called when signal handler will be freed.