Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch-contrib
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch-contrib
Commits
657d5b14
提交
657d5b14
authored
11月 16, 2012
作者:
Michael S Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update chan vars script to handle all of the api_on_xx vars
上级
9a4efc00
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
57 行增加
和
3 行删除
+57
-3
create-chanvars-html-page.pl
mcollins/create-chanvars-html-page.pl
+51
-0
extract-fs-vars-from-source-tree.sh
mcollins/extract-fs-vars-from-source-tree.sh
+6
-3
没有找到文件。
mcollins/create-chanvars-html-page.pl
浏览文件 @
657d5b14
...
...
@@ -93,9 +93,11 @@ while(<FILEIN>) {
my
@RECIN
=
split
/#define /
,
$_
;
# debug
#print "$RECIN[1] \n";
no
warnings
;
$RECIN
[
1
]
=~
s/"//g
;
# strip quote chars
my
(
$key
,
$val
)
=
split
/\s/
,
$RECIN
[
1
];
$switch_types
{
$key
}
=
$val
;
use
warnings
;
}
close
(
FILEIN
);
...
...
@@ -264,6 +266,55 @@ while(<FILEIN>){
}
close
(
FILEIN
);
## Handle the switch_channel_api_on vars...
$datafile
=
$tmpdir
.
"/api-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
,
'api_on'
];
push
@
{
$source_idx
{
$filename
}{
$channel_variable_name
}
},
[
$linenum
,
'api_on'
];
# Debug
#print "var: $channel_variable_name\n";
}
close
(
FILEIN
);
#debug
#print dump(\%channel_vars);
#foreach (sort keys %channel_vars) { print "'$_'\n"; }
...
...
mcollins/extract-fs-vars-from-source-tree.sh
浏览文件 @
657d5b14
...
...
@@ -15,7 +15,7 @@
SRCDIR
=
/usr/src/freeswitch/src
#SRCDIR=/Users/michaelcollins/workspace/fs/freeswitch/src
TMPDIR
=
/tmp
HTML
DIR
=
/usr/local/freeswitch/htdocs
HTML
FILE
=
/var/www/chanvars.html
# Grep the variables, then grep the aliases in the header files
echo
"Searching source tree for channel variable set/get..."
...
...
@@ -25,6 +25,9 @@ grep -rn "[sg]et_variable_partner(" $SRCDIR/* | grep -v Binary | grep -v svn >>
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 switch_channel_api_on statements..."
grep
-rn
"switch_channel_api_on("
$SRCDIR
/
*
|
grep
-v
Binary
>
$TMPDIR
/api-on-vars.txt
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
...
...
@@ -33,5 +36,5 @@ grep -n "_VARIABLE" $SRCDIR/include/*h > $TMPDIR/header-defs.txt
grep
-rn
"_VARIABLE"
$SRCDIR
/mod/
*
>>
$TMPDIR
/header-defs.txt
# launch perl script here
echo
"Creating HTML file in
$
TMPDIR
directory
"
./create-chanvars-html-page.pl
--srcdir
=
$SRCDIR
--tmpdir
=
$TMPDIR
--htmldir
=
$HTMLDIR
echo
"Creating HTML file in
$
HTMLFILE
"
#./create-chanvars-html-page.pl --srcdir=$SRCDIR --tmpdir=$TMPDIR --htmlfile=$HTMLFILE
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论