#!/usr/bin/perl -pi # # @(#)$Id: esqlsed,v 100.2 2002/11/20 19:05:09 jleffler Exp $ # # DBD::Informix for Perl Version 5 # # Post-process C files generated by Informix ESQL/C versions 4.10.UC1 upwards # # Copyright 1996-98 Jonathan Leffler # Copyright 2002 IBM # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. # NB: Used by esqlcc script. $mode = 1 if ($line++ == 0 && /^#include $/o); if ($mode == 1) { if ($line == 1) { my ($info) = '/* Processed by $RCSfile: esqlsed,v $' . ' version $Revision: 100.2 $' . ' ($Date: 2002/11/20 19:05:09 $) */'; $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+\s*$/o); $_ = "" if (/^#include\s+\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); }