blob: 18d7fdcc2f59d729ced5a6bc74c1f1d52216a889 [file] [log] [blame]
Radek Krejci7136a8e2015-08-17 13:37:30 +02001/**
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 *
Radek Krejci54f6fb32016-02-24 12:56:39 +01008 * 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
Michal Vasko10e89e72016-03-01 16:00:27 +010011 *
Radek Krejci54f6fb32016-02-24 12:56:39 +010012 * https://opensource.org/licenses/BSD-3-Clause
Radek Krejci7136a8e2015-08-17 13:37:30 +020013 */
14
Michal Vaskof3e59f12015-06-18 11:53:56 +020015#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
24#include <stdlib.h>
25
Jan Kundrátfd7a5c72017-10-26 17:45:06 +020026#include "libyang.h"
Michal Vaskof3e59f12015-06-18 11:53:56 +020027
28#define PROMPT "> "
29
30struct model_hint {
31 char* hint;
32 struct model_hint* next;
33};
34
35typedef struct {
36 char *name; /* User printable name of the function. */
37 int (*func)(const char*); /* Function to call to do the command. */
38 void (*help_func)(void); /* Display command help. */
39 char *helpstring; /* Documentation for this function. */
40} COMMAND;
41
Radek Krejci6c9cdc12016-10-20 13:24:06 +020042LYS_INFORMAT get_schema_format(const char *path);
Radek Krejci797590b2016-10-10 16:23:04 +020043
Michal Vaskof3e59f12015-06-18 11:53:56 +020044extern COMMAND commands[];
45
Michal Vaskof3e59f12015-06-18 11:53:56 +020046#endif /* COMMANDS_H_ */