#ifndef __APPFW_MESSAGE_PORT_H__
#define __APPFW_MESSAGE_PORT_H__
+#ifdef __GNUC__
+# define EXPORT_API __attribute__((visibility("default")))
+#else
+# define EXPORT_API
+#endif
+
#include <bundle.h>
#ifdef __cplusplus
* @retval #MESSAGEPORT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_register_local_port(const char* local_port, messageport_message_cb callback);
+EXPORT_API int messageport_register_local_port(const char* local_port, messageport_message_cb callback);
/**
* @brief Registers the trusted local message port. @n
* @retval #MESSAGEPORT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_register_trusted_local_port(const char* local_port, messageport_message_cb callback);
+EXPORT_API int messageport_register_trusted_local_port(const char* local_port, messageport_message_cb callback);
/**
* @brief Checks if the message port of a remote application is registered.
* @retval #MESSAGEPORT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_check_remote_port(const char* remote_app_id, const char *remote_port, bool* exist);
+EXPORT_API int messageport_check_remote_port(const char* remote_app_id, const char *remote_port, bool* exist);
/**
* @brief Checks if the trusted message port of a remote application is registered.
* @retval #MESSAGEPORT_ERROR_CERTIFICATE_NOT_MATCH The remote application is not signed with the same certificate
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_check_trusted_remote_port(const char* remote_app_id, const char *remote_port, bool* exist);
+EXPORT_API int messageport_check_trusted_remote_port(const char* remote_app_id, const char *remote_port, bool* exist);
/**
* @brief Sends a message to the message port of a remote application.
* bundle_free(b);
* @endcode
*/
-int messageport_send_message(const char* remote_app_id, const char* remote_port, bundle* message);
+EXPORT_API int messageport_send_message(const char* remote_app_id, const char* remote_port, bundle* message);
/**
* @brief Sends a trusted message to the message port of a remote application. @n
* @retval #MESSAGEPORT_ERROR_MAX_EXCEEDED The size of message has exceeded the maximum limit
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_send_trusted_message(const char* remote_app_id, const char* remote_port, bundle* message);
+EXPORT_API int messageport_send_trusted_message(const char* remote_app_id, const char* remote_port, bundle* message);
/**
* @brief Sends a message to the message port of a remote application. This method is used for the bidirectional communication.
* bundle_free(b);
* }
*/
-int messageport_send_bidirectional_message(int id, const char* remote_app_id, const char* remote_port, bundle* data);
+EXPORT_API int messageport_send_bidirectional_message(int id, const char* remote_app_id, const char* remote_port, bundle* data);
/**
* @brief Sends a trusted message to the message port of a remote application. This method is used for the bidirectional communication.
* @retval #MESSAGEPORT_ERROR_MAX_EXCEEDED The size of message has exceeded the maximum limit
* @retval #MESSAGEPORT_ERROR_IO_ERROR Internal I/O error
*/
-int messageport_send_bidirectional_trusted_message(int id, const char* remote_app_id, const char* remote_port, bundle* data);
+EXPORT_API int messageport_send_bidirectional_trusted_message(int id, const char* remote_app_id, const char* remote_port, bundle* data);
/**
* @retval #MESSAGEPORT_ERROR_OUT_OF_MEMORY Out of memory
* @remarks @a name must be released with free() by you
*/
-int messageport_get_local_port_name(int id, char **name);
+EXPORT_API int messageport_get_local_port_name(int id, char **name);
/**
* @brief Checks if the local message port is trusted.
* @retval #MESSAGEPORT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MESSAGEPORT_ERROR_OUT_OF_MEMORY Out of memory
*/
-int messageport_check_trusted_local_port(int id, bool *trusted);
+EXPORT_API int messageport_check_trusted_local_port(int id, bool *trusted);
/**
* @}