CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
clixon_cli.h
Go to the documentation of this file.
1 /*
2  *
3  ***** BEGIN LICENSE BLOCK *****
4 
5  Copyright (C) 2009-2017 Olof Hagsand and Benny Holmgren
6 
7  This file is part of CLIXON.
8 
9  Licensed under the Apache License, Version 2.0 (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  http://www.apache.org/licenses/LICENSE-2.0
14 
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20 
21  Alternatively, the contents of this file may be used under the terms of
22  the GNU General Public License Version 3 or later (the "GPL"),
23  in which case the provisions of the GPL are applicable instead
24  of those above. If you wish to allow use of your version of this file only
25  under the terms of the GPL, and not to allow others to
26  use your version of this file under the terms of Apache License version 2,
27  indicate your decision by deleting the provisions above and replace them with
28  the notice and other provisions required by the GPL. If you do not delete
29  the provisions above, a recipient may use your version of this file under
30  the terms of any one of the Apache License version 2 or the GPL.
31 
32  ***** END LICENSE BLOCK *****
33 
34  */
35 
36 #ifndef _CLIXON_CLI_H_
37 #define _CLIXON_CLI_H_
38 
39 #include <sys/types.h>
40 
41 /* Common code (API and clicon_cli) */
42 #include <clixon/clixon_cli_api.h>
43 
50 int plugin_init(clicon_handle h);
51 
52 /* Called when backend started with cmd-line arguments from daemon call.
53  * @see plgstart_t
54  */
55 int plugin_start(clicon_handle h, int argc, char **argv);
56 
57 /* Called just before plugin unloaded.
58  * @see plgexit_t
59  */
60 int plugin_exit(clicon_handle h);
61 
62 
63 /* Called before prompt is printed, return a customized prompt. */
64 char *plugin_prompt_hook(clicon_handle h, char *mode);
65 
66 /* Called if a command is not matched w current mode. Return name of next syntax mode to check until NULL */
67 char *plugin_parse_hook(clicon_handle h, char *cmd, char *name);
68 
69 /* Called if ^Z entered. Can modify cli command buffer and position */
70 int plugin_susp_hook(clicon_handle h, char *buf, int prompt_width, int *cursor_loc);
71 
72 #endif /* _CLIXON_CLI_H_ */
int plugin_susp_hook(clicon_handle h, char *buf, int prompt_width, int *cursor_loc)
int plugin_exit(clicon_handle h)
int plugin_init(clicon_handle h)
char * plugin_prompt_hook(clicon_handle h, char *mode)
char * plugin_parse_hook(clicon_handle h, char *cmd, char *name)
int plugin_start(clicon_handle h, int argc, char **argv)