sysrepo  1.4.168
YANG datastore
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
values.h
Go to the documentation of this file.
1 
22 #ifndef SYSREPO_VALUES_H_
23 #define SYSREPO_VALUES_H_
24 
25 #include <stdio.h>
26 
27 #include "../sysrepo.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
61 int sr_new_val(const char *xpath, sr_val_t **value);
62 
69 int sr_new_values(size_t value_cnt, sr_val_t **values);
70 
78 int sr_realloc_values(size_t old_value_cnt, size_t new_value_cnt, sr_val_t **values);
79 
86 int sr_val_set_xpath(sr_val_t *value, const char *xpath);
87 
95 int sr_val_build_xpath(sr_val_t *value, const char *format, ...);
96 
104 int sr_val_set_str_data(sr_val_t *value, sr_type_t type, const char *string_val);
105 
114 int sr_val_build_str_data(sr_val_t *value, sr_type_t type, const char *format, ...);
115 
123 int sr_dup_val(const sr_val_t *value, sr_val_t **value_dup);
124 
133 int sr_dup_values(const sr_val_t *values, size_t count, sr_val_t **values_dup);
134 
140 int sr_print_val(const sr_val_t *value);
141 
148 int sr_print_val_fd(int fd, const sr_val_t *value);
149 
156 int sr_print_val_stream(FILE *stream, const sr_val_t *value);
157 
165 int sr_print_val_mem(char **mem_p, const sr_val_t *value);
166 
174 char *sr_val_to_str(const sr_val_t *value);
175 
187 int sr_val_to_buff(const sr_val_t *value, char buffer[], size_t size);
188 
202 int sr_tree_to_val(const struct lyd_node *data, const char *path, sr_val_t **value);
203 
217 int sr_tree_to_values(const struct lyd_node *data, const char *xpath, sr_val_t **values, size_t *value_cnt);
218 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #endif /* SYSREPO_VALUES_H_ */
int sr_tree_to_values(const struct lyd_node *data, const char *xpath, sr_val_t **values, size_t *value_cnt)
Finds subtree from given struct lyd_node type data tree and converts it to sr_val_t.
Structure that contains value of an data element stored in the sysrepo datastore. ...
Definition: sysrepo.h:696
char * sr_val_to_str(const sr_val_t *value)
Converts value to string representation.
int sr_print_val_stream(FILE *stream, const sr_val_t *value)
Print sysrepo value to the specified output file stream.
int sr_dup_values(const sr_val_t *values, size_t count, sr_val_t **values_dup)
Duplicate values (with or without Sysrepo memory context) into a new array with memory context...
int sr_print_val_mem(char **mem_p, const sr_val_t *value)
Print sysrepo value into a newly allocated memory buffer. The caller is expected to eventually free t...
int sr_val_build_xpath(sr_val_t *value, const char *format,...)
Set/change xpath of a Sysrepo value to a new one, built from a format string and a variable arguments...
int sr_print_val(const sr_val_t *value)
Print sysrepo value to STDOUT.
int sr_val_set_str_data(sr_val_t *value, sr_type_t type, const char *string_val)
Store data of string type into the Sysrepo value data.
int sr_realloc_values(size_t old_value_cnt, size_t new_value_cnt, sr_val_t **values)
Reallocate an array of sysrepo values.
int sr_tree_to_val(const struct lyd_node *data, const char *path, sr_val_t **value)
Finds single node from given struct lyd_node type data tree and converts it to sr_val_t.
int sr_dup_val(const sr_val_t *value, sr_val_t **value_dup)
Duplicate value (with or without Sysrepo memory context) into a new instance with memory context...
int sr_print_val_fd(int fd, const sr_val_t *value)
Print sysrepo value to the specified file descriptor.
enum sr_type_e sr_type_t
Possible types of a data element stored in the sysrepo datastore.
int sr_val_to_buff(const sr_val_t *value, char buffer[], size_t size)
Converts value to string and prints it to the provided buffer including terminating NULL byte...
int sr_val_build_str_data(sr_val_t *value, sr_type_t type, const char *format,...)
Store data of string type into the Sysrepo value data. The actual data will be built from the a forma...
int sr_val_set_xpath(sr_val_t *value, const char *xpath)
Set/change xpath of a Sysrepo value.
int sr_new_val(const char *xpath, sr_val_t **value)
Allocate an instance of Sysrepo value.
int sr_new_values(size_t value_cnt, sr_val_t **values)
Allocate an array of sysrepo values.