Radek Krejci | ed5acc5 | 2019-04-25 15:57:04 +0200 | [diff] [blame] | 1 | /** |
| 2 | * @file main.c |
| 3 | * @author Michal Vasko <mvasko@cesnet.cz> |
| 4 | * @brief libyang's yanglint tool commands header |
| 5 | * |
| 6 | * Copyright (c) 2015 CESNET, z.s.p.o. |
| 7 | * |
| 8 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 9 | * You may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * https://opensource.org/licenses/BSD-3-Clause |
| 13 | */ |
| 14 | |
| 15 | #ifndef COMMANDS_H_ |
| 16 | #define COMMANDS_H_ |
| 17 | |
| 18 | #ifdef __GNUC__ |
| 19 | # define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) |
| 20 | #else |
| 21 | # define UNUSED(x) UNUSED_ ## x |
| 22 | #endif |
| 23 | |
Radek Krejci | ed5acc5 | 2019-04-25 15:57:04 +0200 | [diff] [blame] | 24 | #include "libyang.h" |
| 25 | |
| 26 | #define PROMPT "> " |
| 27 | |
| 28 | struct model_hint { |
| 29 | char* hint; |
| 30 | struct model_hint* next; |
| 31 | }; |
| 32 | |
| 33 | typedef struct { |
| 34 | char *name; /* User printable name of the function. */ |
| 35 | int (*func)(const char*); /* Function to call to do the command. */ |
| 36 | void (*help_func)(void); /* Display command help. */ |
| 37 | char *helpstring; /* Documentation for this function. */ |
| 38 | } COMMAND; |
| 39 | |
| 40 | LYS_INFORMAT get_schema_format(const char *path); |
| 41 | |
| 42 | extern COMMAND commands[]; |
| 43 | |
| 44 | #endif /* COMMANDS_H_ */ |