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
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);
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);
25 static PGresult *exec_query(char *query);
26 char *quote_file_name(char *text, int match_type, char *quote_pointer);
28 4) The list of attributes to the given table.
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)
44 /* The completion function. Acc. to readline spec this gets passed the text
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);
53 /* complete with what you can alter (TABLE or USER) */
55 strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
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);
69 -complete_from_query(char *text, int state)
70 +complete_from_query(const char *text, int state)
72 static int list_index,
75 SQL words that can appear at certain spot.
78 -complete_from_list(char *text, int state)
79 +complete_from_list(const char *text, int state)
81 static int string_length,
84 The string to be passed must be in completion_charp.
87 -complete_from_const(char *text, int state)
88 +complete_from_const(const char *text, int state)
90 (void) text; /* We don't care about what was entered
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
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))])
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)
114 dnl Check for GNU style long options support (getopt_long)
115 AC_CHECK_FUNCS(getopt_long)