00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
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
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 #endif
00066
00067
00068
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
00076
00077
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
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
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