Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
03c981bf
提交
03c981bf
authored
9月 24, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add smaller banner for teeny tiny terminals
上级
f8760a1f
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
110 行增加
和
4 行删除
+110
-4
cc.sh
build/cc.sh
+10
-0
cc.sh
cc.sh
+2
-0
cluecon2_small.tmpl
cluecon2_small.tmpl
+10
-0
cluecon_small.tmpl
cluecon_small.tmpl
+8
-0
fs_cli.c
libs/esl/fs_cli.c
+37
-2
cc.h
libs/esl/src/include/cc.h
+2
-0
cc.h
src/include/cc.h
+2
-0
switch_core.c
src/switch_core.c
+39
-2
没有找到文件。
build/cc.sh
0 → 100644
浏览文件 @
03c981bf
#!/bin/sh
s
=(
`
stty
size
`
)
c
=
${
s
[1]
}
if
[
$c
-gt
99
]
;
then
cat
../cluecon2.tmpl
else
cat
../cluecon2_small.tmpl
fi
cc.sh
浏览文件 @
03c981bf
cc
=
`
cat
cluecon.tmpl |
sed
's/\\\\/\\\\\\\\/g'
|
awk
'{printf "%s\\\\n", $0}'
`
cc_s
=
`
cat
cluecon_small.tmpl |
sed
's/\\\\/\\\\\\\\/g'
|
awk
'{printf "%s\\\\n", $0}'
`
cat
<<
EOF
> src/include/cc.h
const char *cc = "
$cc
";
const char *cc_s = "
$cc_s
";
EOF
cluecon2_small.tmpl
0 → 100644
浏览文件 @
03c981bf
[01;44;33m
.===============================================================.
| _ |
| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
| / __| | | | |/ _ \/ __/ _ \| '_ \ / __/ _ \| '_ ` _ \ |
| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
| \___|_|\__,_|\___|\___\___/|_| |_| (_) \___\___/|_| |_| |_| |
| |
.===============================================================.
[0m
cluecon_small.tmpl
0 → 100644
浏览文件 @
03c981bf
.===============================================================.
| _ |
| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
| / __| | | | |/ _ \/ __/ _ \| '_ \ / __/ _ \| '_ ` _ \ |
| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
| \___|_|\__,_|\___|\___\___/|_| |_| (_) \___\___/|_| |_| |_| |
| |
.===============================================================.
libs/esl/fs_cli.c
浏览文件 @
03c981bf
...
...
@@ -116,6 +116,31 @@ static void clear_cli(void) {
fflush
(
stdout
);
}
static
void
screen_size
(
int
*
x
,
int
*
y
)
{
#ifdef WIN32
CONSOLE_SCREEN_BUFFER_INFO
csbi
;
int
ret
;
if
((
ret
=
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
&
csbi
)))
{
if
(
x
)
*
x
=
csbi
.
dwSize
.
X
;
if
(
y
)
*
y
=
csbi
.
dwSize
.
Y
;
}
#elif TIOCGWINSZ
struct
winsize
w
;
ioctl
(
0
,
TIOCGWINSZ
,
&
w
);
if
(
x
)
*
x
=
w
.
ws_col
;
if
(
y
)
*
y
=
w
.
ws_row
;
#else
if
(
x
)
*
x
=
24
;
if
(
x
)
*
x
=
80
;
#endif
}
/* If a fnkey is configured then process the command */
static
unsigned
char
console_fnkey_pressed
(
int
i
)
{
...
...
@@ -923,13 +948,19 @@ static const char *inf = "Type /help <enter> to see a list of commands\n\n\n";
static
void
print_banner
(
FILE
*
stream
)
{
int
x
;
const
char
*
use
=
NULL
;
#include <cc.h>
screen_size
(
&
x
,
NULL
);
use
=
(
x
>
100
)
?
cc
:
cc_s
;
#ifdef WIN32
/* Print banner in yellow with blue background */
SetConsoleTextAttribute
(
hStdout
,
ESL_SEQ_FYELLOW
|
BACKGROUND_BLUE
);
WriteFile
(
hStdout
,
banner
,
(
DWORD
)
strlen
(
banner
),
NULL
,
NULL
);
WriteFile
(
hStdout
,
cc
,
(
DWORD
)
strlen
(
cc
),
NULL
,
NULL
);
WriteFile
(
hStdout
,
use
,
(
DWORD
)
strlen
(
use
),
NULL
,
NULL
);
SetConsoleTextAttribute
(
hStdout
,
wOldColorAttrs
);
/* Print the rest info in default colors */
...
...
@@ -940,10 +971,14 @@ static void print_banner(FILE *stream)
ESL_SEQ_DEFAULT_COLOR
,
ESL_SEQ_FYELLOW
,
ESL_SEQ_BBLUE
,
banner
,
cc
,
ESL_SEQ_DEFAULT_COLOR
,
inf
);
use
,
ESL_SEQ_DEFAULT_COLOR
,
inf
);
fprintf
(
stream
,
"%s"
,
output_text_color
);
#endif
if
(
x
<
160
)
{
fprintf
(
stream
,
"
\n
[This app Best viewed at 160x60 or more..]
\n
"
);
}
}
static
void
set_fn_keys
(
cli_profile_t
*
profile
)
...
...
libs/esl/src/include/cc.h
浏览文件 @
03c981bf
const
char
*
cc
=
".========================================================================================================.
\n
| ____ _____ ____ _ ____ _ _ _____ |
\n
| / ___|___ _ __ ___ ___ |_ _|__ / ___| |_ _ ___ / ___|___ _ __ ( ) |___ / |
\n
| | | / _
\\
| '_ ` _
\\
/ _
\\
| |/ _
\\
| | | | | | |/ _
\\
| / _
\\
| '_
\\
|/| | |_
\\
|
\n
| | |__| (_) | | | | | | __/ | | (_) | | |___| | |_| | __/ |__| (_) | | | | | |___) | |
\n
|
\\
____
\\
___/|_| |_| |_|
\\
___| |_|
\\
___/
\\
____|_|
\\
__,_|
\\
___|
\\
____
\\
___/|_| |_| |_|____/ |
\n
| |
\n
| ____ _ _ _ _ ____ _ |
\n
| / ___| |__ (_) ___ __ _ __ _ ___ | | | / ___| /
\\
|
\n
| | | | '_
\\
| |/ __/ _` |/ _` |/ _
\\
| | |
\\
___
\\
/ _
\\
|
\n
| | |___| | | | | (_| (_| | (_| | (_) | | |_| |___) / ___
\\
|
\n
|
\\
____|_| |_|_|
\\
___
\\
__,_|
\\
__, |
\\
___( )
\\
___/|____/_/
\\
_
\\
|
\n
| |___/ |/ |
\n
| _ _ __ _ _ ___ _ _ ____ ___ _ _____ |
\n
| /
\\
_ _ __ _ _ _ ___| |_ / /_ | |_| |__ ( _ )| |_| |__ |___
\\
/ _
\\
/ |___ / |
\n
| / _
\\
| | | |/ _` | | | / __| __| | '_
\\
| __| '_
\\
_____ / _
\\
| __| '_
\\
__) | | | | | |_
\\
|
\n
| / ___
\\
|_| | (_| | |_|
\\
__
\\
|_ | (_) | |_| | | | |_____| | (_) | |_| | | | / __/| |_| | |___) | |
\n
| /_/
\\
_
\\
__,_|
\\
__, |
\\
__,_|___/
\\
__|
\\
___/
\\
__|_| |_|
\\
___/
\\
__|_| |_| |_____|
\\
___/|_|____/ |
\n
| |___/ |
\n
| _ |
\n
| __ ____ ____ __ ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
\n
|
\\
\\
/
\\
/ /
\\
\\
/
\\
/ /
\\
\\
/
\\
/ / / __| | | | |/ _
\\
/ __/ _
\\
| '_
\\
/ __/ _
\\
| '_ ` _
\\
|
\n
|
\\
V V /
\\
V V /
\\
V V / _ | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
\n
|
\\
_/
\\
_/
\\
_/
\\
_/
\\
_/
\\
_/ (_)
\\
___|_|
\\
__,_|
\\
___|
\\
___
\\
___/|_| |_| (_)
\\
___
\\
___/|_| |_| |_| |
\n
| |
\n
.========================================================================================================.
\n
"
;
const
char
*
cc_s
=
".===============================================================.
\n
| _ |
\n
| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
\n
| / __| | | | |/ _
\\
/ __/ _
\\
| '_
\\
/ __/ _
\\
| '_ ` _
\\
|
\n
| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
\n
|
\\
___|_|
\\
__,_|
\\
___|
\\
___
\\
___/|_| |_| (_)
\\
___
\\
___/|_| |_| |_| |
\n
| |
\n
.===============================================================.
\n
"
;
src/include/cc.h
浏览文件 @
03c981bf
const
char
*
cc
=
".========================================================================================================.
\n
| ____ _____ ____ _ ____ _ _ _____ |
\n
| / ___|___ _ __ ___ ___ |_ _|__ / ___| |_ _ ___ / ___|___ _ __ ( ) |___ / |
\n
| | | / _
\\
| '_ ` _
\\
/ _
\\
| |/ _
\\
| | | | | | |/ _
\\
| / _
\\
| '_
\\
|/| | |_
\\
|
\n
| | |__| (_) | | | | | | __/ | | (_) | | |___| | |_| | __/ |__| (_) | | | | | |___) | |
\n
|
\\
____
\\
___/|_| |_| |_|
\\
___| |_|
\\
___/
\\
____|_|
\\
__,_|
\\
___|
\\
____
\\
___/|_| |_| |_|____/ |
\n
| |
\n
| ____ _ _ _ _ ____ _ |
\n
| / ___| |__ (_) ___ __ _ __ _ ___ | | | / ___| /
\\
|
\n
| | | | '_
\\
| |/ __/ _` |/ _` |/ _
\\
| | |
\\
___
\\
/ _
\\
|
\n
| | |___| | | | | (_| (_| | (_| | (_) | | |_| |___) / ___
\\
|
\n
|
\\
____|_| |_|_|
\\
___
\\
__,_|
\\
__, |
\\
___( )
\\
___/|____/_/
\\
_
\\
|
\n
| |___/ |/ |
\n
| _ _ __ _ _ ___ _ _ ____ ___ _ _____ |
\n
| /
\\
_ _ __ _ _ _ ___| |_ / /_ | |_| |__ ( _ )| |_| |__ |___
\\
/ _
\\
/ |___ / |
\n
| / _
\\
| | | |/ _` | | | / __| __| | '_
\\
| __| '_
\\
_____ / _
\\
| __| '_
\\
__) | | | | | |_
\\
|
\n
| / ___
\\
|_| | (_| | |_|
\\
__
\\
|_ | (_) | |_| | | | |_____| | (_) | |_| | | | / __/| |_| | |___) | |
\n
| /_/
\\
_
\\
__,_|
\\
__, |
\\
__,_|___/
\\
__|
\\
___/
\\
__|_| |_|
\\
___/
\\
__|_| |_| |_____|
\\
___/|_|____/ |
\n
| |___/ |
\n
| _ |
\n
| __ ____ ____ __ ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
\n
|
\\
\\
/
\\
/ /
\\
\\
/
\\
/ /
\\
\\
/
\\
/ / / __| | | | |/ _
\\
/ __/ _
\\
| '_
\\
/ __/ _
\\
| '_ ` _
\\
|
\n
|
\\
V V /
\\
V V /
\\
V V / _ | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
\n
|
\\
_/
\\
_/
\\
_/
\\
_/
\\
_/
\\
_/ (_)
\\
___|_|
\\
__,_|
\\
___|
\\
___
\\
___/|_| |_| (_)
\\
___
\\
___/|_| |_| |_| |
\n
| |
\n
.========================================================================================================.
\n
"
;
const
char
*
cc_s
=
".===============================================================.
\n
| _ |
\n
| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |
\n
| / __| | | | |/ _
\\
/ __/ _
\\
| '_
\\
/ __/ _
\\
| '_ ` _
\\
|
\n
| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |
\n
|
\\
___|_|
\\
__,_|
\\
___|
\\
___
\\
___/|_| |_| (_)
\\
___
\\
___/|_| |_| |_| |
\n
| |
\n
.===============================================================.
\n
"
;
src/switch_core.c
浏览文件 @
03c981bf
...
...
@@ -186,6 +186,31 @@ SWITCH_DECLARE(FILE *) switch_core_get_console(void)
return
runtime
.
console
;
}
SWITCH_DECLARE
(
void
)
switch_core_screen_size
(
int
*
x
,
int
*
y
)
{
#ifdef WIN32
CONSOLE_SCREEN_BUFFER_INFO
csbi
;
int
ret
;
if
((
ret
=
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
&
csbi
)))
{
if
(
x
)
*
x
=
csbi
.
dwSize
.
X
;
if
(
y
)
*
y
=
csbi
.
dwSize
.
Y
;
}
#elif TIOCGWINSZ
struct
winsize
w
;
ioctl
(
0
,
TIOCGWINSZ
,
&
w
);
if
(
x
)
*
x
=
w
.
ws_col
;
if
(
y
)
*
y
=
w
.
ws_row
;
#else
if
(
x
)
*
x
=
24
;
if
(
x
)
*
x
=
80
;
#endif
}
SWITCH_DECLARE
(
FILE
*
)
switch_core_data_channel
(
switch_text_channel_t
channel
)
{
FILE
*
handle
=
stdout
;
...
...
@@ -1964,6 +1989,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
{
switch_event_t
*
event
;
char
*
cmd
;
int
x
=
0
;
const
char
*
use
=
NULL
;
#include "cc.h"
...
...
@@ -2000,14 +2027,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_event_fire
(
&
event
);
}
switch_core_screen_size
(
&
x
,
NULL
);
use
=
(
x
>
100
)
?
cc
:
cc_s
;
#ifdef WIN32
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"%s%s
\n\n
"
,
switch_core_banner
(),
cc
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"%s%s
\n\n
"
,
switch_core_banner
(),
use
);
#else
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"%s%s%s%s%s%s
\n\n
"
,
SWITCH_SEQ_DEFAULT_COLOR
,
SWITCH_SEQ_FYELLOW
,
SWITCH_SEQ_BBLUE
,
switch_core_banner
(),
cc
,
SWITCH_SEQ_DEFAULT_COLOR
);
use
,
SWITCH_SEQ_DEFAULT_COLOR
);
#endif
...
...
@@ -2017,6 +2049,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_core_session_limit
(
0
),
switch_core_sessions_per_second
(
0
),
switch_test_flag
((
&
runtime
),
SCF_USE_SQL
)
?
"Enabled"
:
"Disabled"
);
if
(
x
<
160
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"
\n
[This app Best viewed at 160x60 or more..]
\n
"
);
}
switch_clear_flag
((
&
runtime
),
SCF_NO_NEW_SESSIONS
);
if
((
cmd
=
switch_core_get_variable_dup
(
"api_on_startup"
)))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论