Move functions to rpc-port header file 37/239937/10
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 30 Jul 2020 23:37:04 +0000 (08:37 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 7 Aug 2020 03:50:43 +0000 (12:50 +0900)
Moves:
 - rpc_port_proxy_connect_sync()
 - rpc_port_set_private_sharing_array()
 - rpc_port_set_private_sharing()
 - rpc_port_unset_private_sharing()

Change-Id: I162547b202376716fa35fb692bcc4faa61ada000
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/rpc-port-internal.h
include/rpc-port.h

index 51f8edf..b370e0a 100644 (file)
@@ -27,16 +27,6 @@ int rpc_port_proxy_create_mockup(rpc_port_proxy_h *h);
 
 int rpc_port_stub_create_mockup(rpc_port_stub_h *h, const char *port_name);
 
-int rpc_port_proxy_connect_sync(rpc_port_proxy_h h, const char *appid,
-               const char *port_name);
-
-int rpc_port_set_private_sharing_array(rpc_port_h port, const char *paths[],
-               unsigned int size);
-
-int rpc_port_set_private_sharing(rpc_port_h port, const char *path);
-
-int rpc_port_unset_private_sharing(rpc_port_h port);
-
 #ifdef __cplusplus
 }
 #endif
index 5f4ab6d..93c9983 100644 (file)
@@ -461,6 +461,81 @@ int rpc_port_stub_get_port(rpc_port_stub_h h, rpc_port_port_type_e type,
                const char *instance, rpc_port_h *port);
 
 /**
+ * @brief Connects to @a port_name of @a appid synchronously.
+ * @details To send and receive data, the proxy should connect to port of stub.
+ * @since_tizen 6.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appmanager.launch \n
+ *            %http://tizen.org/privilege/datasharing
+ * @param[in] h The rpc port proxy handle
+ * @param[in] appid The application ID of the target stub
+ * @param[in] port_name The name of rpc port
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #RPC_PORT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RPC_PORT_ERROR_IO_ERROR I/O error
+ */
+int rpc_port_proxy_connect_sync(rpc_port_proxy_h h, const char *appid,
+                const char *port_name);
+
+/**
+ * @brief Sets the paths of private sharing files.
+ * @details If all added paths are under the caller application's data path which can be obtained by calling app_get_data_path() function,
+ *          those will be shared to the target application. Platform will grant a temporary permission to the target application for those files and revoke it when the target application is terminated or rpc_port_unset_private_sharing() is called.
+ *          Paths should be regular files. The target application can just read them.
+ *          Note that the target application doesn't have read permission of the directory that is obtained by caller's app_get_data_path(),
+ *          You should open the file path with read only mode directly. For example, access() call to the file path will return error because access() needs the read permission of the directory.
+ *          The target application can call open() with O_RDONLY mode for the passed file path, because platform grants read permission to the passed file path.
+ * @since_tizen 6.0
+ * @param[in] port The rpc port handle
+ * @param[in] paths The array of paths of files
+ * @param[in] size The size of the array of the paths
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RPC_PORT_ERROR_IO_ERROR I/O error
+ *
+ * @see rpc_port_unset_private_sharing()
+ */
+int rpc_port_set_private_sharing_array(rpc_port_h port, const char *paths[],
+                unsigned int size);
+
+/**
+ * @brief Sets the path of the private sharing file.
+ * @details See the description of rpc_port_set_private_sharing_array() for details.
+ * @since_tizen 6.0
+ * @param[in] port The rpc port handle
+ * @param[in] path The path of the file
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RPC_PORT_ERROR_IO_ERROR I/O error
+ *
+ * @see rpc_port_set_private_sharing_array()
+ * @see rpc_port_unset_private_sharing()
+ */
+int rpc_port_set_private_sharing(rpc_port_h port, const char *path);
+
+/**
+ * @brief Unsets the private sharing.
+ * @since_tizen 6.0
+ * @param[in] port The rpc port handle
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RPC_PORT_ERROR_IO_ERROR I/O error
+ *
+ * @see rpc_port_set_private_sharing_array()
+ * @see rpc_port_set_private_sharing()
+ */
+int rpc_port_unset_private_sharing(rpc_port_h port);
+
+/**
  * @}
  */