Skip to content

Commit 8e6697f

Browse files
committed
Update include scripts
1 parent 7fe8722 commit 8e6697f

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

src/tools/pginclude/README

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
These utilities help clean up #include file usage:
2+
3+
pgfixinclude change #include's to <> or ""
4+
pgrminclude remove extra #include's
5+
pginclude [-v] report which #include files can not compile on their own
6+
7+
pgdefine create macro calls for all defines in the file (used by
8+
the above routines)
9+
10+

src/tools/pginclude/pgdefine

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
:
2+
# create macro calls for all defines in the file
3+
24
trap "rm -f /tmp/$$" 0 1 2 3 15
35
for FILE
46
do

src/tools/pginclude/pgfixinclude

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:
2-
# mark includes as <> or ""
2+
# change #include's to <> or ""
33

44
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
55
find . \( -name CVS -a -prune \) -o -type f -print |

src/tools/pginclude/pginclude

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
:
2-
# report which include files can not compile on their own
2+
# report which #include files can not compile on their own
3+
# takes -v option to display compile failure message and line numbers
34

45
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a" 0 1 2 3 15
56
find . \( -name CVS -a -prune \) -o -name '*.[ch]' -type f -print | while read FILE

src/tools/pginclude/pgnoinclude renamed to src/tools/pginclude/pgrminclude

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:
2-
# report which files have extra includes
2+
# remove extra #include's
33

44
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
55
find . \( -name CVS -a -prune \) -o -type f -print |
@@ -52,7 +52,7 @@ do
5252
mv /tmp/$$b "$FILE"
5353
# reload after #include removal
5454
if [ "$IS_INCLUDE" = "Y" ]
55-
then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
55+
then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
5656
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
5757
else cat "$FILE" >/tmp/$$a
5858
fi

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy