Radek Krejci | e9f13b1 | 2020-11-09 17:42:04 +0100 | [diff] [blame] | 1 | /** |
| 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 | */ |
| 24 | typedef struct { |
| 25 | char *name; /* User printable name of the function. */ |
| 26 | void (*func)(struct ly_ctx **ctx, const char *); /* Function to call to do the command. */ |
| 27 | void (*help_func)(void); /* Display command help. */ |
| 28 | char *helpstring; /* Documentation for this function. */ |
| 29 | } COMMAND; |
| 30 | |
| 31 | /** |
| 32 | * @brief The list of available commands. |
| 33 | */ |
| 34 | extern COMMAND commands[]; |
| 35 | |
| 36 | /* cmd_add.c */ |
| 37 | void cmd_add(struct ly_ctx **ctx, const char *cmdline); |
| 38 | void cmd_add_help(void); |
| 39 | |
| 40 | /* cmd_clear.c */ |
| 41 | void cmd_clear(struct ly_ctx **ctx, const char *cmdline); |
| 42 | void cmd_clear_help(void); |
| 43 | |
| 44 | /* cmd_data.c */ |
| 45 | void cmd_data(struct ly_ctx **ctx, const char *cmdline); |
| 46 | void cmd_data_help(void); |
| 47 | |
| 48 | /* cmd_list.c */ |
| 49 | void cmd_list(struct ly_ctx **ctx, const char *cmdline); |
| 50 | void cmd_list_help(void); |
| 51 | |
Michal Vasko | 538be42 | 2021-10-19 14:06:59 +0200 | [diff] [blame] | 52 | /* cmd_feature.c */ |
| 53 | void cmd_feature(struct ly_ctx **ctx, const char *cmdline); |
| 54 | void cmd_feature_help(void); |
| 55 | |
Radek Krejci | e9f13b1 | 2020-11-09 17:42:04 +0100 | [diff] [blame] | 56 | /* cmd_load.c */ |
| 57 | void cmd_load(struct ly_ctx **ctx, const char *cmdline); |
| 58 | void cmd_load_help(void); |
| 59 | |
| 60 | /* cmd_print.c */ |
| 61 | void cmd_print(struct ly_ctx **ctx, const char *cmdline); |
| 62 | void cmd_print_help(void); |
| 63 | |
| 64 | /* cmd_searchpath.c */ |
| 65 | void cmd_searchpath(struct ly_ctx **ctx, const char *cmdline); |
| 66 | void cmd_searchpath_help(void); |
| 67 | |
| 68 | #endif /* COMMANDS_H_ */ |