116
123
* el_set/el_get parameters
125
* When using el_wset/el_wget (as opposed to el_set/el_get):
126
* Char is wchar_t, otherwise it is char.
127
* prompt_func is el_wpfunc_t, otherwise it is el_pfunc_t .
129
* Prompt function prototypes are:
130
* typedef char *(*el_pfunct_t) (EditLine *);
131
* typedef wchar_t *(*el_wpfunct_t) (EditLine *);
133
* For operations that support set or set/get, the argument types listed are for
134
* the "set" operation. For "get", each listed type must be a pointer.
135
* E.g. EL_EDITMODE takes an int when set, but an int* when get.
137
* Operations that only support "get" have the correct argument types listed.
118
#define EL_PROMPT 0 /* , el_pfunc_t); */
119
#define EL_TERMINAL 1 /* , const char *); */
120
#define EL_EDITOR 2 /* , const char *); */
121
#define EL_SIGNAL 3 /* , int); */
122
#define EL_BIND 4 /* , const char *, ..., NULL); */
123
#define EL_TELLTC 5 /* , const char *, ..., NULL); */
124
#define EL_SETTC 6 /* , const char *, ..., NULL); */
125
#define EL_ECHOTC 7 /* , const char *, ..., NULL); */
126
#define EL_SETTY 8 /* , const char *, ..., NULL); */
127
#define EL_ADDFN 9 /* , const char *, const char * */
129
#define EL_HIST 10 /* , hist_fun_t, const char *); */
130
#define EL_EDITMODE 11 /* , int); */
131
#define EL_RPROMPT 12 /* , el_pfunc_t); */
132
#define EL_GETCFN 13 /* , el_rfunc_t); */
133
#define EL_CLIENTDATA 14 /* , void *); */
134
#define EL_UNBUFFERED 15 /* , int); */
135
#define EL_PREP_TERM 16 /* , int); */
136
#define EL_GETTC 17 /* , const char *, ..., NULL); */
137
#define EL_GETFP 18 /* , int, FILE **); */
138
#define EL_SETFP 19 /* , int, FILE *); */
139
#define EL_REFRESH 20 /* , void); */
139
#define EL_PROMPT 0 /* , prompt_func); set/get */
140
#define EL_TERMINAL 1 /* , const char *); set/get */
141
#define EL_EDITOR 2 /* , const Char *); set/get */
142
#define EL_SIGNAL 3 /* , int); set/get */
143
#define EL_BIND 4 /* , const Char *, ..., NULL); set */
144
#define EL_TELLTC 5 /* , const Char *, ..., NULL); set */
145
#define EL_SETTC 6 /* , const Char *, ..., NULL); set */
146
#define EL_ECHOTC 7 /* , const Char *, ..., NULL); set */
147
#define EL_SETTY 8 /* , const Char *, ..., NULL); set */
148
#define EL_ADDFN 9 /* , const Char *, const Char, set */
150
#define EL_HIST 10 /* , hist_fun_t, const void *); set */
151
#define EL_EDITMODE 11 /* , int); set/get */
152
#define EL_RPROMPT 12 /* , prompt_func); set/get */
153
#define EL_GETCFN 13 /* , el_rfunc_t); set/get */
154
#define EL_CLIENTDATA 14 /* , void *); set/get */
155
#define EL_UNBUFFERED 15 /* , int); set/get */
156
#define EL_PREP_TERM 16 /* , int); set */
157
#define EL_GETTC 17 /* , const Char *, ..., NULL); get */
158
#define EL_GETFP 18 /* , int, FILE **); get */
159
#define EL_SETFP 19 /* , int, FILE *); set */
160
#define EL_REFRESH 20 /* , void); set */
161
#define EL_PROMPT_ESC 21 /* , prompt_func, Char); set/get */
162
#define EL_RPROMPT_ESC 22 /* , prompt_func, Char); set/get */
163
#define EL_RESIZE 23 /* , el_zfunc_t, void *); set */
141
165
#define EL_BUILTIN_GETCFN (NULL)
188
212
#define H_NEXT 6 /* , void); */
189
213
#define H_CURR 8 /* , const int); */
190
214
#define H_SET 7 /* , int); */
191
#define H_ADD 9 /* , const char *); */
192
#define H_ENTER 10 /* , const char *); */
193
#define H_APPEND 11 /* , const char *); */
215
#define H_ADD 9 /* , const wchar_t *); */
216
#define H_ENTER 10 /* , const wchar_t *); */
217
#define H_APPEND 11 /* , const wchar_t *); */
194
218
#define H_END 12 /* , void); */
195
#define H_NEXT_STR 13 /* , const char *); */
196
#define H_PREV_STR 14 /* , const char *); */
219
#define H_NEXT_STR 13 /* , const wchar_t *); */
220
#define H_PREV_STR 14 /* , const wchar_t *); */
197
221
#define H_NEXT_EVENT 15 /* , const int); */
198
222
#define H_PREV_EVENT 16 /* , const int); */
199
223
#define H_LOAD 17 /* , const char *); */
221
249
int tok_str(Tokenizer *, const char *,
222
250
int *, const char ***);
253
* Begin Wide Character Support
257
* Wide character versions
263
typedef struct lineinfow {
264
const wchar_t *buffer;
265
const wchar_t *cursor;
266
const wchar_t *lastchar;
269
const wchar_t *el_wgets(EditLine *, int *);
270
int el_wgetc(EditLine *, wchar_t *);
271
void el_wpush(EditLine *, const wchar_t *);
273
int el_wparse(EditLine *, int, const wchar_t **);
275
int el_wset(EditLine *, int, ...);
276
int el_wget(EditLine *, int, ...);
278
const LineInfoW *el_wline(EditLine *);
279
int el_winsertstr(EditLine *, const wchar_t *);
280
#define el_wdeletestr el_deletestr
285
typedef struct histeventW {
290
typedef struct historyW HistoryW;
292
HistoryW * history_winit(void);
293
void history_wend(HistoryW *);
295
int history_w(HistoryW *, HistEventW *, int, ...);
298
* ==== Tokenization ====
300
typedef struct tokenizerW TokenizerW;
302
/* Wide character tokenizer support */
303
TokenizerW *tok_winit(const wchar_t *);
304
void tok_wend(TokenizerW *);
305
void tok_wreset(TokenizerW *);
306
int tok_wline(TokenizerW *, const LineInfoW *,
307
int *, const wchar_t ***, int *, int *);
308
int tok_wstr(TokenizerW *, const wchar_t *,
309
int *, const wchar_t ***);
224
311
#ifdef __cplusplus