File: esqlsed

package info (click to toggle)
libdbd-informix-perl 2003.04-3
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k, sarge
  • size: 1,232 kB
  • ctags: 467
  • sloc: perl: 7,349; ansic: 5,340; sh: 184; makefile: 58
file content (36 lines) | stat: -rwxr-xr-x 1,051 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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 <sqlhdr\.h>$/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+<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);
}