All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Functions
cli_plugin.h File Reference
#include <stdio.h>
#include <inttypes.h>
#include <netinet/in.h>

Go to the source code of this file.

Data Structures

struct  cli_syntaxmode_t
struct  cli_plugin
struct  cli_syntax_t


typedef void( clicon_callback_t )(clicon_handle h)
typedef int( cli_valcb_t )(cvec *vars, cg_var *cgv, cg_var *arg)
typedef char *( cli_prompthook_t )(clicon_handle, char *mode)
typedef int( cli_susphook_t )(clicon_handle, char *, int, int *)
typedef char *( cli_parsehook_t )(clicon_handle, char *, char *)


void * clixon_str2fn (char *name, void *handle, char **error)
int cli_plugin_start (clicon_handle, int argc, char **argv)
int cli_plugin_init (clicon_handle h)
int clicon_eval (clicon_handle h, char *cmd, cg_obj *match_obj, cvec *vr)
int clicon_parse (clicon_handle h, char *cmd, char **mode, int *result)
char * clicon_cliread (clicon_handle h)
int cli_plugin_finish (clicon_handle h)

Typedef Documentation

typedef char*( cli_parsehook_t)(clicon_handle, char *, char *)
typedef char*( cli_prompthook_t)(clicon_handle, char *mode)
typedef int( cli_susphook_t)(clicon_handle, char *, int, int *)
typedef int( cli_valcb_t)(cvec *vars, cg_var *cgv, cg_var *arg)
typedef void( clicon_callback_t)(clicon_handle h)

Function Documentation

int cli_plugin_finish ( clicon_handle  h)
int cli_plugin_init ( clicon_handle  h)

Initialize plugin code (not the plugins themselves)

int cli_plugin_start ( clicon_handle  ,
int  argc,
char **  argv 
char* clicon_cliread ( clicon_handle  h)
int clicon_eval ( clicon_handle  h,
char *  cmd,
cg_obj *  match_obj,
cvec *  vr 
int clicon_parse ( clicon_handle  h,
char *  cmd,
char **  mode,
int *  result 
void* clixon_str2fn ( char *  name,
void *  handle,
char **  error 

Dynamic linking loader string to function mapper

Maps strings from the CLI specification file to real funtions using dlopen mapping. First look for function name in local namespace if handle given (given plugin) Then check global namespace, i.e.m lib*.so

[in]nameName of function
[in]handleHandle to plugin .so module as returned by dlopen
[out]errorStatic error string, if set indicates error
Return values
fnFunction pointer
NULLFUnction not found or symbol NULL (check error for proper handling)
See Also
see cli_plugin_load where (optional) handle opened
the returned function is not type-checked which may result in segv at runtime