![]() |
![]() |
![]() |
Spread RPC - Reference Manual | ![]() |
---|---|---|---|---|
void (*SPRpcResponse) (SPRpc *rpc, SPRpcResponseID response_id, SPRpcParams *params, gpointer user_data); typedef SPRpcResponseID; enum SPRpcReqType; SPRpcStatus sp_rpc_call (SPRpc *rpc, const gchar *method_name, SPRpcParams *params, SPRpcReqType request_type, SPRpcResponseID *response_id, SPRpcResponse response_function, gpointer user_data); SPRpcStatus sp_rpc_call_list (SPRpc *rpc, SPRpcResponseID *response_id, SPRpcResponse response_function, gpointer user_data); void sp_rpc_call_remove (SPRpc *rpc, SPRpcResponseID response_id); gboolean sp_rpc_call_is_registered (SPRpc *rpc, SPRpcResponseID response_id);
void (*SPRpcResponse) (SPRpc *rpc, SPRpcResponseID response_id, SPRpcParams *params, gpointer user_data);
This is the propotype of the callback for the client.
|
a SPRpc |
|
the ID of this response |
|
a SPRpcParams |
|
the user data |
typedef enum { SP_RPC_REQ_TYPE_CALL = 0, SP_RPC_REQ_TYPE_GET_PARAMS, SP_RPC_REQ_TYPE_EXISTS } SPRpcReqType;
This is the list of the request type.
SPRpcStatus sp_rpc_call (SPRpc *rpc, const gchar *method_name, SPRpcParams *params, SPRpcReqType request_type, SPRpcResponseID *response_id, SPRpcResponse response_function, gpointer user_data);
Sends the request for the remote procedure call. The params must be compatible with the called method.
If response_function
is not NULL, it will be called with params
when the remote method returns them.
|
a SPRpc |
|
the method name |
|
the params to send |
|
the type of the request |
|
the location of a ID, or NULL |
|
the pointer of the callback, or NULL |
|
data to pass to the function calls |
Returns : |
a status about the message |
SPRpcStatus sp_rpc_call_list (SPRpc *rpc, SPRpcResponseID *response_id, SPRpcResponse response_function, gpointer user_data);
Sends the request for the list of the calls
|
a SPRpc |
|
a location of the response ID, or NULL |
|
the pointer of the callback |
|
data to pass to the function calls |
Returns : |
the status of the operation |
void sp_rpc_call_remove (SPRpc *rpc, SPRpcResponseID response_id);
Removes the calling operation from a SPRpc. Any other value from the request will be ignored.
|
a SPRpc |
|
the ID of the calling operation |
gboolean sp_rpc_call_is_registered (SPRpc *rpc, SPRpcResponseID response_id);
Returns TRUE if the response_id is valid and registered to the SPRpc.
|
a SPRpc |
|
the ID of the calling operation |
Returns : |
TRUE/FALSE |