DTNMA Reference Tools v2.0.0 - 8.g8c05a00
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains the definitions for ARI object reference paths and their segments. More...
#include "type.h"
#include "cace/config.h"
#include <m-string.h>
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
Data Structures | |
struct | cace_ari_idseg_t |
Represent an identifier component of an ARI. More... | |
struct | cace_ari_date_t |
Represent a decoded date value. More... | |
struct | cace_ari_objpath_t |
The entire object path as part of a full obj_ref_t. More... | |
struct | cace_ari_params_t |
Given parameter storage for an cace_ari_ref_t. More... | |
struct | cace_ari_ref_t |
Represent an object reference or namespace reference ARI in accordance with [5]. More... | |
Typedefs | |
typedef int64_t | cace_ari_int_id_t |
Integer type for object reference parts. | |
Enumerations | |
enum | cace_ari_param_state_e { CACE_ARI_PARAMS_NONE , CACE_ARI_PARAMS_AC , CACE_ARI_PARAMS_AM } |
Indicate the presence of parameters in cace_ari_params_t. | |
Functions | |
void | cace_ari_idseg_init (cace_ari_idseg_t *obj) |
Initialize a null ID segment. | |
void | cace_ari_idseg_deinit (cace_ari_idseg_t *obj) |
void | cace_ari_idseg_copy (cace_ari_idseg_t *obj, const cace_ari_idseg_t *src) |
size_t | cace_ari_idseg_hash (const cace_ari_idseg_t *obj) |
int | cace_ari_idseg_cmp (const cace_ari_idseg_t *left, const cace_ari_idseg_t *right) |
bool | cace_ari_idseg_equal (const cace_ari_idseg_t *left, const cace_ari_idseg_t *right) |
void | cace_ari_idseg_init_text (cace_ari_idseg_t *obj, string_t text) |
Initialize an ID segment from any text. | |
void | cace_ari_idseg_derive_form (cace_ari_idseg_t *idset) |
Derive an integer value if the segment contains text that matches an integer pattern. | |
void | cace_ari_date_init (cace_ari_date_t *obj) |
void | cace_ari_date_deinit (cace_ari_date_t *obj) |
void | cace_ari_date_copy (cace_ari_date_t *obj, const cace_ari_date_t *src) |
int | cace_ari_date_cmp (const cace_ari_date_t *left, const cace_ari_date_t *right) |
int | cace_ari_date_from_text (cace_ari_date_t *obj, const char *text) |
A helper function to decode date text. | |
void | cace_ari_objpath_init (cace_ari_objpath_t *obj) |
void | cace_ari_objpath_deinit (cace_ari_objpath_t *obj) |
void | cace_ari_objpath_copy (cace_ari_objpath_t *obj, const cace_ari_objpath_t *src) |
int | cace_ari_objpath_derive_type (cace_ari_objpath_t *path) |
Derive the ARI Type of a referenced object. | |
void | cace_ari_objpath_set_textid (cace_ari_objpath_t *path, const char *org_id, const char *model_id, cace_ari_type_t type_id, const char *obj_id) |
Set the ARI as an object reference with a specific text-named path. | |
void | cace_ari_objpath_set_textid_opt (cace_ari_objpath_t *path, const char *org_id, const char *model_id, const cace_ari_type_t *type_id, const char *obj_id) |
Set the ARI as an object reference with a specific text-named path. | |
void | cace_ari_objpath_set_intid (cace_ari_objpath_t *path, 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) |
Set the ARI as an object reference with a specific integer-enumerated path. | |
void | cace_ari_objpath_set_intid_opt (cace_ari_objpath_t *path, const cace_ari_int_id_t *org_id, const cace_ari_int_id_t *model_id, const cace_ari_type_t *type_id, const cace_ari_int_id_t *obj_id) |
Set the ARI as an object reference with a specific integer-enumerated path. | |
int | cace_ari_params_deinit (cace_ari_params_t *obj) |
int | cace_ari_params_copy (cace_ari_params_t *obj, const cace_ari_params_t *src) |
void | cace_ari_params_set_ac (cace_ari_params_t *obj, struct cace_ari_list_s *src) |
Set the parameters to a specific state. | |
void | cace_ari_params_set_am (cace_ari_params_t *obj, struct cace_ari_tree_s *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_ref_deinit (cace_ari_ref_t *obj) |
int | cace_ari_ref_copy (cace_ari_ref_t *obj, const cace_ari_ref_t *src) |
This file contains the definitions for ARI object reference paths and their segments.
int cace_ari_date_from_text | ( | cace_ari_date_t * | obj, |
const char * | text | ||
) |
A helper function to decode date text.
[out] | obj | The object to decode into, setting its cace_ari_date_t::valid state depending on decoding success. |
[in] | text | The text to decode. |
References cace_data_deinit(), cace_data_init_view_cstr(), CHKERR1, cace_ari_date_t::parts, and cace_ari_date_t::valid.
void cace_ari_idseg_derive_form | ( | cace_ari_idseg_t * | idset | ) |
Derive an integer value if the segment contains text that matches an integer pattern.
[in,out] | idset | The object to update. |
References cace_ari_idseg_t::as_int, cace_ari_idseg_t::as_text, CHKVOID, and cace_ari_idseg_t::form.
void cace_ari_idseg_init | ( | cace_ari_idseg_t * | obj | ) |
Initialize a null ID segment.
[out] | obj | The segment to initialize. |
References cace_ari_idseg_t::form.
void cace_ari_idseg_init_text | ( | cace_ari_idseg_t * | obj, |
string_t | text | ||
) |
Initialize an ID segment from any text.
[out] | obj | The segment to initialize. |
[in,out] | text | The text to take from and clear. |
References cace_ari_idseg_t::as_text, and cace_ari_idseg_t::form.
int cace_ari_objpath_derive_type | ( | cace_ari_objpath_t * | path | ) |
Derive the ARI Type of a referenced object.
This sets the cace_ari_objpath_t::ari_type based on the cace_ari_objpath_t::type_id value.
[in,out] | path | The object to update. |
References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_int, cace_ari_idseg_t::as_text, CHKERR1, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, and cace_ari_objpath_t::type_id.
Referenced by cace_ari_cbor_decode_stream().
void cace_ari_objpath_set_intid | ( | cace_ari_objpath_t * | path, |
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 | ||
) |
Set the ARI as an object reference with a specific integer-enumerated path.
[in,out] | path | The path to modify. |
[in] | org_id | The organization ID. |
[in] | model_id | The model ID. |
type_id | The object type ID. | |
[in] | obj_id | The object ID. |
References cace_ari_objpath_set_intid_opt().
Referenced by cace_ari_set_objref_path_intid().
void cace_ari_objpath_set_intid_opt | ( | cace_ari_objpath_t * | path, |
const cace_ari_int_id_t * | org_id, | ||
const cace_ari_int_id_t * | model_id, | ||
const cace_ari_type_t * | type_id, | ||
const cace_ari_int_id_t * | obj_id | ||
) |
Set the ARI as an object reference with a specific integer-enumerated path.
For all pointer arguments, the pointed-to lifetime does not need to outlast this function call. Pointed-to values are copied into the path.
[in,out] | path | The path to modify. |
[in] | org_id | The organization ID, or NULL for none. |
[in] | model_id | The model ID, or NULL for none. |
type_id | The object type ID, or NULL for none. | |
[in] | obj_id | The object ID, or NULL for none. |
References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_int, CHKVOID, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, cace_ari_objpath_t::model_id, cace_ari_objpath_t::obj_id, cace_ari_objpath_t::org_id, and cace_ari_objpath_t::type_id.
Referenced by cace_ari_objpath_set_intid().
void cace_ari_objpath_set_textid | ( | cace_ari_objpath_t * | path, |
const char * | org_id, | ||
const char * | model_id, | ||
cace_ari_type_t | type_id, | ||
const char * | obj_id | ||
) |
Set the ARI as an object reference with a specific text-named path.
[in,out] | path | The path to modify. |
[in] | org_id | The organization ID. |
[in] | model_id | The model ID. |
type_id | The object type ID. | |
[in] | obj_id | The object ID. |
References cace_ari_objpath_set_textid_opt().
Referenced by cace_ari_set_objref_path_textid().
void cace_ari_objpath_set_textid_opt | ( | cace_ari_objpath_t * | path, |
const char * | org_id, | ||
const char * | model_id, | ||
const cace_ari_type_t * | type_id, | ||
const char * | obj_id | ||
) |
Set the ARI as an object reference with a specific text-named path.
For all pointer arguments, the pointed-to lifetime does not need to outlast this function call. Pointed-to values are copied into the path.
[in,out] | path | The path to modify. |
[in] | org_id | The organization ID, or NULL for none. |
[in] | model_id | The model ID, or NULL for none. |
type_id | The object type ID, or NULL for none. | |
[in] | obj_id | The object ID, or NULL for none. |
References cace_ari_objpath_t::ari_type, cace_ari_idseg_t::as_text, CHKVOID, cace_ari_idseg_t::form, cace_ari_objpath_t::has_ari_type, cace_ari_objpath_t::model_id, cace_ari_objpath_t::obj_id, cace_ari_objpath_t::org_id, and cace_ari_objpath_t::type_id.
Referenced by cace_ari_objpath_set_textid().
void cace_ari_params_set_ac | ( | cace_ari_params_t * | obj, |
struct cace_ari_list_s * | src | ||
) |
Set the parameters to a specific state.
[in,out] | obj | The state to modify, which must already be initialized. |
[in,out] | src | An optional existing value struct to move from. |
References cace_ari_params_t::as_ac, CACE_MALLOC, CHKVOID, cace_ari_ac_t::items, and cace_ari_params_t::state.