libyang  2.0.112
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
in.h
Go to the documentation of this file.
1 
15 #ifndef LY_IN_H_
16 #define LY_IN_H_
17 
18 #include <stdio.h>
19 
20 #include "log.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
77 struct ly_in;
78 
82 typedef enum LY_IN_TYPE {
83  LY_IN_ERROR = -1,
88 } LY_IN_TYPE;
89 
96 LY_IN_TYPE ly_in_type(const struct ly_in *in);
97 
110 LY_ERR ly_in_reset(struct ly_in *in);
111 
120 LY_ERR ly_in_new_fd(int fd, struct ly_in **in);
121 
130 int ly_in_fd(struct ly_in *in, int fd);
131 
140 LY_ERR ly_in_new_file(FILE *f, struct ly_in **in);
141 
150 FILE *ly_in_file(struct ly_in *in, FILE *f);
151 
162 LY_ERR ly_in_new_memory(const char *str, struct ly_in **in);
163 
174 const char *ly_in_memory(struct ly_in *in, const char *str);
175 
186 LY_ERR ly_in_new_filepath(const char *filepath, size_t len, struct ly_in **in);
187 
202 const char *ly_in_filepath(struct ly_in *in, const char *filepath, size_t len);
203 
210 size_t ly_in_parsed(const struct ly_in *in);
211 
218 void ly_in_free(struct ly_in *in, ly_bool destroy);
219 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* LY_IN_H_ */
Definition: in.h:84
const char * ly_in_filepath(struct ly_in *in, const char *filepath, size_t len)
Get or change the filepath of the file where the parser reads the data.
uint8_t ly_bool
Type to indicate boolean value.
Definition: log.h:25
size_t ly_in_parsed(const struct ly_in *in)
Get the number of parsed bytes by the last function.
LY_ERR ly_in_new_file(FILE *f, struct ly_in **in)
Create input handler using file stream.
void ly_in_free(struct ly_in *in, ly_bool destroy)
Free the input handler.
LY_ERR ly_in_new_fd(int fd, struct ly_in **in)
Create input handler using file descriptor.
const char * ly_in_memory(struct ly_in *in, const char *str)
Get or change memory where the data are read from.
Definition: in.h:83
Parser input structure specifying where the data are read.
Definition: in.h:85
LY_ERR ly_in_new_memory(const char *str, struct ly_in **in)
Create input handler using memory to read data.
int ly_in_fd(struct ly_in *in, int fd)
Get or reset file descriptor input handler.
LY_ERR ly_in_reset(struct ly_in *in)
Reset the input medium to read from its beginning, so the following parser function will read from th...
FILE * ly_in_file(struct ly_in *in, FILE *f)
Get or reset file stream input handler.
LY_IN_TYPE
Types of the parser&#39;s inputs.
Definition: in.h:82
LY_ERR
libyang&#39;s error codes returned by the libyang functions.
Definition: log.h:245
Logger manipulation routines and error definitions.
LY_IN_TYPE ly_in_type(const struct ly_in *in)
Get input type of the input handler.
LY_ERR ly_in_new_filepath(const char *filepath, size_t len, struct ly_in **in)
Create input handler file of the given filename.