Here we give the main function for the application of the command interpreter library.
#include "interp.h" #include "funct_graph.h" pfi *proc[] = { proc_func, proc_graph, proc_func_graph, proc_geom, NULL, }; FUNCTION *Funcs; FUNCTIONC *Funcs_C; FUNCTIONGen *Funcs_Gen[] = { }; /*------------------------------------------------- No custom sections of the initialization file -------------------------------------------------*/ pfib procb_user[] = { NULL, }; char *namesb_user[] = { "", }; /*------------------------------------------------- -------------------------------------------------*/ extern int int_nb; extern char int_txt[]; int main(int argc, char *argv[]) { Funcs = Funcs_func; _NBFONC = _NBFONC_FUNC; Funcs_C = Funcs_interp_C; _NBFONC_C = _NBFONC0_C; User_Init_File = ".funct"; prog_c(argc, argv, NULL, int_txt, int_nb, NULL, 0); return 0; }
Here three arrays of commands are defined, each one corresponding to a section !func of the initialization file funct.ini. A new array of functions for the expression evaluator is used instead of the default one. These arrays of commands and functions are defined in other source files.