#!/usr/bin/perl -pi
#
# @(#)$Id: esqlsed version /main/8 1998-06-15 22:04:08 $ 
#
# DBD::Informix for Perl Version 5
#
# Post-process C files generated by Informix ESQL/C versions 4.10.UC1 upwards
#
# Copyright (c) 1996-98 Jonathan Leffler
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.

$mode = 1 if ($line++ == 0 && /^#include <sqlhdr\.h>$/o);
if ($mode == 1)
{
	if ($line == 1)
	{
		my ($info) =
			'/* Processed by $RCSfile: esqlsed,v $' .
			' version $Revision: 60.2 $' .
			' ($Date: 1998/06/15 22:04:08 $) */';
		$info =~ s/\$[A-Z][A-Za-z]*: ([^\$]+) \$/$1/g;   # Remove RCS!
		$info =~ s/,v//g;
		print "$info\n#include \"esqlc.h\"\n";
		$_ = "";
	}
	$_ = "" if (/^#include\s+<sqlca\.h>\s*$/o);
	$_ = "" if (/^#include\s+<sqlhdr\.h>\s*$/o);
	$_ = "" if (/^extern\s+_SQCURSOR\s*\*_iqnprep\(\);\s*$/o);
	$_ = "" if (/^#define\s+const\s*$/o);
	s/\(char\s*\*\)\s*0/0/og if (/\b_iq\w+\(/o);
}
