libyang
6.4.3
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
16
#ifndef LY_IN_H_
17
#define LY_IN_H_
18
19
#include <stdio.h>
20
21
#include "
log.h
"
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
89
struct
ly_in
;
90
94
typedef
enum
LY_IN_TYPE
{
95
LY_IN_ERROR
= -1,
96
LY_IN_FD
,
97
LY_IN_FILE
,
98
LY_IN_FILEPATH
,
99
LY_IN_MEMORY
100
}
LY_IN_TYPE
;
101
108
LIBYANG_API_DECL
LY_IN_TYPE
ly_in_type
(
const
struct
ly_in
*in);
109
122
LIBYANG_API_DECL
LY_ERR
ly_in_reset
(
struct
ly_in
*in);
123
132
LIBYANG_API_DECL
LY_ERR
ly_in_new_fd
(
int
fd,
struct
ly_in
**in);
133
142
LIBYANG_API_DECL
int
ly_in_fd
(
struct
ly_in
*in,
int
fd);
143
152
LIBYANG_API_DECL
LY_ERR
ly_in_new_file
(FILE *f,
struct
ly_in
**in);
153
162
LIBYANG_API_DECL FILE *
ly_in_file
(
struct
ly_in
*in, FILE *f);
163
176
LIBYANG_API_DECL
LY_ERR
ly_in_new_memory
(
const
char
*str,
struct
ly_in
**in);
177
190
LIBYANG_API_DECL
LY_ERR
ly_in_new_memory_chunk
(
const
void
*mem, uint32_t mem_len,
struct
ly_in
**in);
191
204
LIBYANG_API_DECL
const
char
*
ly_in_memory
(
struct
ly_in
*in,
const
char
*str);
205
218
LIBYANG_API_DECL
const
void
*
ly_in_memory_chunk
(
struct
ly_in
*in,
const
void
*mem, uint32_t mem_len);
219
230
LIBYANG_API_DECL
LY_ERR
ly_in_new_filepath
(
const
char
*filepath,
size_t
len,
struct
ly_in
**in);
231
246
LIBYANG_API_DECL
const
char
*
ly_in_filepath
(
struct
ly_in
*in,
const
char
*filepath,
size_t
len);
247
254
LIBYANG_API_DECL
size_t
ly_in_parsed
(
const
struct
ly_in
*in);
255
263
LIBYANG_API_DECL
void
ly_in_free
(
struct
ly_in
*in,
ly_bool
destroy);
264
277
LIBYANG_API_DECL
LY_ERR
ly_in_read
(
struct
ly_in
*in,
void
*buf,
size_t
count);
278
290
LIBYANG_API_DECL
LY_ERR
ly_in_peek
(
struct
ly_in
*in, uint8_t *peek);
291
303
LIBYANG_API_DECL
LY_ERR
ly_in_skip
(
struct
ly_in
*in,
size_t
count);
304
307
#ifdef __cplusplus
308
}
309
#endif
310
311
#endif
/* LY_IN_H_ */
LY_ERR
LY_ERR
libyang's error codes returned by the libyang functions.
Definition
log.h:252
ly_in_skip
LIBYANG_API_DECL LY_ERR ly_in_skip(struct ly_in *in, size_t count)
Just skip bytes in an input.
ly_in_file
LIBYANG_API_DECL FILE * ly_in_file(struct ly_in *in, FILE *f)
Get or reset file stream input handler.
ly_in_filepath
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.
ly_in_new_file
LIBYANG_API_DECL LY_ERR ly_in_new_file(FILE *f, struct ly_in **in)
Create input handler using file stream.
ly_in_fd
LIBYANG_API_DECL int ly_in_fd(struct ly_in *in, int fd)
Get or reset file descriptor input handler.
ly_in_type
LIBYANG_API_DECL LY_IN_TYPE ly_in_type(const struct ly_in *in)
Get input type of the input handler.
ly_in_new_fd
LIBYANG_API_DECL LY_ERR ly_in_new_fd(int fd, struct ly_in **in)
Create input handler using file descriptor.
ly_in_new_filepath
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.
ly_in_memory
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.
ly_in_reset
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...
ly_in_memory_chunk
LIBYANG_API_DECL const void * ly_in_memory_chunk(struct ly_in *in, const void *mem, uint32_t mem_len)
Get or change memory where the data are read from.
ly_in_read
LIBYANG_API_DECL LY_ERR ly_in_read(struct ly_in *in, void *buf, size_t count)
Read bytes from an input.
ly_in_free
LIBYANG_API_DECL void ly_in_free(struct ly_in *in, ly_bool destroy)
Free the input handler.
ly_in_peek
LIBYANG_API_DECL LY_ERR ly_in_peek(struct ly_in *in, uint8_t *peek)
Peek at the next byte in an input.
ly_in_new_memory
LIBYANG_API_DECL LY_ERR ly_in_new_memory(const char *str, struct ly_in **in)
Create input handler using memory to read data.
ly_in_parsed
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
LY_IN_TYPE
Types of the parser's inputs.
Definition
in.h:94
ly_in_new_memory_chunk
LIBYANG_API_DECL LY_ERR ly_in_new_memory_chunk(const void *mem, uint32_t mem_len, struct ly_in **in)
Create input handler using a fixed-size memory chunk to read data.
LY_IN_FD
@ LY_IN_FD
Definition
in.h:96
LY_IN_FILE
@ LY_IN_FILE
Definition
in.h:97
LY_IN_MEMORY
@ LY_IN_MEMORY
Definition
in.h:99
LY_IN_FILEPATH
@ LY_IN_FILEPATH
Definition
in.h:98
LY_IN_ERROR
@ LY_IN_ERROR
Definition
in.h:95
ly_in
Parser input structure specifying the type of data input.
log.h
Logger manipulation routines and error definitions.
ly_bool
uint8_t ly_bool
Type to indicate boolean value.
Definition
log.h:36
src
in.h
Privacy Policy
Generated on Sat Sep 19 2026 16:00:30 for libyang by
1.9.8