]> git.pld-linux.org Git - packages/postgresql.git/blob - postgresql-readline.patch
one more fix
[packages/postgresql.git] / postgresql-readline.patch
1 --- postgresql-7.0.3/src/bin/psql/tab-complete.c.wiget  Fri Apr 13 17:05:43 2001
2 +++ postgresql-7.0.3/src/bin/psql/tab-complete.c        Fri Apr 13 18:36:40 2001
3 @@ -50,8 +50,8 @@
4  #include "common.h"
5  #include "settings.h"
6  
7 -#if defined(HAVE_FILENAME_COMPLETION_FUNCTION) && !defined(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
8 -char      *filename_completion_function(char *, int);
9 +#if defined(HAVE_RL_FILENAME_COMPLETION_FUNCTION) && !defined(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL)
10 +char      *rl_filename_completion_function(char *, int);
11  
12  #endif
13  
14 @@ -62,9 +62,9 @@
15  /* Forward declaration of functions */
16  static char **psql_completion(char *text, int start, int end);
17  static char *create_command_generator(char *text, int state);
18 -static char *complete_from_query(char *text, int state);
19 -static char *complete_from_const(char *text, int state);
20 -static char *complete_from_list(char *text, int state);
21 +static char *complete_from_query(const char *text, int state);
22 +static char *complete_from_const(const char *text, int state);
23 +static char *complete_from_list(const char *text, int state);
24  
25  static PGresult *exec_query(char *query);
26  char      *quote_file_name(char *text, int match_type, char *quote_pointer);
27 @@ -152,13 +152,13 @@
28     4) The list of attributes to the given table.
29  */
30  #define COMPLETE_WITH_QUERY(query) \
31 -do { completion_charp = query; matches = completion_matches(text, complete_from_query); } while(0)
32 +do { completion_charp = query; matches = rl_completion_matches(text, complete_from_query); } while(0)
33  #define COMPLETE_WITH_LIST(list) \
34 -do { completion_charpp = list; matches = completion_matches(text, complete_from_list); } while(0)
35 +do { completion_charpp = list; matches = rl_completion_matches(text, complete_from_list); } while(0)
36  #define COMPLETE_WITH_CONST(string) \
37 -do { completion_charp = string; matches = completion_matches(text, complete_from_const); } while(0)
38 +do { completion_charp = string; matches = rl_completion_matches(text, complete_from_const); } while(0)
39  #define COMPLETE_WITH_ATTR(table) \
40 -do {completion_charp = Query_for_list_of_attributes; completion_info_charp = table; matches = completion_matches(text, complete_from_query); } while(0)
41 +do {completion_charp = Query_for_list_of_attributes; completion_info_charp = table; matches = rl_completion_matches(text, complete_from_query); } while(0)
42  
43  
44  /* The completion function. Acc. to readline spec this gets passed the text
45 @@ -257,7 +257,7 @@
46  /* CREATE or DROP */
47         /* complete with something you can create or drop */
48         else if (strcasecmp(prev_wd, "CREATE") == 0 || strcasecmp(prev_wd, "DROP") == 0)
49 -               matches = completion_matches(text, create_command_generator);
50 +               matches = rl_completion_matches(text, create_command_generator);
51  
52  /* ALTER */
53         /* complete with what you can alter (TABLE or USER) */
54 @@ -619,8 +619,8 @@
55                    strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
56                 )
57         {
58 -#ifdef HAVE_FILENAME_COMPLETION_FUNCTION
59 -               matches = completion_matches(text, filename_completion_function);
60 +#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
61 +               matches = rl_completion_matches(text, rl_filename_completion_function);
62  #else
63  
64                 /*
65 @@ -728,7 +728,7 @@
66     etc.
67  */
68  static char *
69 -complete_from_query(char *text, int state)
70 +complete_from_query(const char *text, int state)
71  {
72         static int      list_index,
73                                 string_length;
74 @@ -776,7 +776,7 @@
75     SQL words that can appear at certain spot.
76  */
77  static char *
78 -complete_from_list(char *text, int state)
79 +complete_from_list(const char *text, int state)
80  {
81         static int      string_length,
82                                 list_index;
83 @@ -810,7 +810,7 @@
84     The string to be passed must be in completion_charp.
85  */
86  static char *
87 -complete_from_const(char *text, int state)
88 +complete_from_const(const char *text, int state)
89  {
90         (void) text;                            /* We don't care about what was entered
91                                                                  * already. */
92 --- postgresql-7.0.3/src/configure.in.wiget     Fri Apr 13 17:53:57 2001
93 +++ postgresql-7.0.3/src/configure.in   Fri Apr 13 17:55:00 2001
94 @@ -915,14 +915,14 @@
95  dnl Check for readline's filename_completion_function.
96  dnl Some versions have it but it's not in the headers, so we have to take
97  dnl care of that, too.
98 -AC_CHECK_FUNCS(filename_completion_function,
99 -    AC_EGREP_HEADER(filename_completion_function, readline.h,
100 -        AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL),
101 -        [AC_EGREP_HEADER(filename_completion_function, readline/readline.h,
102 -            AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL))])
103 +AC_CHECK_FUNCS(rl_filename_completion_function,
104 +    AC_EGREP_HEADER(rl_filename_completion_function, readline.h,
105 +        AC_DEFINE(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL),
106 +        [AC_EGREP_HEADER(rl_filename_completion_function, readline/readline.h,
107 +            AC_DEFINE(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL))])
108  )
109 -AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION)
110 -AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
111 +AC_SUBST(HAVE_RL_FILENAME_COMPLETION_FUNCTION)
112 +AC_SUBST(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL)
113  
114  dnl Check for GNU style long options support (getopt_long)
115  AC_CHECK_FUNCS(getopt_long)
This page took 0.055617 seconds and 4 git commands to generate.