editline.h

Go to the documentation of this file.
00001 // @(#)root/editline:$Id: editline.h 37430 2010-12-09 10:09:52Z axel $
00002 // Author: Mary-Louise Gill, 2009
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 /*      $NetBSD: readline.fH,v 1.1 2001/01/05 21:15:50 jdolecek Exp $   */
00013 
00014 /*-
00015  * Copyright (c) 1992, 1993
00016  *      The Regents of the University of California.  All rights reserved.
00017  *
00018  * This code is derived from software contributed to Berkeley by
00019  * Christos Zoulas of Cornell University.
00020  *
00021  * Redistribution and use in source and binary forms, with or without
00022  * modification, are permitted provided that the following conditions
00023  * are met:
00024  * 1. Redistributions of source code must retain the above copyright
00025  *    notice, this list of conditions and the following disclaimer.
00026  * 2. Redistributions in binary form must reproduce the above copyright
00027  *    notice, this list of conditions and the following disclaimer in the
00028  *    documentation and/or other materials provided with the distribution.
00029  * 3. Neither the name of the University nor the names of its contributors
00030  *    may be used to endorse or promote products derived from this software
00031  *    without specific prior written permission.
00032  *
00033  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00034  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00035  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00036  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00037  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00038  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00039  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00040  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00041  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00042  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00043  * SUCH DAMAGE.
00044  */
00045 
00046 #ifndef _READLINE_H_
00047 #define _READLINE_H_
00048 
00049 #include <stdio.h>
00050 #include <sys/types.h>
00051 #if HAVE_SYS_CDEFS_H
00052 # include <sys/cdefs.h>
00053 #else
00054 /*
00055  #ifndef __BEGIN_DECLS
00056  #if defined(__cplusplus)
00057  #define __BEGIN_DECLS   extern "C" {
00058  #define __END_DECLS     }
00059  #else
00060  #define __BEGIN_DECLS
00061  #define __END_DECLS
00062  #endif
00063  #endif
00064 */
00065 #endif
00066 
00067 // Generic helper definitions for shared library support hiding readline symbols
00068 // See http://gcc.gnu.org/wiki/Visibility
00069 #if defined(__GNUC__) && (__GNUC__ >= 4)
00070 # define R_EL__LOCAL  __attribute__ ((visibility("hidden")))
00071 #else
00072 # define R_EL__LOCAL
00073 #endif
00074 
00075 /* list of readline stuff supported by SEditLine_t library's readline wrapper */
00076 
00077 /* typedefs */
00078 typedef int Function (const char*, int);
00079 typedef void VFunction (void);
00080 typedef char* CPFunction (const char*, int);
00081 typedef char** CPPFunction (const char*, int, int);
00082 typedef int (*El_tab_hook_t)(char* buf, int prompt_width, int* cursor_loc);
00083 typedef int (*El_in_key_hook_t)(int ch);
00084 
00085 typedef struct R_EL__LOCAL _hist_entry {
00086    const char* line;
00087    const char* data;
00088 } HIST_ENTRY;
00089 
00090 /* global variables used by readline enabled applications */
00091 extern R_EL__LOCAL const char* rl_library_version;
00092 extern R_EL__LOCAL const char* rl_readline_name;
00093 extern R_EL__LOCAL FILE* rl_instream;
00094 extern R_EL__LOCAL FILE* rl_outstream;
00095 extern R_EL__LOCAL char* rl_line_buffer;
00096 extern R_EL__LOCAL int rl_point, rl_end;
00097 extern R_EL__LOCAL int history_base, history_length;
00098 extern R_EL__LOCAL int max_input_history;
00099 extern R_EL__LOCAL const char* rl_basic_word_break_characters;
00100 extern R_EL__LOCAL char* rl_completer_word_break_characters;
00101 extern R_EL__LOCAL char* rl_completer_quote_characters;
00102 extern R_EL__LOCAL CPFunction* rl_completion_entry_function;
00103 extern R_EL__LOCAL CPPFunction* rl_attempted_completion_function;
00104 extern R_EL__LOCAL int rl_completion_type;
00105 extern R_EL__LOCAL int rl_completion_query_items;
00106 extern R_EL__LOCAL char* rl_special_prefixes;
00107 extern R_EL__LOCAL int rl_completion_append_character;
00108 extern R_EL__LOCAL El_tab_hook_t rl_tab_hook;
00109 extern R_EL__LOCAL El_tab_hook_t rl_tab_hook;
00110 extern R_EL__LOCAL El_in_key_hook_t rl_in_key_hook;
00111 
00112 /* supported functions */
00113 R_EL__LOCAL char* readline(const char*, bool newline);
00114 R_EL__LOCAL int rl_initialize(void);
00115 R_EL__LOCAL bool rl_isinitialized();
00116 
00117 R_EL__LOCAL void setEcho(bool echo);
00118 R_EL__LOCAL void termResize(void);
00119 R_EL__LOCAL void setColors(const char* colorTab, const char* colorTabComp, const char* colorBracket,
00120                const char* colorBadBracket, const char* colorPrompt);
00121 
00122 R_EL__LOCAL void using_history(void);
00123 R_EL__LOCAL int add_history(char*);
00124 R_EL__LOCAL void clear_history(void);
00125 R_EL__LOCAL void stifle_history(int);
00126 R_EL__LOCAL int unstifle_history(void);
00127 R_EL__LOCAL int history_is_stifled(void);
00128 R_EL__LOCAL int where_history(void);
00129 R_EL__LOCAL HIST_ENTRY* current_history(void);
00130 R_EL__LOCAL HIST_ENTRY* history_get(int);
00131 R_EL__LOCAL int history_total_bytes(void);
00132 R_EL__LOCAL int history_set_pos(int);
00133 R_EL__LOCAL HIST_ENTRY* previous_history(void);
00134 R_EL__LOCAL HIST_ENTRY* next_history(void);
00135 R_EL__LOCAL int history_search(const char*, int);
00136 R_EL__LOCAL int history_search_prefix(const char*, int);
00137 R_EL__LOCAL int history_search_pos(const char*, int, int);
00138 R_EL__LOCAL int read_history(const char*);
00139 R_EL__LOCAL int write_history(const char*);
00140 #ifdef EL_HISTORY_EXPAND
00141 R_EL__LOCAL int history_expand(char*, char**);
00142 #endif
00143 R_EL__LOCAL char** history_tokenize(const char*);
00144 
00145 R_EL__LOCAL char* tilde_expand(char*);
00146 R_EL__LOCAL char* filename_completion_function(const char*, int);
00147 R_EL__LOCAL char* username_completion_function(const char*, int);
00148 R_EL__LOCAL int rl_complete(int, int);
00149 R_EL__LOCAL int rl_read_key(void);
00150 R_EL__LOCAL char** completion_matches(const char*, CPFunction*);
00151 R_EL__LOCAL void rl_display_match_list(char**, int, int);
00152 
00153 R_EL__LOCAL int rl_insert(int, int);
00154 R_EL__LOCAL void rl_reset_terminal(void);
00155 R_EL__LOCAL int rl_bind_key(int, int(*) (int, int));
00156 R_EL__LOCAL int rl_eof(void);
00157 
00158 R_EL__LOCAL void rl_cleanup_after_signal();
00159 
00160 #endif /* _READLINE_H_ */

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