head	1.2;
access;
symbols
	RPM_4_2_1:1.1.1.5
	RPM_4_2:1.1.1.5
	RPM_4_1_1:1.1.1.5
	RPM_4_1:1.1.1.4
	RPM_4_0_5:1.1.1.3
	RPM_4_0_4:1.1.1.2
	RPM_4_0_3:1.1.1.1
	RPM:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2008.01.02.09.52.22;	author rse;	state dead;
branches;
next	1.1;
commitid	z4cpSiAhOCXk5PLs;

1.1
date	2001.05.13.19.58.27;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.05.13.19.58.27;	author rse;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2002.01.07.22.30.02;	author rse;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2003.01.18.13.48.54;	author rse;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2001.10.15.03.47.23;	author rse;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2003.01.18.14.04.55;	author rse;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove the ancient RPM 4.2.1 source tree copy
@
text
@# This awk script parses C input files looking for lines marked "PUBLIC:"
# and "EXTERN:".  (PUBLIC lines are DB internal function prototypes and
# #defines, EXTERN are DB external function prototypes and #defines.)  The
# PUBLIC lines are put into two versions of per-directory include files:
# one version for normal use, and one version to be post-processed based
# on creating unique file names for every global symbol in the DB library.
# The EXTERN lines are put into two versions of the db.h file, again, one
# version for normal use, and one version to be post-processed for unique
# naming.
/PUBLIC:/ {
	sub("^.*PUBLIC:[	 ][	 ]*", "")
	if ($0 ~ "^#if|^#endif") {
		print $0 >> inc_file
		print $0 >> uinc_file
		next
	}
	if ($0 ~ "^#define.*[(]") {
		print $0 >> inc_file
		def = gensub("[(]", "@@DB_VERSION_UNIQUE_NAME@@(", 2)
		print def >> uinc_file
		next
	}
	if ($0 ~ "^#define") {
		print $0 >> inc_file
		sub("[	 ]*$", "@@DB_VERSION_UNIQUE_NAME@@")
		print $0 >> uinc_file
		next
	}
	pline = sprintf("%s %s", pline, $0)
	if (pline ~ "));") {
		sub("^[	 ]*", "", pline)
		print pline >> inc_file
		if (pline ~ db_version_unique_name)
			print pline >> uinc_file;
		else {
			def = gensub("[	 ][	 ]*__P.*", "", 1, pline)
			sub("^.*[	 ][*]*", "", def)
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n%s\n",
			    def, def, pline) >> uinc_file
		}
		pline = ""
	}
}
/EXTERN:/ {
	sub("^.*EXTERN:[	 ][	 ]*", "")
	if ($0 ~ "^#if|^#endif") {
		print $0 >> ext_file
		print $0 >> uext_file
		next
	}
	if ($0 ~ "^#define.*[(]") {
		print $0 >> ext_file
		def = gensub("[(]", "@@DB_VERSION_UNIQUE_NAME@@(", 2)
		print def >> uext_file
		next
	}
	if ($0 ~ "^#define") {
		print $0 >> ext_file
		sub("[	 ]*$", "@@DB_VERSION_UNIQUE_NAME@@")
		print $0 >> uext_file
		next
	}
	eline = sprintf("%s %s", eline, $0)
	if (eline ~ "));") {
		sub("^[	 ]*", "", eline)
		print eline >> ext_file
		if (pline ~ db_version_unique_name)
			print pline >> uext_file;
		else {
			def = gensub("[	 ][	 ]*__P.*", "", 1, eline)
			sub("^.*[	 ][*]*", "", def)
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n%s\n",
			    def, def, eline) >> uext_file
		}
		eline = ""
	}
}
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@


