Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
425df0c7
提交
425df0c7
authored
1月 27, 2011
作者:
Leon de Rooij
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added test_reactive to mod_lua freeswitch.Dbh
上级
a0181479
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
191 行增加
和
0 行删除
+191
-0
freeswitch.i
src/mod/languages/mod_lua/freeswitch.i
+1
-0
freeswitch_lua.cpp
src/mod/languages/mod_lua/freeswitch_lua.cpp
+10
-0
freeswitch_lua.h
src/mod/languages/mod_lua/freeswitch_lua.h
+1
-0
mod_lua_wrap.cpp
src/mod/languages/mod_lua/mod_lua_wrap.cpp
+179
-0
没有找到文件。
src/mod/languages/mod_lua/freeswitch.i
浏览文件 @
425df0c7
...
...
@@ -89,6 +89,7 @@ class Dbh {
~Dbh();
bool release();
bool connected();
bool test_reactive(char *test_sql, char *drop_sql = NULL, char *reactive_sql = NULL);
bool query(char *sql, SWIGLUA_FN lua_fun);
int affected_rows();
};
...
...
src/mod/languages/mod_lua/freeswitch_lua.cpp
浏览文件 @
425df0c7
...
...
@@ -350,6 +350,16 @@ bool Dbh::connected()
return
m_connected
;
}
bool
Dbh
::
test_reactive
(
char
*
test_sql
,
char
*
drop_sql
,
char
*
reactive_sql
)
{
if
(
m_connected
)
{
if
(
switch_cache_db_test_reactive
(
dbh
,
test_sql
,
drop_sql
,
reactive_sql
)
==
SWITCH_TRUE
)
{
return
true
;
}
}
return
false
;
}
int
Dbh
::
query_callback
(
void
*
pArg
,
int
argc
,
char
**
argv
,
char
**
cargv
)
{
SWIGLUA_FN
*
lua_fun
=
(
SWIGLUA_FN
*
)
pArg
;
...
...
src/mod/languages/mod_lua/freeswitch_lua.h
浏览文件 @
425df0c7
...
...
@@ -62,6 +62,7 @@ namespace LUA {
~
Dbh
();
bool
release
();
bool
connected
();
bool
test_reactive
(
char
*
test_sql
,
char
*
drop_sql
=
NULL
,
char
*
reactive_sql
=
NULL
);
bool
query
(
char
*
sql
,
SWIGLUA_FN
lua_fun
);
int
affected_rows
();
};
...
...
src/mod/languages/mod_lua/mod_lua_wrap.cpp
浏览文件 @
425df0c7
...
...
@@ -7254,6 +7254,184 @@ fail:
}
static
int
_wrap_Dbh_test_reactive__SWIG_0
(
lua_State
*
L
)
{
int
SWIG_arg
=
-
1
;
LUA
::
Dbh
*
arg1
=
(
LUA
::
Dbh
*
)
0
;
char
*
arg2
=
(
char
*
)
0
;
char
*
arg3
=
(
char
*
)
0
;
char
*
arg4
=
(
char
*
)
0
;
bool
result
;
SWIG_check_num_args
(
"test_reactive"
,
4
,
4
)
if
(
!
SWIG_isptrtype
(
L
,
1
))
SWIG_fail_arg
(
"test_reactive"
,
1
,
"LUA::Dbh *"
);
if
(
!
lua_isstring
(
L
,
2
))
SWIG_fail_arg
(
"test_reactive"
,
2
,
"char *"
);
if
(
!
lua_isstring
(
L
,
3
))
SWIG_fail_arg
(
"test_reactive"
,
3
,
"char *"
);
if
(
!
lua_isstring
(
L
,
4
))
SWIG_fail_arg
(
"test_reactive"
,
4
,
"char *"
);
if
(
!
SWIG_IsOK
(
SWIG_ConvertPtr
(
L
,
1
,(
void
**
)
&
arg1
,
SWIGTYPE_p_LUA__Dbh
,
0
))){
SWIG_fail_ptr
(
"Dbh_test_reactive"
,
1
,
SWIGTYPE_p_LUA__Dbh
);
}
arg2
=
(
char
*
)
lua_tostring
(
L
,
2
);
arg3
=
(
char
*
)
lua_tostring
(
L
,
3
);
arg4
=
(
char
*
)
lua_tostring
(
L
,
4
);
result
=
(
bool
)(
arg1
)
->
test_reactive
(
arg2
,
arg3
,
arg4
);
SWIG_arg
=
0
;
lua_pushboolean
(
L
,(
int
)(
result
==
true
));
SWIG_arg
++
;
return
SWIG_arg
;
if
(
0
)
SWIG_fail
;
fail:
lua_error
(
L
);
return
SWIG_arg
;
}
static
int
_wrap_Dbh_test_reactive__SWIG_1
(
lua_State
*
L
)
{
int
SWIG_arg
=
-
1
;
LUA
::
Dbh
*
arg1
=
(
LUA
::
Dbh
*
)
0
;
char
*
arg2
=
(
char
*
)
0
;
char
*
arg3
=
(
char
*
)
0
;
bool
result
;
SWIG_check_num_args
(
"test_reactive"
,
3
,
3
)
if
(
!
SWIG_isptrtype
(
L
,
1
))
SWIG_fail_arg
(
"test_reactive"
,
1
,
"LUA::Dbh *"
);
if
(
!
lua_isstring
(
L
,
2
))
SWIG_fail_arg
(
"test_reactive"
,
2
,
"char *"
);
if
(
!
lua_isstring
(
L
,
3
))
SWIG_fail_arg
(
"test_reactive"
,
3
,
"char *"
);
if
(
!
SWIG_IsOK
(
SWIG_ConvertPtr
(
L
,
1
,(
void
**
)
&
arg1
,
SWIGTYPE_p_LUA__Dbh
,
0
))){
SWIG_fail_ptr
(
"Dbh_test_reactive"
,
1
,
SWIGTYPE_p_LUA__Dbh
);
}
arg2
=
(
char
*
)
lua_tostring
(
L
,
2
);
arg3
=
(
char
*
)
lua_tostring
(
L
,
3
);
result
=
(
bool
)(
arg1
)
->
test_reactive
(
arg2
,
arg3
);
SWIG_arg
=
0
;
lua_pushboolean
(
L
,(
int
)(
result
==
true
));
SWIG_arg
++
;
return
SWIG_arg
;
if
(
0
)
SWIG_fail
;
fail:
lua_error
(
L
);
return
SWIG_arg
;
}
static
int
_wrap_Dbh_test_reactive__SWIG_2
(
lua_State
*
L
)
{
int
SWIG_arg
=
-
1
;
LUA
::
Dbh
*
arg1
=
(
LUA
::
Dbh
*
)
0
;
char
*
arg2
=
(
char
*
)
0
;
bool
result
;
SWIG_check_num_args
(
"test_reactive"
,
2
,
2
)
if
(
!
SWIG_isptrtype
(
L
,
1
))
SWIG_fail_arg
(
"test_reactive"
,
1
,
"LUA::Dbh *"
);
if
(
!
lua_isstring
(
L
,
2
))
SWIG_fail_arg
(
"test_reactive"
,
2
,
"char *"
);
if
(
!
SWIG_IsOK
(
SWIG_ConvertPtr
(
L
,
1
,(
void
**
)
&
arg1
,
SWIGTYPE_p_LUA__Dbh
,
0
))){
SWIG_fail_ptr
(
"Dbh_test_reactive"
,
1
,
SWIGTYPE_p_LUA__Dbh
);
}
arg2
=
(
char
*
)
lua_tostring
(
L
,
2
);
result
=
(
bool
)(
arg1
)
->
test_reactive
(
arg2
);
SWIG_arg
=
0
;
lua_pushboolean
(
L
,(
int
)(
result
==
true
));
SWIG_arg
++
;
return
SWIG_arg
;
if
(
0
)
SWIG_fail
;
fail:
lua_error
(
L
);
return
SWIG_arg
;
}
static
int
_wrap_Dbh_test_reactive
(
lua_State
*
L
)
{
int
argc
;
int
argv
[
5
]
=
{
1
,
2
,
3
,
4
,
5
};
argc
=
lua_gettop
(
L
);
if
(
argc
==
2
)
{
int
_v
;
{
void
*
ptr
;
if
(
SWIG_isptrtype
(
L
,
argv
[
0
])
==
0
||
SWIG_ConvertPtr
(
L
,
argv
[
0
],
(
void
**
)
&
ptr
,
SWIGTYPE_p_LUA__Dbh
,
0
))
{
_v
=
0
;
}
else
{
_v
=
1
;
}
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
1
]);
}
if
(
_v
)
{
return
_wrap_Dbh_test_reactive__SWIG_2
(
L
);
}
}
}
if
(
argc
==
3
)
{
int
_v
;
{
void
*
ptr
;
if
(
SWIG_isptrtype
(
L
,
argv
[
0
])
==
0
||
SWIG_ConvertPtr
(
L
,
argv
[
0
],
(
void
**
)
&
ptr
,
SWIGTYPE_p_LUA__Dbh
,
0
))
{
_v
=
0
;
}
else
{
_v
=
1
;
}
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
1
]);
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
2
]);
}
if
(
_v
)
{
return
_wrap_Dbh_test_reactive__SWIG_1
(
L
);
}
}
}
}
if
(
argc
==
4
)
{
int
_v
;
{
void
*
ptr
;
if
(
SWIG_isptrtype
(
L
,
argv
[
0
])
==
0
||
SWIG_ConvertPtr
(
L
,
argv
[
0
],
(
void
**
)
&
ptr
,
SWIGTYPE_p_LUA__Dbh
,
0
))
{
_v
=
0
;
}
else
{
_v
=
1
;
}
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
1
]);
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
2
]);
}
if
(
_v
)
{
{
_v
=
lua_isstring
(
L
,
argv
[
3
]);
}
if
(
_v
)
{
return
_wrap_Dbh_test_reactive__SWIG_0
(
L
);
}
}
}
}
}
lua_pushstring
(
L
,
"No matching function for overloaded 'Dbh_test_reactive'"
);
lua_error
(
L
);
return
0
;
}
static
int
_wrap_Dbh_query
(
lua_State
*
L
)
{
int
SWIG_arg
=
-
1
;
LUA
::
Dbh
*
arg1
=
(
LUA
::
Dbh
*
)
0
;
...
...
@@ -7328,6 +7506,7 @@ delete arg1;
static
swig_lua_method
swig_LUA_Dbh_methods
[]
=
{
{
"release"
,
_wrap_Dbh_release
},
{
"connected"
,
_wrap_Dbh_connected
},
{
"test_reactive"
,
_wrap_Dbh_test_reactive
},
{
"query"
,
_wrap_Dbh_query
},
{
"affected_rows"
,
_wrap_Dbh_affected_rows
},
{
0
,
0
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论