sysrepo  1.4.168
YANG datastore
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
values.h File Reference

Functions for simplified manipulation with Sysrepo values. More...

#include <stdio.h>
#include "../sysrepo.h"
Include dependency graph for values.h:

Go to the source code of this file.

Functions

int sr_new_val (const char *xpath, sr_val_t **value)
 Allocate an instance of Sysrepo value. More...
 
int sr_new_values (size_t value_cnt, sr_val_t **values)
 Allocate an array of sysrepo values. More...
 
int sr_realloc_values (size_t old_value_cnt, size_t new_value_cnt, sr_val_t **values)
 Reallocate an array of sysrepo values. More...
 
int sr_val_set_xpath (sr_val_t *value, const char *xpath)
 Set/change xpath of a Sysrepo value. More...
 
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 list. More...
 
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. More...
 
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 format string and a variable arguments list. More...
 
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. More...
 
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. More...
 
int sr_print_val (const sr_val_t *value)
 Print sysrepo value to STDOUT. More...
 
int sr_print_val_fd (int fd, const sr_val_t *value)
 Print sysrepo value to the specified file descriptor. More...
 
int sr_print_val_stream (FILE *stream, const sr_val_t *value)
 Print sysrepo value to the specified output file stream. More...
 
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 the returned string. More...
 
char * sr_val_to_str (const sr_val_t *value)
 Converts value to string representation. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Functions for simplified manipulation with Sysrepo values.

Author
Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file values.h.