| Tizen Native API
    5.0
    | 
The RPC Port Parcel API provides functions to make parcel data.
Required Header
#include <rpc-port-parcel.h>
Overview
It is container for a data that can be sent via RPCPort.
| Functions | |
| int | rpc_port_parcel_create (rpc_port_parcel_h *h) | 
| Creates a rpc port parcel handle. | |
| int | rpc_port_parcel_create_from_port (rpc_port_parcel_h *h, rpc_port_h port) | 
| Creates a rpc port parcel handle from port. | |
| int | rpc_port_parcel_send (rpc_port_parcel_h h, rpc_port_h port) | 
| Sends parcel data through the port. | |
| int | rpc_port_parcel_destroy (rpc_port_parcel_h h) | 
| Destroys a rpc port parcel handle. | |
| int | rpc_port_parcel_write_byte (rpc_port_parcel_h h, char b) | 
| Writes a byte value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_int16 (rpc_port_parcel_h h, short i) | 
| Writes a short value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_int32 (rpc_port_parcel_h h, int i) | 
| Writes a integer value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_int64 (rpc_port_parcel_h h, long long i) | 
| Writes a long long integer value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_float (rpc_port_parcel_h h, float f) | 
| Writes a floating point value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_double (rpc_port_parcel_h h, double d) | 
| Writes a double precision floating point value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_string (rpc_port_parcel_h h, const char *str) | 
| Writes a string value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_bool (rpc_port_parcel_h h, bool b) | 
| Writes a boolean value into rpc port parcel handle. | |
| int | rpc_port_parcel_write_bundle (rpc_port_parcel_h h, bundle *b) | 
| Writes a bundle data into rpc port parcel handle. | |
| int | rpc_port_parcel_write_array_count (rpc_port_parcel_h h, int count) | 
| Writes a count for array into rpc port parcel handle. | |
| int | rpc_port_parcel_write (rpc_port_parcel_h h, rpc_port_parcelable_t *parcelable, void *data) | 
| Writes the data into parcel handle using parcelable. | |
| int | rpc_port_parcel_read_byte (rpc_port_parcel_h h, char *b) | 
| Reads a byte value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_int16 (rpc_port_parcel_h h, short *i) | 
| Reads a short value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_int32 (rpc_port_parcel_h h, int *i) | 
| Reads a integer value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_int64 (rpc_port_parcel_h h, long long *i) | 
| Reads a long long integer value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_float (rpc_port_parcel_h h, float *f) | 
| Reads a floating point value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_double (rpc_port_parcel_h h, double *d) | 
| Reads a double precision floating point value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_string (rpc_port_parcel_h h, char **str) | 
| Reads a string value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_bool (rpc_port_parcel_h h, bool *b) | 
| Reads a boolean value from rpc port parcel handle. | |
| int | rpc_port_parcel_read_bundle (rpc_port_parcel_h h, bundle **b) | 
| Reads a bundle data from rpc port parcel handle. | |
| int | rpc_port_parcel_read_array_count (rpc_port_parcel_h h, int *count) | 
| Reads a count for array from rpc port parcel handle. | |
| int | rpc_port_parcel_read (rpc_port_parcel_h h, rpc_port_parcelable_t *parcelable, void *data) | 
| Reads a parcel from the data using parcelable. | |
| int | rpc_port_parcel_burst_read (rpc_port_parcel_h h, unsigned char *buf, unsigned int size) | 
| Reads bytes from rpc port parcel handle. | |
| int | rpc_port_parcel_burst_write (rpc_port_parcel_h h, const unsigned char *buf, unsigned int size) | 
| Write bytes to rpc port parcel handle. | |
| Typedefs | |
| typedef void * | rpc_port_parcel_h | 
| The rpc port parcel handle. | |
| typedef struct __rpc_port_parcelable | rpc_port_parcelable_t | 
| The interface for converting data to/from a parcel. | |
Typedef Documentation
| typedef void* rpc_port_parcel_h | 
The rpc port parcel handle.
- Since :
- 4.0
| typedef struct __rpc_port_parcelable rpc_port_parcelable_t | 
The interface for converting data to/from a parcel.
- Since :
- 4.0
Function Documentation
| int rpc_port_parcel_burst_read | ( | rpc_port_parcel_h | h, | 
| unsigned char * | buf, | ||
| unsigned int | size | ||
| ) | 
Reads bytes from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] buf The array buffer to read [in] size Bytes to read 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_bool()
| int rpc_port_parcel_burst_write | ( | rpc_port_parcel_h | h, | 
| const unsigned char * | buf, | ||
| unsigned int | size | ||
| ) | 
Write bytes to rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] buf The array buffer to write [in] size Bytes to write 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_bool()
| int rpc_port_parcel_create | ( | rpc_port_parcel_h * | h | ) | 
Creates a rpc port parcel handle.
- Since :
- 4.0
- Remarks:
- You must release h using rpc_port_parcel_destroy().
- Parameters:
- 
  [out] h The rpc port parcel handle that is newly created 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful 
- See also:
- rpc_port_parcel_destroy()
| int rpc_port_parcel_create_from_port | ( | rpc_port_parcel_h * | h, | 
| rpc_port_h | port | ||
| ) | 
Creates a rpc port parcel handle from port.
Creates a rpc port parcel handle using read data from the port. It calls rpc_port_read() internally.
- Since :
- 4.0
- Remarks:
- You must release h using rpc_port_parcel_destroy().
- Parameters:
- 
  [out] h The rpc port parcel handle that is newly created [in] port The rpc port handle for creating handle 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified port is NULL RPC_PORT_ERROR_IO_ERROR Internal I/O error 
