#include "builtins.h"
#include "editline.h"
#include <string>
#include <vector>
#include <map>
Go to the source code of this file.
Typedefs | |
typedef std::vector< ElBuiltin_t * > | BuiltinVec_t |
typedef std::map< std::string, ElBuiltin_t > | BuiltinMap_t |
Functions | |
BuiltinMap_t & | el_internal_builtins () |
void | el_builtins_init () |
void | el_register_function (const char *name, ElBuiltin_t::handler_func f, const char *help) |
ElBuiltin_t ** | el_builtins_list (int *count) |
int | el_func_readline_reinit (EditLine_t *el, int, const char **) |
int | el_func_show_function_list (EditLine_t *el, int, const char **) |
ElBuiltin_t * | el_builtin_by_name (const char *name) |
Variables | |
int | el_builtins_bogo_register = (el_builtins_init(), 0) |
BuiltinVec_t | el_builtins_vec |
typedef std::map<std::string, ElBuiltin_t> BuiltinMap_t |
Definition at line 18 of file builtins.cxx.
typedef std::vector<ElBuiltin_t*> BuiltinVec_t |
Definition at line 17 of file builtins.cxx.
ElBuiltin_t* el_builtin_by_name | ( | const char * | ) |
Returns the builtin function for the given name, or NULL if none is found. The client may modify the function, but should not delete it
(added by stephan)
Definition at line 109 of file builtins.cxx.
References el_internal_builtins(), and NULL.
Referenced by el_parse().
void el_builtins_init | ( | ) |
Definition at line 31 of file builtins.cxx.
References el_editmode(), el_func_readline_reinit(), el_func_show_function_list(), el_internal_builtins(), el_register_function(), hist_list(), map_bind(), size, term_echotc(), term_settc(), term_telltc(), and tty_stty().
ElBuiltin_t** el_builtins_list | ( | int * | count | ) |
Returns an array of ElBuiltin_t objects. The caller does NOT own it - it is a shared list. The list may become invalided upon later registration of functions, so don't hold on to it.
The variable count is set to the number of items in the returned list.
(added by stephan)
Definition at line 58 of file builtins.cxx.
References el_builtins_vec, and el_internal_builtins().
int el_func_readline_reinit | ( | EditLine_t * | el, | |
int | , | |||
const char ** | ||||
) |
Calls rl_initialize(), to reset the internal EditLine_t to a sane state.
Definition at line 78 of file builtins.cxx.
References EditLine_t::fOutFile, fprintf(), and rl_initialize().
Referenced by el_builtins_init().
int el_func_show_function_list | ( | EditLine_t * | el, | |
int | , | |||
const char ** | ||||
) |
Shows list of built-in functions via el->fOutFile.
Definition at line 90 of file builtins.cxx.
References el_internal_builtins(), ElBuiltin_t::fHelp, ElBuiltin_t::fName, EditLine_t::fOutFile, fprintf(), and NULL.
Referenced by el_builtins_init().
BuiltinMap_t& el_internal_builtins | ( | ) |
Returns the internal map of builtin functions.
Definition at line 24 of file builtins.cxx.
Referenced by el_builtin_by_name(), el_builtins_init(), el_builtins_list(), el_func_show_function_list(), and el_register_function().
void el_register_function | ( | const char * | name, | |
ElBuiltin_t::handler_func | f, | |||
const char * | help = NULL | |||
) |
Registers f as a built-in function handler.
(added by stephan)
Definition at line 51 of file builtins.cxx.
References el_internal_builtins().
Referenced by el_builtins_init().
int el_builtins_bogo_register = (el_builtins_init(), 0) |
Definition at line 47 of file builtins.cxx.