libyang 5.0.8
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
in.h
Go to the documentation of this file.
1
15
16#ifndef LY_IN_H_
17#define LY_IN_H_
18
19#include <stdio.h>
20
21#include "log.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
73
82
87struct ly_in;
88
99
106LIBYANG_API_DECL LY_IN_TYPE ly_in_type(const struct ly_in *in);
107
120LIBYANG_API_DECL LY_ERR ly_in_reset(struct ly_in *in);
121
130LIBYANG_API_DECL LY_ERR ly_in_new_fd(int fd, struct ly_in **in);
131
140LIBYANG_API_DECL int ly_in_fd(struct ly_in *in, int fd);
141
150LIBYANG_API_DECL LY_ERR ly_in_new_file(FILE *f, struct ly_in **in);
151
160LIBYANG_API_DECL FILE *ly_in_file(struct ly_in *in, FILE *f);
161
172LIBYANG_API_DECL LY_ERR ly_in_new_memory(const char *str, struct ly_in **in);
173
184LIBYANG_API_DECL const char *ly_in_memory(struct ly_in *in, const char *str);
185
196LIBYANG_API_DECL LY_ERR ly_in_new_filepath(const char *filepath, size_t len, struct ly_in **in);
197
212LIBYANG_API_DECL const char *ly_in_filepath(struct ly_in *in, const char *filepath, size_t len);
213
220LIBYANG_API_DECL size_t ly_in_parsed(const struct ly_in *in);
221
229LIBYANG_API_DECL void ly_in_free(struct ly_in *in, ly_bool destroy);
230
243LIBYANG_API_DECL LY_ERR ly_in_read(struct ly_in *in, void *buf, size_t count);
244
256LIBYANG_API_DECL LY_ERR ly_in_peek(struct ly_in *in, uint8_t *peek);
257
269LIBYANG_API_DECL LY_ERR ly_in_skip(struct ly_in *in, size_t count);
270
272
273#ifdef __cplusplus
274}
275#endif
276
277#endif /* LY_IN_H_ */
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:252
LIBYANG_API_DECL LY_ERR ly_in_skip(struct ly_in *in, size_t count)
Just skip bytes in an input.
LIBYANG_API_DECL FILE * ly_in_file(struct ly_in *in, FILE *f)
Get or reset file stream input handler.
LIBYANG_API_DECL 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.
LIBYANG_API_DECL LY_ERR ly_in_new_file(FILE *f, struct ly_in **in)
Create input handler using file stream.
LIBYANG_API_DECL int ly_in_fd(struct ly_in *in, int fd)
Get or reset file descriptor input handler.
LIBYANG_API_DECL LY_IN_TYPE ly_in_type(const struct ly_in *in)
Get input type of the input handler.
LIBYANG_API_DECL LY_ERR ly_in_new_fd(int fd, struct ly_in **in)
Create input handler using file descriptor.
LIBYANG_API_DECL LY_ERR ly_in_new_filepath(const char *filepath, size_t len, struct ly_in **in)
Create input handler file of the given filename.
LIBYANG_API_DECL const char * ly_in_memory(struct ly_in *in, const char *str)
Get or change memory where the data are read from.
LIBYANG_API_DECL 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...
LIBYANG_API_DECL LY_ERR ly_in_read(struct ly_in *in, void *buf, size_t count)
Read bytes from an input.
LIBYANG_API_DECL void ly_in_free(struct ly_in *in, ly_bool destroy)
Free the input handler.
LIBYANG_API_DECL LY_ERR ly_in_peek(struct ly_in *in, uint8_t *peek)
Peek at the next byte in an input.
LIBYANG_API_DECL LY_ERR ly_in_new_memory(const char *str, struct ly_in **in)
Create input handler using memory to read data.
LIBYANG_API_DECL size_t ly_in_parsed(const struct ly_in *in)
Get the number of parsed bytes by the last function.
LY_IN_TYPE
Types of the parser's inputs.
Definition in.h:92
@ LY_IN_FD
Definition in.h:94
@ LY_IN_FILE
Definition in.h:95
@ LY_IN_MEMORY
Definition in.h:97
@ LY_IN_FILEPATH
Definition in.h:96
@ LY_IN_ERROR
Definition in.h:93
Parser input structure specifying the type of data input.
Logger manipulation routines and error definitions.
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:36