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
a08dc16c
Commit
a08dc16c
authored
Aug 09, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New pgindent.
parent
111b80ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
13 deletions
+63
-13
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/plan/initsplan.c
+2
-2
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/clauses.c
+2
-2
src/include/optimizer/clauses.h
src/include/optimizer/clauses.h
+2
-2
src/tools/pgindent/pgindent
src/tools/pgindent/pgindent
+57
-7
No files found.
src/backend/optimizer/plan/initsplan.c
View file @
a08dc16c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.1
6 1998/08/09 04:17:38
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.1
7 1998/08/09 04:59:03
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -172,7 +172,7 @@ add_clause_to_rels(Query *root, List *clause)
...
@@ -172,7 +172,7 @@ add_clause_to_rels(Query *root, List *clause)
/*
/*
* Retrieve all relids and vars contained within the clause.
* Retrieve all relids and vars contained within the clause.
*/
*/
clause_relids_vars
((
Node
*
)
clause
,
&
relids
,
&
vars
);
clause_
get_
relids_vars
((
Node
*
)
clause
,
&
relids
,
&
vars
);
clauseinfo
->
clause
=
(
Expr
*
)
clause
;
clauseinfo
->
clause
=
(
Expr
*
)
clause
;
...
...
src/backend/optimizer/util/clauses.c
View file @
a08dc16c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.1
8 1998/08/07 05:02:22
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.1
9 1998/08/09 04:59:06
momjian Exp $
*
*
* HISTORY
* HISTORY
* AUTHOR DATE MAJOR EVENT
* AUTHOR DATE MAJOR EVENT
...
@@ -352,7 +352,7 @@ pull_constant_clauses(List *quals, List **constantQual)
...
@@ -352,7 +352,7 @@ pull_constant_clauses(List *quals, List **constantQual)
*
*
*/
*/
void
void
clause_relids_vars
(
Node
*
clause
,
List
**
relids
,
List
**
vars
)
clause_
get_
relids_vars
(
Node
*
clause
,
List
**
relids
,
List
**
vars
)
{
{
List
*
clvars
=
pull_var_clause
(
clause
);
List
*
clvars
=
pull_var_clause
(
clause
);
List
*
var_list
=
NIL
;
List
*
var_list
=
NIL
;
...
...
src/include/optimizer/clauses.h
View file @
a08dc16c
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: clauses.h,v 1.1
0 1998/02/26 04:42:13
momjian Exp $
* $Id: clauses.h,v 1.1
1 1998/08/09 04:59:08
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -35,7 +35,7 @@ extern bool and_clause(Node *clause);
...
@@ -35,7 +35,7 @@ extern bool and_clause(Node *clause);
extern
Expr
*
make_andclause
(
List
*
andclauses
);
extern
Expr
*
make_andclause
(
List
*
andclauses
);
extern
List
*
pull_constant_clauses
(
List
*
quals
,
List
**
constantQual
);
extern
List
*
pull_constant_clauses
(
List
*
quals
,
List
**
constantQual
);
extern
void
clause_relids_vars
(
Node
*
clause
,
List
**
relids
,
List
**
vars
);
extern
void
clause_
get_
relids_vars
(
Node
*
clause
,
List
**
relids
,
List
**
vars
);
extern
int
NumRelids
(
Node
*
clause
);
extern
int
NumRelids
(
Node
*
clause
);
extern
bool
contains_not
(
Node
*
clause
);
extern
bool
contains_not
(
Node
*
clause
);
extern
bool
join_clause_p
(
Node
*
clause
);
extern
bool
join_clause_p
(
Node
*
clause
);
...
...
src/tools/pgindent/pgindent
View file @
a08dc16c
...
@@ -26,10 +26,12 @@ for FILE
...
@@ -26,10 +26,12 @@ for FILE
do
do
cat
$FILE
|
cat
$FILE
|
sed
's;/\* *---;/*---X_X;g'
|
sed
's;/\* *---;/*---X_X;g'
|
# workaround for indent bug with 'else' handling
sed
's;\([} ]\)else[ ]*\(/\*.*\)$;\1else\
sed
's;\([} ]\)else[ ]*\(/\*.*\)$;\1else\
\2;g'
|
# workaround for indent bug
\2;g'
|
detab
-t4
-qc
|
detab
-t4
-qc
|
sed
's;^DATA(.*$;/*&*/;'
>
/tmp/
$$
a
# protect backslashes in DATA()
# protect backslashes in DATA()
sed
's;^DATA(.*$;/*&*/;'
>
/tmp/
$$
a
# We get the list of typedef's from /src/tools/find_typedef
# We get the list of typedef's from /src/tools/find_typedef
indent
-bad
-bap
-bc
-bl
-d0
-cdb
-nce
-nfc1
-di12
-i4
-l75
\
indent
-bad
-bap
-bc
-bl
-d0
-cdb
-nce
-nfc1
-di12
-i4
-l75
\
...
@@ -792,12 +794,17 @@ do
...
@@ -792,12 +794,17 @@ do
cat
/tmp/
$$
a |
cat
/tmp/
$$
a |
sed
's;^/\*\(DATA(.*\)\*/$;\1;'
|
sed
's;^/\*\(DATA(.*\)\*/$;\1;'
|
sed
's;/\*---X_X;/* ---;g'
|
sed
's;/\*---X_X;/* ---;g'
|
sed
's;^static[ ][ ]*;static ;g'
|
# workaround indent bug
# workaround indent bug
sed
's;^static[ ][ ]*;static ;g'
|
sed
's;^}[ ][ ]*/\*;} /*;'
|
sed
's;^}[ ][ ]*/\*;} /*;'
|
detab
-t8
-qc
|
detab
-t8
-qc
|
entab
-t4
-qc
|
entab
-t4
-qc
|
sed
's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;'
|
# move trailing * in function return type
# move trailing * in function return type
awk
' { line3 = $0; /* remove un-needed braces around single statements */
sed
's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;'
|
# remove un-needed braces around single statements
awk
'
{
line3 = $0;
if (skips > 0)
if (skips > 0)
skips--;
skips--;
if (line1 ~ " *{$" &&
if (line1 ~ " *{$" &&
...
@@ -823,9 +830,52 @@ do
...
@@ -823,9 +830,52 @@ do
if (skips <= 2)
if (skips <= 2)
print line2;
print line2;
}'
|
}'
|
# Move prototype names to the same line as return type. Useful for ctags.
# Indent should do this, but it does not. It formats prototypes just
# like real functions.
awk
' BEGIN {paren_level = 0}
{
if ($0 ~ /^[a-zA-Z_][a-zA-Z_0-9]*[^\(]*$/)
{
saved_len = 0;
saved_lines[++saved_len] = $0;
if ((getline saved_lines[++saved_len]) == 0)
print saved_lines[1];
else
if (saved_lines[saved_len] !~ /^[a-zA-Z_][a-zA-Z_0-9]*\(/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\)$/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\);$/)
{
print saved_lines[1];
print saved_lines[2];
}
else
{
while (1)
{
if ((getline saved_lines[++saved_len]) == 0)
break;
if (saved_lines[saved_len] ~ /\);?$/ ||
saved_lines[saved_len] ~ /^[^ ]/ ||
saved_lines[saved_len] ~ /^$/)
break;
}
for (i=1; i <= saved_len; i++)
{
if (i == 1 && saved_lines[saved_len] ~ /\);$/)
{
printf "%s", saved_lines[i];
if (substr(saved_lines[i], length(saved_lines[i]),1) != "*")
printf " ";
}
else print saved_lines[i];
}
}
}
else print $0;
}'
|
cat
>
/tmp/
$$
&&
cat
/tmp/
$$
>
$FILE
cat
>
/tmp/
$$
&&
cat
/tmp/
$$
>
$FILE
done
done
# The 'for' loop makes these backup files useless
# The 'for' loop makes these backup files useless so delete them
# so delete them
rm
-f
*
a.BAK
rm
-f
*
a.BAK
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