head	1.18;
access;
symbols;
locks; strict;
comment	@# @;


1.18
date	97.09.08.04.13.26;	author momjian;	state dead;
branches;
next	1.17;

1.17
date	97.09.08.01.53.56;	author momjian;	state Exp;
branches;
next	1.16;

1.16
date	97.09.07.04.20.30;	author momjian;	state Exp;
branches;
next	1.15;

1.15
date	97.09.07.04.17.39;	author momjian;	state Exp;
branches;
next	1.14;

1.14
date	97.09.07.04.03.55;	author momjian;	state Exp;
branches;
next	1.13;

1.13
date	97.09.07.03.26.12;	author momjian;	state Exp;
branches;
next	1.12;

1.12
date	97.09.06.19.51.44;	author momjian;	state Exp;
branches;
next	1.11;

1.11
date	97.09.06.18.27.07;	author momjian;	state Exp;
branches;
next	1.10;

1.10
date	97.09.05.19.56.50;	author momjian;	state Exp;
branches;
next	1.9;

1.9
date	97.09.05.19.38.42;	author momjian;	state Exp;
branches;
next	1.8;

1.8
date	97.09.05.17.04.22;	author momjian;	state Exp;
branches;
next	1.7;

1.7
date	97.09.05.04.29.56;	author momjian;	state Exp;
branches;
next	1.6;

1.6
date	97.09.05.04.18.36;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	97.09.04.18.50.28;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	97.09.04.18.34.59;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	97.09.04.16.36.32;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	97.08.29.21.41.33;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	97.08.29.21.19.56;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.18
log
@Reorganize developers files.
@
text
@#!/bin/sh
#
# This can format all PostgreSQL *.c and *.h files,
# excluding libpq++, *.y, and *.l files.
#
# On 09/06/1997, from the top directory, I ran:
#
#   find . -name '*.[ch]' -type f -print | grep -v '++' | xargs -n100 PGINDENT
#

trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
entab </dev/null >/dev/null
if [ "$?" -ne 0 ]
then	echo "Go to the src/tools/entab directory and do a 'make' and 'make install'." >&2
	echo "This will put the 'entab' command in your path." >&2
	echo "Then run $0 again."
	exit 1
fi
indent -st </dev/null >/dev/null
if [ "$?" -ne 0 ]
then	echo "You do not appear to have 'indent' installed on your system." >&2
	exit 1
fi
for FILE
do
	cat $FILE |
	sed 's;/\*  *---;/*---X_X;g' |
	sed 's;\([} 	]\)else[ 	]*\(/\*.*\)$;\1else\
\2;g' | # workaround for indent bug
	detab -t4 -qc |
	sed 's;^DATA(.*$;/*&*/;' >/tmp/$$a    # protect backslashes in DATA() 
	indent -bad -bap -bbb -bc -bl -d0 -cdb -cli1 -nce -nfc1 -di12 -i4 -l75 \
		-lp -nip -npro /tmp/$$a >/tmp/$$ 2>&1
	if [ "$?" -ne 0 -o -s /tmp/$$ ]
	then	echo "$FILE"
		cat /tmp/$$
	fi
	cat /tmp/$$a |
	sed 's;^/\*\(DATA(.*\)\*/$;\1;' |
	sed 's;/\*---X_X;/* ---;g' |
	sed 's;^static[ 	][ 	]*;static ;g' | # workaround indent bug
	detab -t8 -qc |
	entab -t4 -qc >/tmp/$$ && cat /tmp/$$ >$FILE
done

# The 'for' loop makes these backup files useless
# so delete them
rm -f *a.BAK
@


1.17
log
@Modifications for indenting.
@
text
@@


1.16
log
@Cleanup.
@
text
@d32 1
a32 1
	indent -bad -bap -bbb -bc -bl -d0 -cdb -nce -nfc1 -di16 -i4 -l75 \
d40 2
d43 1
a43 2
	entab -t4 -qc |
	sed 's;/\*---X_X;/* ---;g' >/tmp/$$ && cat /tmp/$$ >$FILE
d46 3
@


1.15
log
@Cleanup.
@
text
@d32 1
a32 1
	indent -bad -bap -bbb -bc -bl -d0 -cdb -nce -nfc1 -di16 -i4 -l70 \
@


1.14
log
@Cleanup.
@
text
@d32 1
a32 1
	indent -bad -bap -bbb -bc -bl -d0 -cdb -nce -nfc1 -di12 -i4 -l70 \
@


1.13
log
@cleanup.
@
text
@a5 4
#
# This can format all PostgreSQL *.c and *.h files,
# excluding libpq++, *.y, and *.l files.
#
d32 1
a32 1
	indent -bad -bap -bbb -bc -bl -d0 -cdb -nce -nfc1 -di12 -l70 \
@


1.12
log
@Cleanup for indent.
@
text
@d6 9
d36 2
a37 2
	indent -bad -bap -bbb -bc -bl -d0 -cdb -nce -cli1 -di16 -nfc1 \
		-lp -nip -nbc -psl -di1 -i4 -l75 -npro /tmp/$$a >/tmp/$$ 2>&1
@


1.11
log
@More cleanups for indent.
@
text
@d2 4
@


1.10
log
@Cleanups needed for indent.
@
text
@d21 2
a22 1
	detab -t4 -qc >/tmp/$$a
d30 1
@


1.9
log
@Cleanups needed for indent.
@
text
@d19 2
a20 2
	sed 's;[ 	]else[ 	]*\(/\*.*\)$;else\
\1;g' | # workaround for indent bug
@


1.8
log
@cleanup.
@
text
@d19 2
@


1.7
log
@Cleanup.
@
text
@d21 1
a21 1
		-lp -nip -nbc -psl -di1 -i4 -l75 /tmp/$$a >/tmp/$$ 2>&1
@


1.6
log
@Better error reporting.
@
text
@d21 1
a21 1
		-lp -nip -nbc -psl -di1 -i4 -l75 >/tmp/$$ 2>&1
@


1.5
log
@More tab cleanup.
@
text
@d2 1
a2 1
trap "rm -f /tmp/$$" 0 1 2 3 15
d19 1
a19 1
	detab -t4 -qc |
d21 6
a26 1
		-lp -nip -nbc -psl -di1 -i4 -l75 -st |
@


1.4
log
@Tabs in comments fix.
@
text
@d19 1
a19 1
	detab -t4 |
d22 2
a23 2
	detab -t8 |
	entab -qc -t4 |
@


1.3
log
@Fix for dashes in comments.
@
text
@d19 1
d26 1
@


1.2
log
@indent flag change.
@
text
@d18 1
a18 1
	sed 's;/\*  *---;/*---;g' |
d23 1
a23 1
	sed 's;/\*---;/* ---;g' >/tmp/$$ && cat /tmp/$$ >$FILE
@


1.1
log
@Cleanup.
@
text
@d19 2
a20 2
	indent -bad -bap -bbb -bc -bl -d0 -ncdb -nce -cli1 -di16 -nfc1 \
		-lp -nip -nbc -psl -di1 -i4 -st |
@
