Aprepro  5.0x
apr_getline_int.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2017 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 //
17 // * Neither the name of NTESS nor the names of its
18 // contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
33 
34 #ifndef GETLINE_H
35 #define GETLINE_H
36 
37 /* unix systems can #define POSIX to use termios, otherwise
38  * the bsd or sysv interface will be used
39  */
40 
41 #define GL_BUF_SIZE 1024
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 typedef size_t (*gl_strwidth_proc)(char *);
48 typedef int (*gl_in_hook_proc)(char *);
49 typedef int (*gl_out_hook_proc)(char *);
50 typedef int (*gl_tab_hook_proc)(char *, int, int *, size_t);
51 typedef size_t (*gl_strlen_proc)(const char *);
52 typedef char *(*gl_tab_completion_proc)(const char *, int);
53 
54 char *getline_int(char *); /* read a line of input */
55 void gl_setwidth(int); /* specify width of screen */
56 void gl_histadd(char *); /* adds entries to hist */
57 void gl_strwidth(gl_strwidth_proc); /* to bind gl_strlen */
59 char *gl_local_filename_completion_proc(const char *, int);
60 void gl_set_home_dir(const char *homedir);
61 void gl_histsavefile(const char *const path);
62 void gl_histloadfile(const char *const path);
63 char *gl_win_getpass(const char *const prompt, char *const pass, int dsize);
64 
65 #ifndef _getline_c_
66 
73 extern const char * gl_filename_quote_characters;
76 extern char gl_buf[GL_BUF_SIZE];
77 
78 #endif /* ! _getline_c_ */
79 
80 #ifdef __cplusplus
81 } /* close brackets on extern "C" declaration */
82 #endif
83 
84 #endif /* GETLINE_H */
gl_win_getpass
char * gl_win_getpass(const char *const prompt, char *const pass, int dsize)
gl_completion_exact_match_extra_char
int gl_completion_exact_match_extra_char
GL_BUF_SIZE
#define GL_BUF_SIZE
Definition: apr_getline_int.h:41
gl_filename_quoting_desired
int gl_filename_quoting_desired
gl_histadd
void gl_histadd(char *)
gl_strlen
gl_strlen_proc gl_strlen
gl_ellipses_during_completion
int gl_ellipses_during_completion
gl_completion_proc
gl_tab_completion_proc gl_completion_proc
gl_local_filename_completion_proc
char * gl_local_filename_completion_proc(const char *, int)
gl_tab_completion_proc
char *(* gl_tab_completion_proc)(const char *, int)
Definition: apr_getline_int.h:52
gl_tab_hook
gl_tab_hook_proc gl_tab_hook
gl_strlen_proc
size_t(* gl_strlen_proc)(const char *)
Definition: apr_getline_int.h:51
gl_buf
char gl_buf[GL_BUF_SIZE]
getline_int
char * getline_int(char *)
gl_setwidth
void gl_setwidth(int)
gl_strwidth
void gl_strwidth(gl_strwidth_proc)
gl_set_home_dir
void gl_set_home_dir(const char *homedir)
gl_filename_quote_characters
const char * gl_filename_quote_characters
gl_strwidth_proc
size_t(* gl_strwidth_proc)(char *)
Definition: apr_getline_int.h:47
gl_in_hook
gl_in_hook_proc gl_in_hook
gl_histloadfile
void gl_histloadfile(const char *const path)
gl_histsavefile
void gl_histsavefile(const char *const path)
gl_tab_hook_proc
int(* gl_tab_hook_proc)(char *, int, int *, size_t)
Definition: apr_getline_int.h:50
gl_in_hook_proc
int(* gl_in_hook_proc)(char *)
Definition: apr_getline_int.h:48
gl_out_hook_proc
int(* gl_out_hook_proc)(char *)
Definition: apr_getline_int.h:49
gl_tab_completion
void gl_tab_completion(gl_tab_completion_proc)
gl_out_hook
gl_out_hook_proc gl_out_hook