blob: 9f6f88dafebc8516dc3fd50a500a523a2137dc2a [file] [log] [blame]
Radek Krejcie9f13b12020-11-09 17:42:04 +01001/**
2 * @file cmd.h
3 * @author Michal Vasko <mvasko@cesnet.cz>
4 * @author Radek Krejci <rkrejci@cesnet.cz>
5 * @brief libyang's yanglint tool commands header
6 *
7 * Copyright (c) 2015-2020 CESNET, z.s.p.o.
8 *
9 * This source code is licensed under BSD 3-Clause License (the "License").
10 * You may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * https://opensource.org/licenses/BSD-3-Clause
14 */
15
16#ifndef COMMANDS_H_
17#define COMMANDS_H_
18
19#include "libyang.h"
20
21/**
22 * @brief command information
23 */
24typedef struct {
25 char *name; /* User printable name of the function. */
Michal Vasko26bbb272022-08-02 14:54:33 +020026
Radek Krejcie9f13b12020-11-09 17:42:04 +010027 void (*func)(struct ly_ctx **ctx, const char *); /* Function to call to do the command. */
28 void (*help_func)(void); /* Display command help. */
29 char *helpstring; /* Documentation for this function. */
30} COMMAND;
31
32/**
33 * @brief The list of available commands.
34 */
35extern COMMAND commands[];
36
37/* cmd_add.c */
38void cmd_add(struct ly_ctx **ctx, const char *cmdline);
39void cmd_add_help(void);
40
41/* cmd_clear.c */
42void cmd_clear(struct ly_ctx **ctx, const char *cmdline);
43void cmd_clear_help(void);
44
45/* cmd_data.c */
46void cmd_data(struct ly_ctx **ctx, const char *cmdline);
47void cmd_data_help(void);
48
49/* cmd_list.c */
50void cmd_list(struct ly_ctx **ctx, const char *cmdline);
51void cmd_list_help(void);
52
Michal Vasko538be422021-10-19 14:06:59 +020053/* cmd_feature.c */
54void cmd_feature(struct ly_ctx **ctx, const char *cmdline);
55void cmd_feature_help(void);
56
Radek Krejcie9f13b12020-11-09 17:42:04 +010057/* cmd_load.c */
58void cmd_load(struct ly_ctx **ctx, const char *cmdline);
59void cmd_load_help(void);
60
61/* cmd_print.c */
62void cmd_print(struct ly_ctx **ctx, const char *cmdline);
63void cmd_print_help(void);
64
65/* cmd_searchpath.c */
66void cmd_searchpath(struct ly_ctx **ctx, const char *cmdline);
67void cmd_searchpath_help(void);
68
69#endif /* COMMANDS_H_ */