1 
2 /* ---------------------------------------------------------------------
3    $Id: redline.h 5736 2021-03-16 10:41:22Z arthurcnorman $
4    ---------------------------------------------------------------------
5    (c) 1999-2009 A. Dolzmann and T. Sturm, 1999-2014 T. Sturm
6    ---------------------------------------------------------------------
7    Redistribution and use in source and binary forms, with or without
8    modification, are permitted provided that the following conditions
9    are met:
10 
11       * Redistributions of source code must retain the relevant
12         copyright notice, this list of conditions and the following
13         disclaimer.
14       * Redistributions in binary form must reproduce the above
15         copyright notice, this list of conditions and the following
16         disclaimer in the documentation and/or other materials provided
17         with the distribution.
18 
19    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23    OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 
32 /*
33  * This part was extracted by Arthur Norman in May 2016 so that the
34  * earlier filr redline.c was split into a version for use with native
35  * Windows and a version for other (unix-like) platforms. Declarations
36  * have then been split out to go in a header file so that references from
37  * one source file to another can be checked a bit!
38  */
39 
40 
41 
42 extern int redfrontcolor;
43 extern int normalcolor;
44 extern int promptcolor;
45 extern int inputcolor;
46 extern int outputcolor;
47 extern int debugcolor;
48 
49 extern int color;
50 
51 #define SKIPPING_WHITESPACE 1
52 #define READING_PROMPT 2
53 #define LEARNING 3
54 #define FINISHED 0
55 
56 #define PROMPT_IGNORE '@'
57 #define QUERY_ITEMS 100
58 
59 extern int verbose;
60 
61 #ifndef __MINGW32__
62 static EditLine *e;
63 static History *h;
64 static HistEvent ev;
65 #endif
66 
67 extern void line_init(void);
68 extern unsigned char _line_learn_completion(EditLine *,int);
69 extern void line_learn_completion(char *);
70 extern strl line_learn_until_prompt(char *,const char *);
71 extern char *line_get_prompt(EditLine *);
72 extern char *line_get_rprompt(EditLine *);
73 extern unsigned char line_complete(EditLine *,int);
74 extern unsigned char line_fn_complete(EditLine *,char *(*)(const char *, int),
75 			       const wchar_t *, const char *(*)(const char *),
76 			       size_t);
77 extern char *line_filename_completion_function(const char *, int);
78 extern const char *line_append_char_function(const char *);
79 extern char *line_switch_completion_function(const char *, int);
80 extern char *line_pack_completion_function(const char *, int);
81 extern char *line_load_completion_function(const char *, int);
82 extern char *line_strl_completion_function(const char *, int, strl);
83 extern char *line_adhoc_completion_function(const char *, int);
84 extern const char *line_append_no_char(const char *);
85 extern unsigned char line_help(EditLine *,int);
86 extern char *line_read(char *);
87 extern char *line_quit(const char *);
88 extern char *line_color_prompt(char *);
89 extern void line_end(void);
90 extern void line_init_history(void);
91 extern void line_add_history(char *);
92 extern void line_end_history(void);
93 extern char *line_histname(void);
94 
95 /* end of redline.h */
96