DTNMA Reference Tools v2.0.0 - 7.g88e232c
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains functions for internal API to access ARI values in a consistent way. More...
Functions | |
bool | cace_ari_is_undefined (const cace_ari_t *ari) |
Determine if a value is the undefined value. | |
bool | cace_ari_not_undefined (const cace_ari_t *ari) |
Determine if a value is not the undefined value. | |
void | cace_ari_set_undefined (cace_ari_t *ari) |
Set the ARI value to be undefined. | |
bool | cace_ari_is_null (const cace_ari_t *ari) |
Determine if this is a typed or untyped null value. | |
void | cace_ari_set_null (cace_ari_t *ari) |
Set the ARI value to be untyped null. | |
bool | cace_ari_is_bool (const cace_ari_t *ari) |
Determine if this ARI contains a primitive boolean type. | |
int | cace_ari_get_bool (const cace_ari_t *ari, cace_ari_bool *out) |
Extract a boolean value, if present, from an ARI. | |
int | cace_ari_get_int (const cace_ari_t *ari, cace_ari_int *out) |
Extract an integer value, if present, from an ARI. | |
int | cace_ari_get_uint (const cace_ari_t *ari, cace_ari_uint *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | cace_ari_get_byte (const cace_ari_t *ari, cace_ari_byte *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | cace_ari_get_vast (const cace_ari_t *ari, cace_ari_vast *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | cace_ari_get_uvast (const cace_ari_t *ari, cace_ari_uvast *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | cace_ari_get_tp (const cace_ari_t *ari, struct timespec *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The output in this case is in the DTN time epoch. | |
int | cace_ari_get_tp_posix (const cace_ari_t *ari, struct timespec *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The output in this case is in the POSIX time epoch. | |
int | cace_ari_get_td (const cace_ari_t *ari, struct timespec *out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
bool | cace_ari_is_lit_typed (const cace_ari_t *ari, cace_ari_type_t typ) |
Determine if this is a typed literal of a specific type. | |
const int64_t * | cace_ari_get_aritype (const cace_ari_t *ari) |
Require an ARITYPE literal value. | |
void | cace_ari_set_prim_bool (cace_ari_t *ari, cace_ari_bool src) |
Set an ARI as an untyped literal value. | |
void | cace_ari_set_prim_uint64 (cace_ari_t *ari, uint64_t src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_prim_int64 (cace_ari_t *ari, int64_t src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_prim_float64 (cace_ari_t *ari, cace_ari_real64 src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_bool (cace_ari_t *ari, cace_ari_bool src) |
Set an ARI as a typed literal value. | |
void | cace_ari_set_byte (cace_ari_t *ari, cace_ari_byte src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_int (cace_ari_t *ari, cace_ari_int src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_uint (cace_ari_t *ari, cace_ari_uint src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_vast (cace_ari_t *ari, cace_ari_vast src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_uvast (cace_ari_t *ari, cace_ari_uvast src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_real32 (cace_ari_t *ari, cace_ari_real32 src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_real64 (cace_ari_t *ari, cace_ari_real64 src) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_tstr (cace_ari_t *ari, const char *buf, bool copy) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_bstr (cace_ari_t *ari, cace_data_t *src, bool copy) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_tp (cace_ari_t *ari, struct timespec dtntime) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The input in this case is in the DTN time epoch. | |
void | cace_ari_set_tp_posix (cace_ari_t *ari, struct timespec ptime) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The input in this case is in the POSIX time epoch. | |
void | cace_ari_set_td (cace_ari_t *ari, struct timespec delta) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_aritype (cace_ari_t *ari, cace_ari_type_t type) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_aritype_text (cace_ari_t *ari, cace_ari_type_t type) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | cace_ari_set_ac (cace_ari_t *ari, struct cace_ari_ac_s *src) |
Set the ARI as an AC, optionally moving values from an external source. | |
void | cace_ari_set_am (cace_ari_t *ari, struct cace_ari_am_s *src) |
Set the ARI as an AM, optionally moving values from an external source. | |
void | cace_ari_set_tbl (cace_ari_t *ari, struct cace_ari_tbl_s *src) |
Set the ARI as a TBL, optionally moving values from an external source. | |
const cace_data_t * | cace_ari_cget_tstr (const cace_ari_t *ari) |
Require a TEXTSTR value and get the pointer to its storage. | |
const cace_data_t * | cace_ari_cget_bstr (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_ac_s * | cace_ari_get_ac (cace_ari_t *ari) |
Require an AC value and extract a pointer to its item list. | |
const struct cace_ari_ac_s * | cace_ari_cget_ac (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_am_s * | cace_ari_get_am (cace_ari_t *ari) |
Require an AM value and extract a pointer to its item list. | |
const struct cace_ari_am_s * | cace_ari_cget_am (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_tbl_s * | cace_ari_get_tbl (cace_ari_t *ari) |
const struct cace_ari_tbl_s * | cace_ari_cget_tbl (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_execset_s * | cace_ari_get_execset (cace_ari_t *ari) |
Require an EXECSET value and extract a pointer to its struct. | |
const struct cace_ari_execset_s * | cace_ari_cget_execset (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_execset_s * | cace_ari_set_execset (cace_ari_t *ari) |
Set an ARI as an EXECSET literal value. | |
struct cace_ari_rptset_s * | cace_ari_get_rptset (cace_ari_t *ari) |
Require an RPTSET value and extract a pointer to its struct. | |
const struct cace_ari_rptset_s * | cace_ari_cget_rptset (const cace_ari_t *ari) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
struct cace_ari_rptset_s * | cace_ari_set_rptset (cace_ari_t *ari) |
Set an ARI as an RPTSET literal value. | |
static void | cace_ari_set_objref_path_intid (cace_ari_t *ari, cace_ari_int_id_t org_id, cace_ari_int_id_t model_id, cace_ari_type_t type_id, cace_ari_int_id_t obj_id) |
Convenience setter. | |
static void | cace_ari_set_objref_path_textid (cace_ari_t *ari, const char *org_id, const char *model_id, cace_ari_type_t type_id, const char *obj_id) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
This file contains functions for internal API to access ARI values in a consistent way.
const cace_data_t * cace_ari_cget_tstr | ( | const cace_ari_t * | ari | ) |
Require a TEXTSTR value and get the pointer to its storage.
[in] | ari | The ARI to read. |
References cace_ari_prim_val_u::as_data, cace_ari_t::as_lit, CACE_ARI_PRIM_TSTR, cace_ari_t::is_ref, cace_ari_lit_t::prim_type, and cace_ari_lit_t::value.
struct cace_ari_ac_s * cace_ari_get_ac | ( | cace_ari_t * | ari | ) |
Require an AC value and extract a pointer to its item list.
[in] | ari | The ARI to read. |
References cace_ari_prim_val_u::as_ac, cace_ari_t::as_lit, and cace_ari_lit_t::value.
struct cace_ari_am_s * cace_ari_get_am | ( | cace_ari_t * | ari | ) |
Require an AM value and extract a pointer to its item list.
[in] | ari | The ARI to read. |
References cace_ari_prim_val_u::as_am, cace_ari_t::as_lit, and cace_ari_lit_t::value.
const int64_t * cace_ari_get_aritype | ( | const cace_ari_t * | ari | ) |
Require an ARITYPE literal value.
[in] | ari | The ARI to read. |
References cace_ari_prim_val_u::as_int64, cace_ari_t::as_lit, CACE_ARI_PRIM_INT64, cace_ari_lit_t::prim_type, and cace_ari_lit_t::value.
int cace_ari_get_bool | ( | const cace_ari_t * | ari, |
cace_ari_bool * | out | ||
) |
Extract a boolean value, if present, from an ARI.
This works for both typed and untyped literal values.
[in] | ari | Non-null pointer to the ARI to read. |
[out] | out | The value to output. |
References cace_ari_prim_val_u::as_bool, cace_ari_t::as_lit, CACE_ARI_PRIM_BOOL, CHKERR1, cace_ari_t::is_ref, cace_ari_lit_t::prim_type, and cace_ari_lit_t::value.
struct cace_ari_execset_s * cace_ari_get_execset | ( | cace_ari_t * | ari | ) |
Require an EXECSET value and extract a pointer to its struct.
[in] | ari | The ARI to read. |
References cace_ari_prim_val_u::as_execset, cace_ari_t::as_lit, and cace_ari_lit_t::value.
int cace_ari_get_int | ( | const cace_ari_t * | ari, |
cace_ari_int * | out | ||
) |
Extract an integer value, if present, from an ARI.
This works for both typed and untyped literal values and will coerce signed and unsigned values to the desired type where possible.
[in] | ari | Non-null pointer to the ARI to read. |
[out] | out | The value to output. |
References cace_ari_prim_val_u::as_int64, cace_ari_t::as_lit, cace_ari_prim_val_u::as_uint64, CACE_ARI_PRIM_INT64, CACE_ARI_PRIM_UINT64, CHKERR1, cace_ari_t::is_ref, cace_ari_lit_t::prim_type, and cace_ari_lit_t::value.
struct cace_ari_rptset_s * cace_ari_get_rptset | ( | cace_ari_t * | ari | ) |
Require an RPTSET value and extract a pointer to its struct.
[in] | ari | The ARI to read. |
References cace_ari_t::as_lit, cace_ari_prim_val_u::as_rptset, and cace_ari_lit_t::value.
bool cace_ari_is_bool | ( | const cace_ari_t * | ari | ) |
Determine if this ARI contains a primitive boolean type.
[in] | ari | Non-null pointer to the ARI to read. |
References cace_ari_t::as_lit, CACE_ARI_PRIM_BOOL, CHKFALSE, cace_ari_t::is_ref, and cace_ari_lit_t::prim_type.
bool cace_ari_is_lit_typed | ( | const cace_ari_t * | ari, |
cace_ari_type_t | typ | ||
) |
Determine if this is a typed literal of a specific type.
[in] | ari | The value to check. |
typ | The type to compare with. |
References cace_ari_lit_t::ari_type, cace_ari_t::as_lit, cace_ari_lit_t::has_ari_type, and cace_ari_t::is_ref.
bool cace_ari_is_null | ( | const cace_ari_t * | ari | ) |
Determine if this is a typed or untyped null value.
[in] | ari | The value to check. |
References cace_ari_t::as_lit, CACE_ARI_PRIM_NULL, CHKFALSE, cace_ari_t::is_ref, and cace_ari_lit_t::prim_type.
bool cace_ari_is_undefined | ( | const cace_ari_t * | ari | ) |
Determine if a value is the undefined
value.
[in] | ari | The value to check, or a NULL pointer. |
References cace_ari_t::as_lit, CACE_ARI_PRIM_UNDEFINED, CHKFALSE, cace_ari_t::is_ref, and cace_ari_lit_t::prim_type.
bool cace_ari_not_undefined | ( | const cace_ari_t * | ari | ) |
Determine if a value is not the undefined
value.
This can be useful as a CTRL or OPER precondition.
[in] | ari | The value to check, or a NULL pointer. |
References cace_ari_t::as_lit, CACE_ARI_PRIM_UNDEFINED, CHKFALSE, cace_ari_t::is_ref, and cace_ari_lit_t::prim_type.
void cace_ari_set_ac | ( | cace_ari_t * | ari, |
struct cace_ari_ac_s * | src | ||
) |
Set the ARI as an AC, optionally moving values from an external source.
[in,out] | ari | The ARI value to modify. |
[in,out] | src | An optional existing value struct to move from. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_OTHER, CHKVOID, cace_ari_lit_t::has_ari_type, cace_ari_ac_t::items, and M_MEMORY_ALLOC.
void cace_ari_set_am | ( | cace_ari_t * | ari, |
struct cace_ari_am_s * | src | ||
) |
Set the ARI as an AM, optionally moving values from an external source.
[in,out] | ari | The ARI value to modify. |
[in,out] | src | An optional existing value struct to move from. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_OTHER, CHKVOID, cace_ari_lit_t::has_ari_type, cace_ari_am_t::items, and M_MEMORY_ALLOC.
void cace_ari_set_bool | ( | cace_ari_t * | ari, |
cace_ari_bool | src | ||
) |
Set an ARI as a typed literal value.
[in,out] | ari | The ARI to set the value on. This must have been initialized. |
src | The value to set to. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_BOOL, CHKVOID, and cace_ari_lit_t::has_ari_type.
struct cace_ari_execset_s * cace_ari_set_execset | ( | cace_ari_t * | ari | ) |
Set an ARI as an EXECSET literal value.
Any previous value is de-initialized.
[out] | ari | The value to set. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_OTHER, CACE_MALLOC, CHKNULL, and cace_ari_lit_t::has_ari_type.
void cace_ari_set_null | ( | cace_ari_t * | ari | ) |
Set the ARI value to be untyped null.
[in,out] | ari | The value to set. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_NULL, CHKVOID, and cace_ari_lit_t::has_ari_type.
void cace_ari_set_prim_bool | ( | cace_ari_t * | ari, |
cace_ari_bool | src | ||
) |
Set an ARI as an untyped literal value.
[in,out] | ari | The ARI to set the value on. This must have been initialized. |
src | The primitive value to set to. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_BOOL, CHKVOID, and cace_ari_lit_t::has_ari_type.
struct cace_ari_rptset_s * cace_ari_set_rptset | ( | cace_ari_t * | ari | ) |
Set an ARI as an RPTSET literal value.
Any previous value is de-initialized.
[out] | ari | The value to set. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_OTHER, CACE_MALLOC, CHKNULL, and cace_ari_lit_t::has_ari_type.
void cace_ari_set_tbl | ( | cace_ari_t * | ari, |
struct cace_ari_tbl_s * | src | ||
) |
Set the ARI as a TBL, optionally moving values from an external source.
[in,out] | ari | The ARI value to modify. |
[in,out] | src | An optional existing value struct to move from. |
References cace_ari_deinit(), cace_ari_init_lit(), CACE_ARI_PRIM_OTHER, CHKVOID, cace_ari_lit_t::has_ari_type, cace_ari_tbl_t::items, M_MEMORY_ALLOC, and cace_ari_tbl_t::ncols.
void cace_ari_set_undefined | ( | cace_ari_t * | ari | ) |
Set the ARI value to be undefined.
[in,out] | ari | The value to set, which should not be NULL pointer. |
References cace_ari_deinit().