decode_parent_ref()

decode_parent_ref()#

Parses a parent reference string into its components: topic name, ID, and hook name. The reference format is ‘parent_topic_name^parent_id^hook_name’.

Prototype

BOOL decode_parent_ref(
    const char *pref,
    char *topic_name,    int topic_name_size,
    char *id,           int id_size,
    char *hook_name,    int hook_name_size
);

Parameters

Key

Type

Description

pref

const char *

The parent reference string in the format ‘parent_topic_name^parent_id^hook_name’.

topic_name

char *

Buffer to store the extracted topic name.

topic_name_size

int

Size of the topic_name buffer.

id

char *

Buffer to store the extracted parent ID.

id_size

int

Size of the id buffer.

hook_name

char *

Buffer to store the extracted hook name.

hook_name_size

int

Size of the hook_name buffer.


Return Value

Returns TRUE if the reference was successfully parsed, otherwise returns FALSE.

Notes

This function is used to extract structured information from a parent reference string, which is used in hierarchical relationships within the tree database.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples