File: context.h

package info (click to toggle)
libyang 0.16.105-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,544 kB
  • sloc: ansic: 96,743; xml: 9,300; cpp: 5,023; python: 1,637; java: 1,448; lex: 281; sh: 158; makefile: 72
file content (54 lines) | stat: -rw-r--r-- 1,469 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * @file context.h
 * @author Radek Krejci <rkrejci@cesnet.cz>
 * @brief internal context structures and functions
 *
 * Copyright (c) 2015 - 2017 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
 */

#ifndef LY_CONTEXT_H_
#define LY_CONTEXT_H_

#include <pthread.h>

#include "libyang.h"
#include "common.h"
#include "hash_table.h"
#include "tree_schema.h"

struct ly_modules_list {
    char **search_paths;
    int size;
    int used;
    struct lys_module **list;
    /* all (sub)modules that are currently being parsed */
    struct lys_module **parsing_sub_modules;
    /* all already parsed submodules of a module, which is before all its submodules (to mark submodule imports) */
    struct lys_module **parsed_submodules;
    uint8_t parsing_sub_modules_count;
    uint8_t parsed_submodules_count;
    uint16_t module_set_id;
    int flags; /* see @ref contextoptions. */
};

struct ly_ctx {
    struct dict_table dict;
    struct ly_modules_list models;
    ly_module_imp_clb imp_clb;
    void *imp_clb_data;
    ly_module_data_clb data_clb;
    void *data_clb_data;
#ifdef LY_ENABLED_LYD_PRIV
    void *(*priv_dup_clb)(const void *priv);
#endif
    pthread_key_t errlist_key;
    uint8_t internal_module_count;
};

#endif /* LY_CONTEXT_H_ */