]> git.pld-linux.org Git - packages/postgresql.git/blame - postgresql-readline.patch
fix
[packages/postgresql.git] / postgresql-readline.patch
CommitLineData
f01418e5 1--- postgresql-7.0.3/src/bin/psql/tab-complete.c.wiget Fri Apr 13 17:05:43 2001
46d20c3d
AF
2+++ postgresql-7.0.3/src/bin/psql/tab-complete.c Fri Apr 13 17:53:23 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);
f01418e5
AF
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) */
46d20c3d
AF
54@@ -619,8 +619,8 @@
55 strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
f01418e5
AF
56 )
57 {
46d20c3d 58-#ifdef HAVE_FILENAME_COMPLETION_FUNCTION
f01418e5 59- matches = completion_matches(text, filename_completion_function);
46d20c3d
AF
60+#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
61+ matches = rl_completion_matches(text, rl_filename_completion_function);
f01418e5
AF
62 #else
63
64 /*
46d20c3d
AF
65--- postgresql-7.0.3/src/configure.in.wiget Fri Apr 13 17:53:57 2001
66+++ postgresql-7.0.3/src/configure.in Fri Apr 13 17:55:00 2001
67@@ -915,14 +915,14 @@
68 dnl Check for readline's filename_completion_function.
69 dnl Some versions have it but it's not in the headers, so we have to take
70 dnl care of that, too.
71-AC_CHECK_FUNCS(filename_completion_function,
72- AC_EGREP_HEADER(filename_completion_function, readline.h,
73- AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL),
74- [AC_EGREP_HEADER(filename_completion_function, readline/readline.h,
75- AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL))])
76+AC_CHECK_FUNCS(rl_filename_completion_function,
77+ AC_EGREP_HEADER(rl_filename_completion_function, readline.h,
78+ AC_DEFINE(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL),
79+ [AC_EGREP_HEADER(rl_filename_completion_function, readline/readline.h,
80+ AC_DEFINE(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL))])
81 )
82-AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION)
83-AC_SUBST(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
84+AC_SUBST(HAVE_RL_FILENAME_COMPLETION_FUNCTION)
85+AC_SUBST(HAVE_RL_FILENAME_COMPLETION_FUNCTION_DECL)
86
87 dnl Check for GNU style long options support (getopt_long)
88 AC_CHECK_FUNCS(getopt_long)
This page took 0.03383 seconds and 4 git commands to generate.