/usr/share/makepp/Mpp/Scanner/Esqlc.pm is in makepp 2.0.98.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | # $Id: Esqlc.pm,v 1.12 2011/10/30 20:58:00 pfeiffer Exp $
=head1 NAME
Mpp::Scanner::Esqlc - makepp scanner for Embedded SQL C files
=head1 DESCRIPTION
Scans a C file for C<EXEC SQL INCLUDE>s, C<$include>s and C<#include>s.
Tags are:
=over
=item user
File scanned due to an EXEC SQL INCLUDE "filename" or $INCLUDE "filename"
directive.
=item sys
File scanned due to an EXEC SQL INCLUDE E<lt>filenameE<lt>, EXEC SQL INCLUDE
filename or $INCLUDE E<lt>filenameE<lt> directive.
=over 6
=item usersys
An EXEC SQL INCLUDE IDENTIFIER statement with neither <> nor quotes. This
gets extended with suffixes like F<.h> if needed.
=item sql
Temporarily assigned internally to EXEC SQL INCLUDE or $INCLUDE, before
deciding which of the above two to use.
=back
=cut
use strict;
package Mpp::Scanner::Esqlc;
use Mpp::Scanner::C;
our @ISA = 'Mpp::Scanner::C';
sub get_directive {
if( s/^\s*(?:EXEC\s+SQL\s+|\$\s*)INCLUDE(?:\s+EXTERN)?\s+(?=[^\s;])//i ) {
'sql';
} elsif( s/^\s*EXEC\s+(?:SQL|ORACLE)\s+OPTION\s\((sys_?)?include=(?:\((.+)\)|(.+))\)//i ) {
my $sys = $1;
for( $2 ? split( ',', $2 ) : $3 ) {
$_[0]->add_include_dir( user => $_ );
$_[0]->add_include_dir( usersys => $_ );
$_[0]->add_include_dir( sys => $_ ) if $sys;
}
return;
} elsif( s/^\s*EXEC\s+ORACLE\s+// ) {
if( s/^(DEFINE|IFN?DEF)(\s+\w+)\s*;/$2/i || s/^(ELSE|ENDIF)\s*;//i ) {
lc $1;
}
} else {
&Mpp::Scanner::C::get_directive;
}
}
sub other_directive {
my( $self, $cp, $finfo, $conditional, $tag, $scanworthy ) = @_;
return 0 unless $tag eq 'sql';
$_ = $self->expand_macros($_) if $conditional;
$$scanworthy = 1;
if( s/^(<)(.+?)>\s*;?\s*$// or s/^(['"]?)(.+?)\1\s*;?\s*$// ) {
$tag = $1 eq '<' ? 'sys' : $1 ? 'user' : 'usersys';
my $file = $1 ? $2 : lc $2; # downcase unquoted file
$self->include( $cp, $tag, $file, $finfo )
or undef;
}
}
1;
|