2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_APPFW_MESSAGE_PORT_COMMOM_H__
18 #define __TIZEN_APPFW_MESSAGE_PORT_COMMOM_H__
23 #include <message_port.h>
24 #include <message_port_log.h>
30 #define MESSAGEPORT_BUS_NAME_PREFIX "org.tizen.messageport._"
31 #define MESSAGEPORT_OBJECT_PATH "/org/tizen/messageport"
32 #define MESSAGEPORT_INTERFACE_PREFIX "org.tizen.messageport._"
34 #define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
35 #define DBUS_PATH_DBUS "/org/freedesktop/DBus"
36 #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
39 #define retvm_if(expr, val, fmt, arg...) do { \
42 _LOGE("(%s) -> %s() return", #expr, __func__); \
47 #define retv_if(expr, val) do { \
49 _LOGE("(%s) -> %s() return", #expr, __func__); \
54 #define FREE_AND_NULL(ptr) do { \
61 int write_socket(int fd,
64 unsigned int *bytes_write,
66 int write_string_to_socket(int fd,
69 unsigned int *bytes_write,
71 int read_socket(int fd,
74 unsigned int *bytes_read);
75 int read_string_from_socket(int fd, char **buffer, int *string_len);
76 bool initialize_common();
77 bool is_preloaded(const char *local_appid, const char *remote_appid);
78 int check_certificate(const char *local_appid, const char *remote_appid);
79 char *get_encoded_name(const char *remote_app_id, const char *port_name, bool is_trusted);
80 void message_port_lock_mutex();
81 void message_port_unlock_mutex();
83 extern bool initialized_common;
84 extern GDBusConnection *gdbus_conn;
95 #endif /* __TIZEN_APPFW_MESSAGE_PORT_COMMOM_H__ */