Barrelfish
|
Get/Set client API implementation. More...
Functions | |
errval_t | oct_get_names (char ***names, size_t *len, const char *query,...) |
Retrieve all record names matching a given query. More... | |
errval_t | oct_get (char **data, const char *query,...) |
Gets one record matching the given query. More... | |
errval_t | oct_set (const char *query,...) |
Sets a record. More... | |
errval_t | oct_mset (oct_mode_t mode, const char *query,...) |
Sets a record. More... | |
errval_t | oct_set_get (oct_mode_t mode, char **record, const char *query,...) |
Sets a record and returns and in case of no error returns it to the client. More... | |
errval_t | oct_get_with_idcap (char **data, struct capref idcap) |
Gets one record using the ID capability as the key/name. More... | |
errval_t | oct_set_with_idcap (struct capref idcap, const char *attributes,...) |
Sets a record using the ID capability as the name/key of the record. More... | |
errval_t | oct_del (const char *query,...) |
Deletes all records matching the given query. More... | |
errval_t | oct_exists (const char *query,...) |
Checks if a result for a given query exists. More... | |
errval_t | oct_wait_for (char **record, const char *query,...) |
Waits until a given record exists. More... | |
Get/Set client API implementation.
This file provides convenience functions to interface with the octopus.if RPC calls.
errval_t oct_del | ( | const char * | query, |
... | |||
) |
Deletes all records matching the given query.
query | Specifies the record(s) to be deleted. |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD | |
OCT_ERR_NO_RECORD_NAME | |
OCT_ERR_ENGINE_FAIL | |
OCT_ERR_PARSER_FAIL | TODO: Atm only name of record is included in del query on server. |
errval_t oct_exists | ( | const char * | query, |
... | |||
) |
Checks if a result for a given query exists.
query | Results are searched based on the query. |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_get | ( | char ** | data, |
const char * | query, | ||
... | |||
) |
Gets one record matching the given query.
[out] | data | Record returned by the server. |
[in] | query | The query sent to the server. |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD | |
OCT_ERR_AMBIGOUS_QUERY | TODO! |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_get_names | ( | char *** | names, |
size_t * | len, | ||
const char * | query, | ||
... | |||
) |
Retrieve all record names matching a given query.
[out] | names | Names of all records matching the query. Needs to be freed by the client (use oct_free_names) in case of SYS_ERR_OK/LIB_ERR_MALLOC_FAIL. |
[out] | size | Number of records matching the query. 0 in case of error. |
[in] | query | Query sent to the server |
... | Parameters used to build query with help of vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL | |
LIB_ERR_MALLOC_FAIL |
errval_t oct_get_with_idcap | ( | char ** | data, |
struct capref | idcap | ||
) |
Gets one record using the ID capability as the key/name.
[out] | data | Record returned by the server. |
[in] | idcap | ID capability used as the key/name of the record. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_mset | ( | oct_mode_t | mode, |
const char * | query, | ||
... | |||
) |
Sets a record.
query | The record to set. |
mode | A combination of mode bits (see getset.h). |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD_NAME | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_set | ( | const char * | query, |
... | |||
) |
Sets a record.
query | The record to set. |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD_NAME | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_set_get | ( | oct_mode_t | mode, |
char ** | record, | ||
const char * | query, | ||
... | |||
) |
Sets a record and returns and in case of no error returns it to the client.
Additonally the mode how a record is set can be specified.
mode | A combination of mode bits (see getset.h). | |
[out] | record | The new record. |
[in] | query | The record to set. |
... | Additional arguments to format the query using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD_NAME | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL | TODO maybe remove this function completely and let all use rpc call for set directly if they want to a non-trivial set? |
errval_t oct_set_with_idcap | ( | struct capref | idcap, |
const char * | attributes, | ||
... | |||
) |
Sets a record using the ID capability as the name/key of the record.
idcap | ID capability used as the name/key of the record. |
attributes | Attributes of the record. |
... | Additional arguments to format the attributes using vsprintf. |
SYS_ERR_OK | |
OCT_ERR_NO_RECORD_NAME | |
OCT_ERR_PARSER_FAIL | |
OCT_ERR_ENGINE_FAIL |
errval_t oct_wait_for | ( | char ** | record, |
const char * | query, | ||
... | |||
) |
Waits until a given record exists.
record | Record that matched the query, callee has to free this. |
query | Format of record to wait for. |
... | Additional arguments to format query. |
SYS_ERR_OK |