Loading...
Searching...
No Matches
in.h File Reference

libyang input structures and functions More...

`#include <stdio.h>`
`#include "log.h"`
Include dependency graph for in.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Typedefs

typedef enum LY_IN_TYPE | LY_IN_TYPE
| Types of the parser's inputs.

## Enumerations

enum | LY_IN_TYPE { LY_IN_ERROR = -1 , LY_IN_FD , LY_IN_FILE , LY_IN_FILEPATH , LY_IN_MEMORY }
| Types of the parser's inputs. More...

## Functions

LIBYANG_API_DECL int | ly_in_fd (struct ly_in *in, int fd)
| Get or reset file descriptor input handler.
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 void | ly_in_free (struct ly_in *in, ly_bool destroy)
| Free the input handler.
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_new_fd (int fd, struct ly_in **in)
| Create input handler using file descriptor.
LIBYANG_API_DECL LY_ERR | ly_in_new_file (FILE *f, struct ly_in **in)
| Create input handler using file stream.
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 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.
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 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 the object's beginning.
LIBYANG_API_DECL LY_ERR | ly_in_skip (struct ly_in *in, size_t count)
| Just skip bytes in an input.
LIBYANG_API_DECL LY_IN_TYPE | ly_in_type (const struct ly_in *in)
| Get input type of the input handler.

## Detailed Description

libyang input structures and functions

Author
  Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz
  Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz

Copyright (c) 2020 - 2025 CESNET, z.s.p.o.

This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at

    https://opensource.org/licenses/BSD-3-Clause

Definition in file in.h.