builtins.h

Go to the documentation of this file.
00001 // @(#)root/editline:$Id: builtins.h 30194 2009-09-16 12:19:46Z axel $
00002 // Author: Mary-Louise Gill, 2009
00003 
00004 #ifndef _el_builtins_h_included
00005 #define _el_builtins_h_included 1
00006 ////////////////////////////////////////////////////////////////////////
00007 // This file is part of the liblineedit code. See el.fH for the
00008 // full license (BSD).
00009 // File added by stephan@s11n.net, 28 Nov 2004
00010 ////////////////////////////////////////////////////////////////////////
00011 
00012 #include "el.h"
00013 
00014 
00015 /**
00016    ElBuiltin_t holds information about builtin functions.
00017  */
00018 el_public struct ElBuiltin_t {
00019    typedef int (* handler_func)(EditLine_t*, int, const char**);
00020    const char* fName;
00021    handler_func fFunc;
00022    const char* fHelp;
00023    ElBuiltin_t(): fName(0),
00024       fFunc(0),
00025       fHelp(0) {}
00026 
00027    ElBuiltin_t(const char* n, handler_func f, const char* h): fName(n),
00028       fFunc(f),
00029       fHelp(h) {}
00030 
00031 };
00032 
00033 /**
00034    Registers f as a built-in function handler.
00035 
00036    (added by stephan)
00037  */
00038 void el_register_function(const char* name, ElBuiltin_t::handler_func f, const char* help = NULL);
00039 
00040 /**
00041    Built-in function to show the list of available functions to the
00042    user.
00043 
00044    (added by stephan)
00045  */
00046 int el_func_show_function_list(EditLine_t* el, int, const char**);     // impl: parse.c
00047 
00048 /*
00049    Built-in to re-initialize the readline interface. Only useful
00050    when using the readline compatibility mode.
00051 
00052    (added by stephan)
00053  */
00054 int el_func_readline_reinit(EditLine_t*, int, const char**);     // impl: readline.c
00055 
00056 /**
00057    Returns an array of ElBuiltin_t objects. The caller does NOT own it - it is a shared
00058    list. The list may become invalided upon later registration of functions, so don't
00059    hold on to it.
00060 
00061    The variable count is set to the number of items in the returned list.
00062 
00063    (added by stephan)
00064  */
00065 ElBuiltin_t** el_builtins_list(int* count);
00066 
00067 /**
00068    Returns the builtin function for the given name, or NULL if none is
00069    found. The client may modify the function, but should not delete it
00070    - it is owned by the library.
00071 
00072    (added by stephan)
00073  */
00074 ElBuiltin_t* el_builtin_by_name(const char*);
00075 
00076 #endif // _el_builtins_h_included

Generated on Tue Jul 5 14:11:37 2011 for ROOT_528-00b_version by  doxygen 1.5.1