提交 cb036f2a authored 作者: Michael S Collins's avatar Michael S Collins

Update chan vars script to include 'switch_channel_execute_on' funcs as those use chan vars, too

上级 bf7b96be
...@@ -210,7 +210,54 @@ while(<FILEIN>){ ...@@ -210,7 +210,54 @@ while(<FILEIN>){
} }
} }
close(FILEIN);
## Handle the switch_channel_execute_on vars...
$datafile = $tmpdir . "/execute-on-vars.txt";
open(FILEIN,'<',$datafile) or die "$datafile - $!\n";
while(<FILEIN>){
chomp;
next unless m/\.c(pp)?:/; # only c and cpp files for now
my @RECIN = split /(\.c(pp)?)/,$_; # split on file name.c or name.cpp
my ($filename,$dir,$ext) = fileparse($RECIN[0]);
$filename .= $RECIN[1]; # append .c or .cpp
# debug
#print "$filename\n";
# trim off the srcdir from beginning of string
my $reldir = substr $dir, $srcdirlen;
#print "$filename $dir $ext ($reldir)\n";
if ( ! exists( $source_files{$filename} ) ) {
$source_files{ $filename } = $site . $reldir . $filename . '?r=HEAD';
}
## Extract line number for this occurrence in this source file
my $linenum = 0;
if ( $RECIN[3] =~ m/:(\d+):/ ) {
$linenum = $1;
}
my @temp = split /,\s*/,$_;
my $channel_variable_name = $temp[1];
## Clean off quotes, parens, semicolons...
$channel_variable_name =~ s/"|;|\)//g;
if ( exists( $switch_types{$channel_variable_name} ) ) {
## This isn't actually a channel variable name but rather a def from switch_types.h
$channel_variable_name = $switch_types{$channel_variable_name};
}
## Skip obvious exceptions...
next if $channel_variable_name =~ m/$obvious_exceptions/;
## populate the hash for this variable, filename and line num & set/get
push @{ $channel_vars{$channel_variable_name}{$filename} }, [$linenum, 'execute_on'];
push @{ $source_idx{$filename}{$channel_variable_name} }, [$linenum, 'execute_on'];
# Debug
#print "var: $channel_variable_name\n";
}
close(FILEIN); close(FILEIN);
#debug #debug
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
# MC 2009-04-02 # MC 2009-04-02
# Change these vars if your directories are different # Change these vars if your directories are different
SRCDIR=/usr/src/freeswitch.git #SRCDIR=/usr/src/freeswitch/src
SRCDIR=/Users/michaelcollins/workspace/fs/freeswitch/src
TMPDIR=/tmp TMPDIR=/tmp
HTMLDIR=/usr/local/freeswitch/htdocs HTMLDIR=/usr/local/freeswitch/htdocs
...@@ -21,11 +22,14 @@ echo "Searching source tree for channel variable set/get..." ...@@ -21,11 +22,14 @@ echo "Searching source tree for channel variable set/get..."
grep -rn "[sg]et_variable(" $SRCDIR/* | grep -v Binary | grep -v svn > $TMPDIR/get-set-vars.txt grep -rn "[sg]et_variable(" $SRCDIR/* | grep -v Binary | grep -v svn > $TMPDIR/get-set-vars.txt
grep -rn "[sg]et_variable_partner(" $SRCDIR/* | grep -v Binary | grep -v svn >> $TMPDIR/get-set-vars.txt grep -rn "[sg]et_variable_partner(" $SRCDIR/* | grep -v Binary | grep -v svn >> $TMPDIR/get-set-vars.txt
echo "Searching source tree for switch_channel_execute_on statements..."
grep -rn "switch_channel_execute_on(" $SRCDIR/* | grep -v Binary > $TMPDIR/execute-on-vars.txt
echo "Searching source tree for event_get_header channel variables... " echo "Searching source tree for event_get_header channel variables... "
grep -rn "switch_event_get_header(var_event" $SRCDIR/* | grep -v Binary > $TMPDIR/event-vars.txt grep -rn "switch_event_get_header(var_event" $SRCDIR/* | grep -v Binary > $TMPDIR/event-vars.txt
echo "Getting header file definitions..." echo "Getting header file definitions..."
grep -n "_VARIABLE" $SRCDIR/src/include/*h > $TMPDIR/header-defs.txt grep -n "_VARIABLE" $SRCDIR/include/*h > $TMPDIR/header-defs.txt
# launch perl script here # launch perl script here
echo "Creating HTML file in $TMPDIR directory" echo "Creating HTML file in $TMPDIR directory"
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论