Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch-contrib
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch-contrib
Commits
cb036f2a
提交
cb036f2a
authored
11月 08, 2011
作者:
Michael S Collins
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update chan vars script to include 'switch_channel_execute_on' funcs as those use chan vars, too
上级
bf7b96be
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
53 行增加
和
2 行删除
+53
-2
create-chanvars-html-page.pl
mcollins/create-chanvars-html-page.pl
+47
-0
extract-fs-vars-from-source-tree.sh
mcollins/extract-fs-vars-from-source-tree.sh
+6
-2
没有找到文件。
mcollins/create-chanvars-html-page.pl
浏览文件 @
cb036f2a
...
@@ -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
...
...
mcollins/extract-fs-vars-from-source-tree.sh
浏览文件 @
cb036f2a
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论