Barrelfish
Functions
read.c File Reference

Helper functions to read record contents. More...

Functions

errval_t oct_read (const char *record, const char *format,...)
 Reads the content of a record string based on the provided format. Currently supported d (int64_t*), f (double*?), s (char**). More...
 

Detailed Description

Helper functions to read record contents.

Function Documentation

errval_t oct_read ( const char *  record,
const char *  format,
  ... 
)

Reads the content of a record string based on the provided format. Currently supported d (int64_t*), f (double*?), s (char**).

ATTENTION: Currently we only parse 64-bit numbers (with d). This function tends to behave badly when calling it with 32bit pointers (i.e., oct_read(rec, "_ {iref: 1}", (iref_t) iref);) Don't do it!

: docs && support proper scan types from (inttypes.h)

Parameters
recordRecord to read.
formatWhat you want to read.
...Values read are stored in the provided arguments.
Return values
SYS_ERR_OK
OCT_ERR_ATTRIBUTE_NOT_FOUND
OCT_ERR_TYPE_MISMATCH
OCT_ERR_RECORD_NAME_MISMATCH
OCT_ERR_ATTRIBUTE_MISMATCH