| int rpc_port_parcel_destroy | ( | rpc_port_parcel_h | h | ) | 
Destroys a rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_create()
| int rpc_port_parcel_read | ( | rpc_port_parcel_h | h, | 
| rpc_port_parcelable_t * | parcelable, | ||
| void * | data | ||
| ) | 
Reads a parcel from the data using parcelable.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] parcelable The interface to get data from parcel handle [in] data Data which get from parcel 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write()
| int rpc_port_parcel_read_array_count | ( | rpc_port_parcel_h | h, | 
| int * | count | ||
| ) | 
Reads a count for array from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] count Array count 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_array_count()
| int rpc_port_parcel_read_bool | ( | rpc_port_parcel_h | h, | 
| bool * | b | ||
| ) | 
Reads a boolean value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] b boolean data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_bool()
| int rpc_port_parcel_read_bundle | ( | rpc_port_parcel_h | h, | 
| bundle ** | b | ||
| ) | 
Reads a bundle data from rpc port parcel handle.
- Since :
- 4.0
- Remarks:
- The b should be released using bundle_free().
- Parameters:
- 
  [in] h The rpc port parcel handle [out] b Bundle data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_bundle()
| int rpc_port_parcel_read_byte | ( | rpc_port_parcel_h | h, | 
| char * | b | ||
| ) | 
Reads a byte value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] b Byte data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_byte()
| int rpc_port_parcel_read_double | ( | rpc_port_parcel_h | h, | 
| double * | d | ||
| ) | 
Reads a double precision floating point value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] d double data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_double()
| int rpc_port_parcel_read_float | ( | rpc_port_parcel_h | h, | 
| float * | f | ||
| ) | 
Reads a floating point value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] f float data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_float()
| int rpc_port_parcel_read_int16 | ( | rpc_port_parcel_h | h, | 
| short * | i | ||
| ) | 
Reads a short value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] i short data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_int16()
| int rpc_port_parcel_read_int32 | ( | rpc_port_parcel_h | h, | 
| int * | i | ||
| ) | 
Reads a integer value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] i int data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_int32()
| int rpc_port_parcel_read_int64 | ( | rpc_port_parcel_h | h, | 
| long long * | i | ||
| ) | 
Reads a long long integer value from rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [out] i long long data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_int64()
| int rpc_port_parcel_read_string | ( | rpc_port_parcel_h | h, | 
| char ** | str | ||
| ) | 
Reads a string value from rpc port parcel handle.
- Since :
- 4.0
- Remarks:
- The str should be released using free().
- Parameters:
- 
  [in] h The rpc port parcel handle [out] str string data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_write_string()
| int rpc_port_parcel_send | ( | rpc_port_parcel_h | h, | 
| rpc_port_h | port | ||
| ) | 
Sends parcel data through the port.
Sends parcel data through the port. It calls rpc_port_write() internally.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle that is newly created [in] port The rpc port handle for writing data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL RPC_PORT_ERROR_IO_ERROR Internal I/O error 
- See also:
- rpc_port_parcel_create_from_port()
| int rpc_port_parcel_write | ( | rpc_port_parcel_h | h, | 
| rpc_port_parcelable_t * | parcelable, | ||
| void * | data | ||
| ) | 
Writes the data into parcel handle using parcelable.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] parcelable The interface to write the data into parcel handle [in] data Data which write into parcel 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read()
| int rpc_port_parcel_write_array_count | ( | rpc_port_parcel_h | h, | 
| int | count | ||
| ) | 
Writes a count for array into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] count Array count 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_array_count()
| int rpc_port_parcel_write_bool | ( | rpc_port_parcel_h | h, | 
| bool | b | ||
| ) | 
Writes a boolean value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] b boolean data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_bool()
| int rpc_port_parcel_write_bundle | ( | rpc_port_parcel_h | h, | 
| bundle * | b | ||
| ) | 
Writes a bundle data into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] b Bundle data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_bundle()
| int rpc_port_parcel_write_byte | ( | rpc_port_parcel_h | h, | 
| char | b | ||
| ) | 
Writes a byte value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] b Byte data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_byte()
| int rpc_port_parcel_write_double | ( | rpc_port_parcel_h | h, | 
| double | d | ||
| ) | 
Writes a double precision floating point value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] d double data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_double()
| int rpc_port_parcel_write_float | ( | rpc_port_parcel_h | h, | 
| float | f | ||
| ) | 
Writes a floating point value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] f float data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_float()
| int rpc_port_parcel_write_int16 | ( | rpc_port_parcel_h | h, | 
| short | i | ||
| ) | 
Writes a short value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] i short data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_int16()
| int rpc_port_parcel_write_int32 | ( | rpc_port_parcel_h | h, | 
| int | i | ||
| ) | 
Writes a integer value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] i int data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_int32()
| int rpc_port_parcel_write_int64 | ( | rpc_port_parcel_h | h, | 
| long long | i | ||
| ) | 
Writes a long long integer value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] i long long data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_int64()
| int rpc_port_parcel_write_string | ( | rpc_port_parcel_h | h, | 
| const char * | str | ||
| ) | 
Writes a string value into rpc port parcel handle.
- Since :
- 4.0
- Parameters:
- 
  [in] h The rpc port parcel handle [in] str string data 
- Returns:
- 0on success, otherwise a negative error value
- Return values:
- 
  RPC_PORT_ERROR_NONE Successful RPC_PORT_ERROR_INVALID_PARAMETER The specified h is NULL 
- See also:
- rpc_port_parcel_read_string()