~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to cmd-line-utils/libedit/histedit.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $NetBSD: histedit.h,v 1.35 2009/02/05 19:15:44 christos Exp $   */
 
1
/*      $NetBSD: histedit.h,v 1.48 2011/07/28 20:50:55 christos Exp $   */
2
2
 
3
3
/*-
4
4
 * Copyright (c) 1992, 1993
43
43
#define LIBEDIT_MAJOR 2
44
44
#define LIBEDIT_MINOR 11
45
45
 
 
46
/* XXXMYSQL : stdint.h might not be available on older Solaris platforms. */
 
47
#if defined(__sun) || defined(__sun__)
 
48
#include <sys/inttypes.h>
 
49
#else
 
50
#include <stdint.h>
 
51
#endif
 
52
 
46
53
#include <sys/types.h>
47
54
#include <stdio.h>
48
55
 
114
121
 
115
122
/*
116
123
 * el_set/el_get parameters
 
124
 *
 
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 .
 
128
 
 
129
 * Prompt function prototypes are:
 
130
 *   typedef char    *(*el_pfunct_t)  (EditLine *);
 
131
 *   typedef wchar_t *(*el_wpfunct_t) (EditLine *);
 
132
 *
 
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.
 
136
 * 
 
137
 * Operations that only support "get" have the correct argument types listed.
117
138
 */
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 * */
128
 
                                /* , el_func_t);                */
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     */
 
149
                                /*   el_func_t);                              */
 
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     */
140
164
 
141
165
#define EL_BUILTIN_GETCFN       (NULL)
142
166
 
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 *);     */
202
226
#define H_SETUNIQUE     20      /* , int);              */
203
227
#define H_GETUNIQUE     21      /* , void);             */
204
228
#define H_DEL           22      /* , int);              */
 
229
#define H_NEXT_EVDATA   23      /* , const int, histdata_t *);  */
 
230
#define H_DELDATA       24      /* , int, histdata_t *);*/
 
231
#define H_REPLACE       25      /* , const char *, histdata_t); */
 
232
 
205
233
 
206
234
 
207
235
/*
221
249
int              tok_str(Tokenizer *, const char *,
222
250
                    int *, const char ***);
223
251
 
 
252
/*
 
253
 * Begin Wide Character Support
 
254
 */
 
255
 
 
256
/*
 
257
 * Wide character versions
 
258
 */
 
259
 
 
260
/*
 
261
 * ==== Editing ====
 
262
 */
 
263
typedef struct lineinfow {
 
264
        const wchar_t   *buffer;
 
265
        const wchar_t   *cursor;
 
266
        const wchar_t   *lastchar;
 
267
} LineInfoW;
 
268
 
 
269
const wchar_t   *el_wgets(EditLine *, int *);
 
270
int              el_wgetc(EditLine *, wchar_t *);
 
271
void             el_wpush(EditLine *, const wchar_t *);
 
272
 
 
273
int              el_wparse(EditLine *, int, const wchar_t **);
 
274
 
 
275
int              el_wset(EditLine *, int, ...);
 
276
int              el_wget(EditLine *, int, ...);
 
277
 
 
278
const LineInfoW *el_wline(EditLine *);
 
279
int              el_winsertstr(EditLine *, const wchar_t *);
 
280
#define          el_wdeletestr  el_deletestr
 
281
 
 
282
/*
 
283
 * ==== History ====
 
284
 */
 
285
typedef struct histeventW {
 
286
        int              num;
 
287
        const wchar_t   *str;
 
288
} HistEventW;
 
289
 
 
290
typedef struct historyW HistoryW;
 
291
 
 
292
HistoryW *      history_winit(void);
 
293
void            history_wend(HistoryW *);
 
294
 
 
295
int             history_w(HistoryW *, HistEventW *, int, ...);
 
296
 
 
297
/*
 
298
 * ==== Tokenization ====
 
299
 */
 
300
typedef struct tokenizerW TokenizerW;
 
301
 
 
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 ***);
 
310
 
224
311
#ifdef __cplusplus
225
312
}
226
313
#endif