* @a remote_port will be set only if the remote application sends a message with its port information using message_port_send_message_with_local_port(), otherwise it is @c NULL @n
* When message is sent from remote application by message_port_send_message_with_local_port() in bidirectional communication, trusted_remote_port is used to check whether remote port is trusted port or not
* This callback is called only in the main thread.
- * @param[in] local_port_id The local message port ID returned by message_port_register_local_port()
- * @param[in] remote_app_id The ID of the remote application that sent this message
+ * @param[in] local_port_id The local message port ID returned by message_port_register_local_port()
+ * @param[in] remote_app_id The ID of the remote application that sent this message
* @param[in] remote_port The name of the remote message port
* @param[in] trusted_remote_port If @c true, the remote port is a trusted port; otherwise if @c false, it is not
* @param[in] message The message passed from the remote application
* @a remote_port will be set only if the remote application sends a message with its port information using message_port_send_trusted_message_with_local_port(), otherwise it is @c NULL. @n
* When message is sent from remote application by message_port_send_trusted_message_with_local_port() in bidirectional communication, trusted_remote_port is used to check whether remote port is trusted port or not.
* This callback is called only in the main thread.
- * @param[in] trusted_local_port_id The message port ID returned by message_port_register_trusted_local_port()
- * @param[in] remote_app_id The ID of the remote application that sent this message
+ * @param[in] trusted_local_port_id The message port ID returned by message_port_register_trusted_local_port()
+ * @param[in] remote_app_id The ID of the remote application that sent this message
* @param[in] remote_port The name of the remote message port
* @param[in] trusted_remote_port If @c true, the remote port is a trusted port; otherwise if @c false, it is not
* @param[in] message The message passed from the remote application
- * @param[in] user_data The user data passed from the register function
+ * @param[in] user_data The user data passed from the register function
* @pre Either message_port_send_trusted_message() or message_port_send_trusted_message_with_local_port() from the remote application will invoke this function if you register it using message_port_register_trusted_local_port().
* @see message_port_register_trusted_local_port()
* @see message_port_unregister_trusted_local_port()
/**
* @brief Registers the local message port.
* @details If the message port name is already registered, the previous local message port ID returns and the callback function is changed. \n
- * Multiple message ports can be registered.
+ * Multiple message ports can be registered.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks The specified callback is called only in the main thread.
* @param[in] local_port The name of the local message port
* @param[in] callback The callback function to be called when a message is received
- * @param[in] user_data The user data to be passed to the callback function
+ * @param[in] user_data The user data to be passed to the callback function
* @return A local message port ID on success,
* otherwise a negative error value
* @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a local_port or @a callback is NULL
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
+ * @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
* @see message_port_unregister_local_port()
*/
-EXPORT_API int message_port_register_local_port(const char *local_port, message_port_message_cb callback, void *user_data);
+int message_port_register_local_port(const char *local_port, message_port_message_cb callback, void *user_data);
/**
* @remarks The specified callback is called only in the main thread.
* @param[in] trusted_local_port The name of the trusted local message port
* @param[in] callback The callback function to be called when a trusted message is received
- * @param[in] user_data The user data to be passed to the callback function
+ * @param[in] user_data The user data to be passed to the callback function
* @return A trusted local message port ID on success,
* otherwise a negative error value
* @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a trusted_local_port or @a callback is NULL
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
+ * @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
* @see message_port_unregister_trusted_local_port()
*/
-EXPORT_API int message_port_register_trusted_local_port(const char *trusted_local_port, message_port_trusted_message_cb callback, void *user_data);
+int message_port_register_trusted_local_port(const char *trusted_local_port, message_port_trusted_message_cb callback, void *user_data);
/**
* @brief Unregisters the local message port.
* @details This method unregisters the callback function with the specified local port ID.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] local_port_id The local message port ID
+ * @param[in] local_port_id The local message port ID
* @return @c 0 on success,
* otherwise a negative error value
- * @retval #MESSAGE_PORT_ERROR_NONE Successful
+ * @retval #MESSAGE_PORT_ERROR_NONE Successful
* @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a local_port_id is not positive
* @retval #MESSAGE_PORT_ERROR_PORT_NOT_FOUND The specified @a local_port_id cannot be found
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
+ * @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
* @see message_port_register_local_port()
*/
-EXPORT_API int message_port_unregister_local_port(int local_port_id);
+int message_port_unregister_local_port(int local_port_id);
/**
- * @brief Registers the trusted local message port.
+ * @brief Unregisters the trusted local message port.
* @details This method unregisters the callback function with the specified local port ID. @n
* It allows communications only if the applications are signed with the same certificate, which is uniquely assigned to the developer.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @param[in] trusted_local_port_id The trusted local message port ID
+ * @param[in] trusted_local_port_id The trusted local message port ID
* @return @c 0 on success,
* otherwise a negative error value
* @retval #MESSAGE_PORT_ERROR_NONE Successful
* @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
* @see message_port_register_trusted_local_port()
*/
-EXPORT_API int message_port_unregister_trusted_local_port(int trusted_local_port_id);
+int message_port_unregister_trusted_local_port(int trusted_local_port_id);
/**
* otherwise @c false
* @return @c 0 on success,
* otherwise a negative error value
- * @retval #MESSAGE_PORT_ERROR_NONE Successful
+ * @retval #MESSAGE_PORT_ERROR_NONE Successful
* @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a remote_app_id or @a remote_port is NULL
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
*/
-EXPORT_API int message_port_check_remote_port(const char *remote_app_id, const char *remote_port, bool *exist);
+int message_port_check_remote_port(const char *remote_app_id, const char *remote_port, bool *exist);
/**
* @brief Checks whether the trusted message port of a remote application is registered.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @remarks If this function returns a negative error value, the out parameter @a exist will not be changed.
+ * @remarks If this function returns a negative error value, the out parameter @a exist will not be changed.
* @param[in] remote_app_id The ID of the remote application
* @param[in] remote_port The name of the remote message port
* @param[out] exist If @c true, the message port of the remote application exists;
* @retval #MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH The remote application is not signed with the same certificate
* @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
*/
-EXPORT_API int message_port_check_trusted_remote_port(const char *remote_app_id, const char *remote_port, bool *exist);
+int message_port_check_trusted_remote_port(const char *remote_app_id, const char *remote_port, bool *exist);
/**
* bundle_free(b);
* @endcode
*/
-EXPORT_API int message_port_send_message(const char *remote_app_id, const char *remote_port, bundle *message);
+int message_port_send_message(const char *remote_app_id, const char *remote_port, bundle *message);
/**
* @see message_port_register_trusted_local_port()
* @see message_port_unregister_trusted_local_port()
*/
-EXPORT_API int message_port_send_trusted_message(const char *remote_app_id, const char *remote_port, bundle *message);
+int message_port_send_trusted_message(const char *remote_app_id, const char *remote_port, bundle *message);
/**
* }
* @endcode
*/
-EXPORT_API int message_port_send_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id);
+int message_port_send_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id);
/**
* @param[in] remote_app_id The ID of the remote application
* @param[in] remote_port The name of the remote message port
* @param[in] message The message to be passed to the remote application, the recommended message size is under 4KB
- * @param[in] local_port_id The message port ID returned by message_port_register_local_port() or message_port_register_trusted_local_port()
+ * @param[in] local_port_id The message port ID returned by message_port_register_local_port() or message_port_register_trusted_local_port()
* @return @c 0 on success,
* otherwise a negative error value
- * @retval #MESSAGE_PORT_ERROR_NONE Successful
+ * @retval #MESSAGE_PORT_ERROR_NONE Successful
* @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a remote_app_id, @a remote_port or @a message is @c NULL and
* specified @a local_port_id is not positive
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
* @see message_port_register_trusted_local_port()
* @see message_port_unregister_trusted_local_port()
*/
-EXPORT_API int message_port_send_trusted_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id);
+int message_port_send_trusted_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id);
/**
* @see message_port_add_unregistered_cb()
* @see message_port_remove_registration_event_cb()
*/
-EXPORT_API int message_port_add_registered_cb(const char *remote_app_id,
- const char *remote_port,
- bool trusted_remote_port,
- message_port_registration_event_cb registered_cb,
- void *user_data,
- int *watcher_id);
+int message_port_add_registered_cb(const char *remote_app_id,
+ const char *remote_port,
+ bool trusted_remote_port,
+ message_port_registration_event_cb registered_cb,
+ void *user_data,
+ int *watcher_id);
/**
* @brief Adds a callback called when a remote port is unregistered.
* @details When the remote port is unregistered, @a unregistered_cb function is called.
* Each added callback has its own separate watcher.
- * @remarks The specified callback is called only in the main thread.
* @since_tizen 4.0
+ * @remarks The specified callback is called only in the main thread.
* @param[in] remote_app_id The ID of the remote application
* @param[in] remote_port The name of the remote message port
* @param[in] trusted_remote_port Indicates whether remote port is trusted
* unregistration events
* @return @c 0 on success,
* otherwise a negative error value
- * @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a remote_app_id or @a remote_port
+ * @retval #MESSAGE_PORT_ERROR_INVALID_PARAMETER The specified @a remote_app_id or @a remote_port
* or @a unregistered_cb is NULL
* @retval #MESSAGE_PORT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MESSAGE_PORT_ERROR_IO_ERROR Internal I/O error
* @see message_port_add_registered_cb()
* @see message_port_remove_registration_event_cb()
*/
-EXPORT_API int message_port_add_unregistered_cb(const char *remote_app_id,
- const char *remote_port,
- bool trusted_remote_port,
- message_port_registration_event_cb unregistered_cb,
- void *user_data,
- int *watcher_id);
+int message_port_add_unregistered_cb(const char *remote_app_id,
+ const char *remote_port,
+ bool trusted_remote_port,
+ message_port_registration_event_cb unregistered_cb,
+ void *user_data,
+ int *watcher_id);
/**
* @see message_port_add_registered_cb()
* @see message_port_add_unregistered_cb()
*/
-EXPORT_API int message_port_remove_registration_event_cb(int watcher_id);
+int message_port_remove_registration_event_cb(int watcher_id);
#include "message_port_log.h"
#include "message_port.h"
-int message_port_register_local_port(const char *local_port, message_port_message_cb callback, void *user_data)
+EXPORT_API int message_port_register_local_port(const char *local_port, message_port_message_cb callback, void *user_data)
{
int local_port_id;
return local_port_id;
}
-int message_port_register_trusted_local_port(const char *local_port, message_port_trusted_message_cb callback, void *user_data)
+EXPORT_API int message_port_register_trusted_local_port(const char *local_port, message_port_trusted_message_cb callback, void *user_data)
{
int trusted_local_port_id;
return trusted_local_port_id;
}
-int message_port_unregister_local_port(int local_port_id)
+EXPORT_API int message_port_unregister_local_port(int local_port_id)
{
int res;
return res;
}
-int message_port_unregister_trusted_local_port(int trusted_local_port_id)
+EXPORT_API int message_port_unregister_trusted_local_port(int trusted_local_port_id)
{
int res;
return res;
}
-int message_port_check_remote_port(const char *remote_app_id, const char *remote_port, bool *exist)
+EXPORT_API int message_port_check_remote_port(const char *remote_app_id, const char *remote_port, bool *exist)
{
int ret;
return ret;
}
-int message_port_check_trusted_remote_port(const char *remote_app_id, const char *remote_port, bool *exist)
+EXPORT_API int message_port_check_trusted_remote_port(const char *remote_app_id, const char *remote_port, bool *exist)
{
int ret;
return ret;
}
-int message_port_send_message(const char *remote_app_id, const char *remote_port, bundle *message)
+EXPORT_API int message_port_send_message(const char *remote_app_id, const char *remote_port, bundle *message)
{
int ret;
return ret;
}
-int message_port_send_trusted_message(const char *remote_app_id, const char *remote_port, bundle *message)
+EXPORT_API int message_port_send_trusted_message(const char *remote_app_id, const char *remote_port, bundle *message)
{
int ret;
return ret;
}
-int message_port_send_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id)
+EXPORT_API int message_port_send_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id)
{
int ret;
return ret;
}
-int message_port_send_trusted_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id)
+EXPORT_API int message_port_send_trusted_message_with_local_port(const char *remote_app_id, const char *remote_port, bundle *message, int local_port_id)
{
int ret;
return ret;
}
-int message_port_add_registered_cb(const char *remote_app_id, const char *remote_port, bool is_trusted, message_port_registration_event_cb registered_cb, void *user_data, int *watcher_id)
+EXPORT_API int message_port_add_registered_cb(const char *remote_app_id, const char *remote_port, bool is_trusted, message_port_registration_event_cb registered_cb, void *user_data, int *watcher_id)
{
int ret;
return ret;
}
-int message_port_add_unregistered_cb(const char *remote_app_id, const char *remote_port, bool is_trusted, message_port_registration_event_cb unregistered_cb, void *user_data, int *watcher_id)
+EXPORT_API int message_port_add_unregistered_cb(const char *remote_app_id, const char *remote_port, bool is_trusted, message_port_registration_event_cb unregistered_cb, void *user_data, int *watcher_id)
{
int ret;
return ret;
}
-int message_port_remove_registration_event_cb(int watcher_id)
+EXPORT_API int message_port_remove_registration_event_cb(int watcher_id)
{
int ret = MESSAGE_PORT_ERROR_NONE;
if (watcher_id < 1) {