1.1.1.2
log
@Import: RPM 4.0.4
@
text
@d12 1
a12 1
	if ($0 ~ "^#if|^#else|^#endif") {
a43 15

# When we switched to methods in 4.0, we guessed txn_{abort,begin,commit}
# were the interfaces applications would likely use and not be willing to
# change, due to the sheer volume of the calls.  Provide wrappers -- we
# could do txn_abort and txn_commit using macros, but not txn_begin, as
# the name of the field is txn_begin, we didn't want to modify it.
#
# The issue with txn_begin hits us in another way.  If configured with the
# --with-uniquename option, we use #defines to re-define DB's interfaces
# to unique names.  We can't do that for these functions because txn_begin
# is also a field name in the DB_ENV structure, and the #defines we use go
# at the end of the db.h file -- we get control too late to #define a field
# name.  So, modify the script that generates the unique names #defines to
# not generate them for these three functions, and don't include the three
# functions in libraries built with that configuration option.
d46 1
a46 1
	if ($0 ~ "^#if|^#else|^#endif") {
d67 2
a68 2
		if (eline ~ db_version_unique_name || eline ~ "^int txn_")
			print eline >> uext_file;
@


1.1.1.3
log
@Import: RPM 4.0.5
@
text
@d3 1
a3 2
# #defines, EXTERN are DB external function prototypes and #defines.)
#
d5 5
a9 13
# one file that contains the prototypes, and one file that contains a
# #define for the name to be processed during configuration when creating
# unique names for every global symbol in the DB library.
#
# The EXTERN lines are put into two files: one of which contains prototypes
# which are always appended to the db.h file, and one of which contains a
# #define list for use when creating unique symbol names.
#
# Four arguments:
#	e_dfile		list of EXTERN #defines
#	e_pfile		include file that contains EXTERN prototypes
#	i_dfile		list of internal (PUBLIC) #defines
#	i_pfile		include file that contains internal (PUBLIC) prototypes
d12 15
a26 3
	if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
		print $0 >> i_pfile
		print $0 >> i_dfile
d32 4
a35 2
		print pline >> i_pfile
		if (pline !~ db_version_unique_name) {
d38 2
a39 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n",
			    def, def) >> i_dfile
d61 15
a75 3
	if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
		print $0 >> e_pfile
		print $0 >> e_dfile
d81 4
a84 2
		print eline >> e_pfile
		if (eline !~ db_version_unique_name && eline !~ "^int txn_") {
d87 2
a88 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n",
			    def, def) >> e_dfile
@


1.1.1.4
log
@Import: RPM 4.1
@
text
@d3 2
a4 1
# #defines, EXTERN are DB external function prototypes and #defines.)  The
d6 13
a18 5
# one version for normal use, and one version to be post-processed based
# on creating unique file names for every global symbol in the DB library.
# The EXTERN lines are put into two versions of the db.h file, again, one
# version for normal use, and one version to be post-processed for unique
# naming.
d21 3
a23 15
	if ($0 ~ "^#if|^#else|^#endif") {
		print $0 >> inc_file
		print $0 >> uinc_file
		next
	}
	if ($0 ~ "^#define.*[(]") {
		print $0 >> inc_file
		def = gensub("[(]", "@@DB_VERSION_UNIQUE_NAME@@(", 2)
		print def >> uinc_file
		next
	}
	if ($0 ~ "^#define") {
		print $0 >> inc_file
		sub("[	 ]*$", "@@DB_VERSION_UNIQUE_NAME@@")
		print $0 >> uinc_file
d29 2
a30 4
		print pline >> inc_file
		if (pline ~ db_version_unique_name)
			print pline >> uinc_file;
		else {
d33 2
a34 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n%s\n",
			    def, def, pline) >> uinc_file
d56 3
a58 15
	if ($0 ~ "^#if|^#else|^#endif") {
		print $0 >> ext_file
		print $0 >> uext_file
		next
	}
	if ($0 ~ "^#define.*[(]") {
		print $0 >> ext_file
		def = gensub("[(]", "@@DB_VERSION_UNIQUE_NAME@@(", 2)
		print def >> uext_file
		next
	}
	if ($0 ~ "^#define") {
		print $0 >> ext_file
		sub("[	 ]*$", "@@DB_VERSION_UNIQUE_NAME@@")
		print $0 >> uext_file
d64 2
a65 4
		print eline >> ext_file
		if (eline ~ db_version_unique_name || eline ~ "^int txn_")
			print eline >> uext_file;
		else {
d68 2
a69 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n%s\n",
			    def, def, eline) >> uext_file
@


1.1.1.5
log
@Import: RPM 4.1.1
@
text
@d3 1
a3 2
# #defines, EXTERN are DB external function prototypes and #defines.)
#
d5 5
a9 13
# one file that contains the prototypes, and one file that contains a
# #define for the name to be processed during configuration when creating
# unique names for every global symbol in the DB library.
#
# The EXTERN lines are put into two files: one of which contains prototypes
# which are always appended to the db.h file, and one of which contains a
# #define list for use when creating unique symbol names.
#
# Four arguments:
#	e_dfile		list of EXTERN #defines
#	e_pfile		include file that contains EXTERN prototypes
#	i_dfile		list of internal (PUBLIC) #defines
#	i_pfile		include file that contains internal (PUBLIC) prototypes
d12 15
a26 3
	if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
		print $0 >> i_pfile
		print $0 >> i_dfile
d32 4
a35 2
		print pline >> i_pfile
		if (pline !~ db_version_unique_name) {
d38 2
a39 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n",
			    def, def) >> i_dfile
d61 15
a75 3
	if ($0 ~ "^#if|^#ifdef|^#ifndef|^#else|^#endif") {
		print $0 >> e_pfile
		print $0 >> e_dfile
d81 4
a84 2
		print eline >> e_pfile
		if (eline !~ db_version_unique_name && eline !~ "^int txn_") {
d87 2
a88 2
			printf("#define	%s %s@@DB_VERSION_UNIQUE_NAME@@\n",
			    def, def) >> e_dfile
@


