You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
postgres/src/tools/pginclude
Bruce Momjian 9af4159fce pgindent run for release 9.3 13 years ago
..
README Add URL for include file visualization tool. 14 years ago
cpluspluscheck Exclude utils/probes.h and pg_trace.h from cpluspluscheck 13 years ago
pgcheckdefines pgindent run for release 9.3 13 years ago
pgcompinclude Lots of doc corrections. 14 years ago
pgdefine Improve method of avoiding fcinfo compile errors. 15 years ago
pgfixinclude Change references of CVS to .git. 15 years ago
pgrminclude Remove whitespace from end of lines 14 years ago

README

src/tools/pginclude/README

pginclude
=========

These utilities help clean up #include file usage. They should be run
in this order so that the include files have the proper includes before
the C files are tested.

pgfixinclude change #include's to <> or ""

pgcompinclude [-v]
report which #include files can not compile on their own

pgrminclude [-v]
remove extra #include's

pgcheckdefines
check for #ifdef tests on symbols defined in files that
weren't included --- this is a necessary sanity check on
pgrminclude

pgdefine create macro calls for all defines in the file (used by
the above routines)

It is also a good idea to sort the pg-specific include files in
alphabetic order. This is best done with a text editor. Typical usage
order would be:

pgfixinclude
sort include references
run multiple times:
pgcompinclude
pgrminclude /src/include
pgrminclude /
pgcheckdefines

There is a complexity when modifying /src/include. If include file 1
includes file 2, and file 2 includes file 3, then when file 1 is
processed, it needs only file 2, not file 3. However, if later, include
file 2 is processed, and file 3 is not needed by file 2 and is removed,
file 1 might then need to include file 3. For this reason, the
pgcompinclude and pgrminclude /src/include steps must be run several
times until all includes compile cleanly.

Also, tests should be done with configure settings of --enable-cassert
and EXEC_BACKEND on and off. It is also wise to test a WIN32 compile.

Another tools that does a similar task is at:

http://code.google.com/p/include-what-you-use/

An include file visualizer script is available at:

http://archives.postgresql.org/pgsql-hackers/2011-09/msg00311.php