| Server IP : 170.10.161.225 / Your IP : 216.73.216.78 Web Server : Apache System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : calvet ( 273824) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/usr/bin/perl -w
#! /usr/bin/perl
use strict;
use warnings;
use Prima::Gencls;
# Main
unless ( $ARGV[ 0]) {
print <<TEXT;
Perl+C interface parser for Prima
format : prima-gencls.pl [ options] filename.cls [ out_directory]
options :
--h generates .h file
--inc generates .inc file
--tml generates .tml file ( and turns -O flag on)
-O turns optimized .inc generation on
-Idirlist specifies include directories list
--depend produces output of dependences of given object only
--sayparent produces parent dependency of object only
TEXT
die "\n";
}
my $args;
ARGUMENT: while( 1)
{
$_ = $ARGV[0];
last unless defined $_;
/^--depend$/ && do { $args->{ depend} = 1; next ARGUMENT; };
/^--sayparent$/ && do { $args->{ sayparent} = 1; next ARGUMENT; };
/^--h$/ && do { $args->{ genH} = 1; next ARGUMENT; };
/^--inc$/ && do { $args->{ genInc} = 1; next ARGUMENT; };
/^--tml$/ && do { $args->{ genTml} = 1; next ARGUMENT; };
/^-O$/ && do { $args->{ optimize} = 1; next ARGUMENT; };
/^-I(.*)$/ && do {
my $ii = $1;
push @{ $args->{ incpath}}, split ';', $ii;
next ARGUMENT;
};
last ARGUMENT;
} continue { shift @ARGV; }
die "insufficient number of parameters" unless $ARGV [0];
$ARGV[ 0] =~ m{^(.*[\\/])[^\\/]*$};
$args->{ dirPrefix} = $1 || "";
$args->{ dirOut} = "$ARGV[ 1]/" if $ARGV[ 1];
my @ancestors = gencls( $ARGV[ 0], $args);
if ( @ancestors) {
print ( map { "ancestor: $_\n"} @ancestors);
}