This commit is contained in:
2019-02-06 00:49:12 +03:00
commit 8dbb1bb605
4796 changed files with 506072 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#!/usr/bin/perl -w
#
# Learning Text::CPP... conclusion: not what I need.
#
#
package cpptokenizer;
use Text::CPP;
use Data::Dumper;
$Data::Dumper::TERSE = 1;
$Data::Dumper::INDENT = 1;
my $reader = new Text::CPP ( Language => "GNUC99" );
my ( $text, $type, $prettytype, $flags );
foreach my $file ( @ARGV ) {
print "File: $file\n", '-' x 70, "\n";
$reader->read( $file );
#print join("\n", $reader->tokens);
while ( ($text, $type, $flags) = $reader->token ) {
$prettytype = $reader->type( $type );
chomp( $text );
#print "$prettytype: $text ($type) +$flags\n";
print Data::Dumper->Dumpxs( [$text,$type,$flags,$prettytype],
[qw{text type flags prettytype}] ), "\n";
print "---\n";
}
print "\n\n";
}

View File

@@ -0,0 +1,34 @@
#!/usr/bin/perl -w
package try;
use strict;
BEGIN {
use lib qw{lib};
use MySQL::BinLog;
}
my %connect_params = (
hostname => 'whitaker.lj',
database => 'livejournal',
user => 'slave',
password => 'm&s',
port => 3337,
debug => 1,
log_slave_id => 512,
);
sub handler {
my $ev = shift;
print( ('-' x 70), "\n",
">>> QUERY: ", $ev->query_data, "\n",
('-' x 70), "\n" );
}
my $filename = shift @ARGV;
my $log = MySQL::BinLog->open( $filename );
#my $log = MySQL::BinLog->connect( %connect_params );
my @res = $log->handle_events( \&handler, MySQL::QUERY_EVENT );