Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c19354df
Commit
c19354df
authored
Apr 03, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const-ify functions used with completion_matches(), to suppress
cast-away-const warnings from compilers pickier than gcc.
parent
906dce04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/bin/psql/tab-complete.c
src/bin/psql/tab-complete.c
+16
-15
No files found.
src/bin/psql/tab-complete.c
View file @
c19354df
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
*
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.7
5 2003/03/28 16:34:50 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.7
6 2003/04/03 20:18:16 tgl
Exp $
*/
*/
/*----------------------------------------------------------------------
/*----------------------------------------------------------------------
...
@@ -67,7 +67,7 @@ extern char *filename_completion_function();
...
@@ -67,7 +67,7 @@ extern char *filename_completion_function();
#endif
#endif
#ifdef HAVE_RL_COMPLETION_MATCHES
#ifdef HAVE_RL_COMPLETION_MATCHES
#define completion_matches
(x, y) rl_completion_matches((x), ((rl_compentry_func_t *)(y)))
#define completion_matches
rl_completion_matches
#endif
#endif
#define BUF_SIZE 2048
#define BUF_SIZE 2048
...
@@ -76,12 +76,13 @@ extern char *filename_completion_function();
...
@@ -76,12 +76,13 @@ extern char *filename_completion_function();
/* Forward declaration of functions */
/* Forward declaration of functions */
static
char
**
psql_completion
(
char
*
text
,
int
start
,
int
end
);
static
char
**
psql_completion
(
char
*
text
,
int
start
,
int
end
);
static
char
*
create_command_generator
(
char
*
text
,
int
state
);
static
char
*
create_command_generator
(
const
char
*
text
,
int
state
);
static
char
*
complete_from_query
(
char
*
text
,
int
state
);
static
char
*
complete_from_query
(
const
char
*
text
,
int
state
);
static
char
*
complete_from_schema_query
(
char
*
text
,
int
state
);
static
char
*
complete_from_schema_query
(
const
char
*
text
,
int
state
);
static
char
*
_complete_from_query
(
int
is_schema_query
,
char
*
text
,
int
state
);
static
char
*
_complete_from_query
(
int
is_schema_query
,
static
char
*
complete_from_const
(
char
*
text
,
int
state
);
const
char
*
text
,
int
state
);
static
char
*
complete_from_list
(
char
*
text
,
int
state
);
static
char
*
complete_from_const
(
const
char
*
text
,
int
state
);
static
char
*
complete_from_list
(
const
char
*
text
,
int
state
);
static
PGresult
*
exec_query
(
char
*
query
);
static
PGresult
*
exec_query
(
char
*
query
);
char
*
quote_file_name
(
char
*
text
,
int
match_type
,
char
*
quote_pointer
);
char
*
quote_file_name
(
char
*
text
,
int
match_type
,
char
*
quote_pointer
);
...
@@ -1357,7 +1358,7 @@ psql_completion(char *text, int start, int end)
...
@@ -1357,7 +1358,7 @@ psql_completion(char *text, int start, int end)
as defined above.
as defined above.
*/
*/
static
char
*
static
char
*
create_command_generator
(
char
*
text
,
int
state
)
create_command_generator
(
c
onst
c
har
*
text
,
int
state
)
{
{
static
int
list_index
,
static
int
list_index
,
string_length
;
string_length
;
...
@@ -1383,13 +1384,13 @@ create_command_generator(char *text, int state)
...
@@ -1383,13 +1384,13 @@ create_command_generator(char *text, int state)
/* The following two functions are wrappers for _complete_from_query */
/* The following two functions are wrappers for _complete_from_query */
static
char
*
static
char
*
complete_from_query
(
char
*
text
,
int
state
)
complete_from_query
(
c
onst
c
har
*
text
,
int
state
)
{
{
return
_complete_from_query
(
0
,
text
,
state
);
return
_complete_from_query
(
0
,
text
,
state
);
}
}
static
char
*
static
char
*
complete_from_schema_query
(
char
*
text
,
int
state
)
complete_from_schema_query
(
c
onst
c
har
*
text
,
int
state
)
{
{
return
_complete_from_query
(
1
,
text
,
state
);
return
_complete_from_query
(
1
,
text
,
state
);
}
}
...
@@ -1412,7 +1413,7 @@ complete_from_schema_query(char *text, int state)
...
@@ -1412,7 +1413,7 @@ complete_from_schema_query(char *text, int state)
*/
*/
static
char
*
static
char
*
_complete_from_query
(
int
is_schema_query
,
char
*
text
,
int
state
)
_complete_from_query
(
int
is_schema_query
,
c
onst
c
har
*
text
,
int
state
)
{
{
static
int
list_index
,
static
int
list_index
,
string_length
;
string_length
;
...
@@ -1421,7 +1422,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
...
@@ -1421,7 +1422,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
const
char
*
item
;
const
char
*
item
;
/*
/*
* If this is
t
the first time for this completion, we fetch a list of
* If this is the first time for this completion, we fetch a list of
* our "things" from the backend.
* our "things" from the backend.
*/
*/
if
(
state
==
0
)
if
(
state
==
0
)
...
@@ -1471,7 +1472,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
...
@@ -1471,7 +1472,7 @@ _complete_from_query(int is_schema_query, char *text, int state)
SQL words that can appear at certain spot.
SQL words that can appear at certain spot.
*/
*/
static
char
*
static
char
*
complete_from_list
(
char
*
text
,
int
state
)
complete_from_list
(
c
onst
c
har
*
text
,
int
state
)
{
{
static
int
string_length
,
static
int
string_length
,
list_index
,
list_index
,
...
@@ -1531,7 +1532,7 @@ complete_from_list(char *text, int state)
...
@@ -1531,7 +1532,7 @@ complete_from_list(char *text, int state)
The string to be passed must be in completion_charp.
The string to be passed must be in completion_charp.
*/
*/
static
char
*
static
char
*
complete_from_const
(
char
*
text
,
int
state
)
complete_from_const
(
c
onst
c
har
*
text
,
int
state
)
{
{
(
void
)
text
;
/* We don't care about what was entered
(
void
)
text
;
/* We don't care about what was entered
* already. */
* already. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment