]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/llvm/tools/lldb/tools/driver/ELWrapper.h
MFC r258054: Update LLDB to upstream r194122 snapshot
[FreeBSD/stable/10.git] / contrib / llvm / tools / lldb / tools / driver / ELWrapper.h
1 //===-- ELWrapper.h ---------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #pragma once
11
12 #include <stdio.h>
13
14 // EditLine editor function return codes.
15 // For user-defined function interface
16 #define CC_NORM         0
17 #define CC_NEWLINE      1
18 #define CC_EOF          2
19 #define CC_ARGHACK      3
20 #define CC_REFRESH      4
21 #define CC_CURSOR       5
22 #define CC_ERROR        6
23 #define CC_FATAL        7
24 #define CC_REDISPLAY    8
25 #define CC_REFRESH_BEEP 9
26
27 // el_set/el_get parameters
28 #define EL_PROMPT        0    // , el_pfunc_t
29 #define EL_TERMINAL      1    // , const char *
30 #define EL_EDITOR        2    // , const char *
31 #define EL_SIGNAL        3    // , int);
32 #define EL_BIND          4    // , const char *, ..., NULL
33 #define EL_TELLTC        5    // , const char *, ..., NULL
34 #define EL_SETTC         6    // , const char *, ..., NULL
35 #define EL_ECHOTC        7    // , const char *, ..., NULL
36 #define EL_SETTY         8    // , const char *, ..., NULL
37 #define EL_ADDFN         9    // , const char *, const char *, el_func_t
38 #define EL_HIST          10   // , hist_fun_t, const char *
39 #define EL_EDITMODE      11   // , int
40 #define EL_RPROMPT       12   // , el_pfunc_t
41 #define EL_GETCFN        13   // , el_rfunc_t
42 #define EL_CLIENTDATA    14   // , void *
43 #define EL_UNBUFFERED    15   // , int
44 #define EL_PREP_TERM     16   // , int
45 #define EL_GETTC         17   // , const char *, ..., NULL
46 #define EL_GETFP         18   // , int, FILE **
47 #define EL_SETFP         19   // , int, FILE *
48 #define EL_REFRESH       20   // , void
49
50 #define EL_BUILTIN_GETCFN (NULL)
51
52 // history defines
53 #define H_FUNC           0    // , UTSL
54 #define H_SETSIZE        1    // , const int
55 #define H_GETSIZE        2    // , void
56 #define H_FIRST          3    // , void
57 #define H_LAST           4    // , void
58 #define H_PREV           5    // , void
59 #define H_NEXT           6    // , void
60 #define H_CURR           8    // , const int
61 #define H_SET            7    // , int
62 #define H_ADD            9    // , const char *
63 #define H_ENTER          10   // , const char *
64 #define H_APPEND         11   // , const char *
65 #define H_END            12   // , void
66 #define H_NEXT_STR       13   // , const char *
67 #define H_PREV_STR       14   // , const char *
68 #define H_NEXT_EVENT     15   // , const int
69 #define H_PREV_EVENT     16   // , const int
70 #define H_LOAD           17   // , const char *
71 #define H_SAVE           18   // , const char *
72 #define H_CLEAR          19   // , void
73 #define H_SETUNIQUE      20   // , int
74 #define H_GETUNIQUE      21   // , void
75 #define H_DEL            22   // , int
76
77 struct EditLine
78 {
79 };
80
81 struct LineInfo
82 {
83     const char *buffer;
84     const char *cursor;
85     const char *lastchar;
86 };
87
88 struct History
89 {
90 };
91
92 struct HistEvent
93 {
94     int         num;
95     const char *str;
96 };
97
98 extern "C"
99 {
100     // edit line API
101     EditLine        *el_init     ( const char *, FILE *, FILE *, FILE * );
102     const char      *el_gets     ( EditLine *, int * );
103     int              el_set      ( EditLine *, int, ... );
104
105     void             el_end      ( EditLine * );
106     void             el_reset    ( EditLine * );
107     int              el_getc     ( EditLine *, char * );
108     void             el_push     ( EditLine *, char * );
109     void             el_beep     ( EditLine * );
110     int              el_parse    ( EditLine *, int, const char ** );
111     int              el_get      ( EditLine *, int, ... );
112     int              el_source   ( EditLine *, const char * );
113     void             el_resize   ( EditLine * );
114     const LineInfo  *el_line     ( EditLine * );
115     int              el_insertstr( EditLine *, const char * );
116     void             el_deletestr( EditLine *, int );
117
118     // history API
119     History         *history_init( void );
120     void             history_end ( History * );
121     int              history     ( History *, HistEvent *, int, ... );
122 };