![]() |
![]() |
![]() |
Spread RPC - Reference Manual | ![]() |
---|---|---|---|---|
typedef SPRpcParams; typedef SPRpcIter; SPRpcParams* sp_rpc_params_new (void); void sp_rpc_params_ref (SPRpcParams *params); void sp_rpc_params_unref (SPRpcParams *params); gboolean sp_rpc_params_has (SPRpcParams *params, const gchar *name); SPRpcValue* sp_rpc_params_get (SPRpcParams *params, const gchar *name); void sp_rpc_params_add (SPRpcParams *params, const gchar *name, SPRpcValue *value); void sp_rpc_params_del (SPRpcParams *params, const gchar *name); gboolean sp_rpc_params_is_empty (SPRpcParams *params); void sp_rpc_params_iter_init (SPRpcParams *params, SPRpcIter *iter); gboolean sp_rpc_params_iter_next (SPRpcIter *iter, gchar **name, SPRpcValue **value); void sp_rpc_params_iter_remove (SPRpcIter *iter);
SPRpcParams* sp_rpc_params_new (void);
Creates a new SPRpcParams.
Returns : |
a new SPRpcParams with a reference count of 1 |
void sp_rpc_params_ref (SPRpcParams *params);
Increases the reference count of a SPRpcParams.
|
a SPRpcParams |
void sp_rpc_params_unref (SPRpcParams *params);
Decreases the reference count of a SPRpcParams. When its reference count drops to 0, the SPRpcParams is finalized.
|
a SPRpcParams |
gboolean sp_rpc_params_has (SPRpcParams *params, const gchar *name);
Looks whether the params array has the value name
.
|
a SPRpcParams |
|
the name of the value |
Returns : |
TRUE if key is a part of the params, FALSE otherwise. |
SPRpcValue* sp_rpc_params_get (SPRpcParams *params, const gchar *name);
Looks up a value in a params array.
|
a SPRpcParams |
|
the name of the value |
Returns : |
the associated value, or NULL |
void sp_rpc_params_add (SPRpcParams *params, const gchar *name, SPRpcValue *value);
Inserts into the params array a new value and increases its count references.
|
a SPRpcParams |
|
the name of the new value |
|
a SPRpcValue |
void sp_rpc_params_del (SPRpcParams *params, const gchar *name);
Removes a value from a SPRpcParams and decreases the count reference of this value
|
a SPRpcParams |
|
the name of the value |
gboolean sp_rpc_params_is_empty (SPRpcParams *params);
|
a SPRpcParams |
Returns : |
TRUE if the params array is empty. |
void sp_rpc_params_iter_init (SPRpcParams *params, SPRpcIter *iter);
Initializes a key/value pair iterator and associates it with the a SPRpcParams. Modifying the struct after calling this function invalidates the returned iterator.
gchar *key; SPRpcValue *value; SPRpcIter iter; sp_rpc_params_iter_initt(params, &iter); while (sp_rpc_params_iter_next(&iter, &key, &value)) { /* do something with key and value */ }
|
a SPRpcParams |
|
an unitialized SPRpcIter |
gboolean sp_rpc_params_iter_next (SPRpcIter *iter, gchar **name, SPRpcValue **value);
Advances iter and retrieves the key and/or value that are now pointed to as a result of this advancement. If FALSE is returned, key and value are not set, and the iterator becomes invalid.
|
an initialized SPRpcIter |
|
a location for the key, or NULL |
|
the location for the value, or NULL |
Returns : |
FALSE if the end of struct has been reached |
void sp_rpc_params_iter_remove (SPRpcIter *iter);
Removes the key/value pair currently pointed to by the iterator from its
associated SPRpcValue. Can only be called after
sp_rpc_params_iter_next()
returned TRUE, and cannot be called more
than once for the same key/value pair.
The count reference of the removed value will be decreased.
|
an initialized SPRpcIter |