Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
6d2c6ad5
Commit
6d2c6ad5
authored
Oct 29, 2013
by
vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed interface. Small changes.
parent
feac5066
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
interface.c
interface.c
+13
-9
No files found.
interface.c
View file @
6d2c6ad5
...
@@ -224,17 +224,13 @@ int complete_string_list (char **list, int index, const char *text, int len, cha
...
@@ -224,17 +224,13 @@ int complete_string_list (char **list, int index, const char *text, int len, cha
char
*
command_generator
(
const
char
*
text
,
int
state
)
{
char
*
command_generator
(
const
char
*
text
,
int
state
)
{
static
int
len
,
index
,
mode
;
static
int
len
,
index
,
mode
;
char
c
=
0
;
if
(
!
state
)
{
if
(
!
state
)
{
len
=
strlen
(
text
);
len
=
strlen
(
text
);
index
=
-
1
;
index
=
-
1
;
rl_line_buffer
[
rl_point
]
=
'\0'
;
/* the effect should be such
c
=
rl_line_buffer
[
rl_point
];
* that the cursor position
rl_line_buffer
[
rl_point
]
=
0
;
* is at the end of line for
* the auto completion regex
* above (note the $ at end)
*/
mode
=
get_complete_mode
();
mode
=
get_complete_mode
();
}
else
{
}
else
{
if
(
index
==
-
1
)
{
return
0
;
}
if
(
index
==
-
1
)
{
return
0
;
}
...
@@ -246,19 +242,26 @@ char *command_generator (const char *text, int state) {
...
@@ -246,19 +242,26 @@ char *command_generator (const char *text, int state) {
switch
(
mode
&
7
)
{
switch
(
mode
&
7
)
{
case
0
:
case
0
:
index
=
complete_string_list
(
commands
,
index
,
text
,
len
,
&
R
);
index
=
complete_string_list
(
commands
,
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
return
R
;
case
1
:
case
1
:
index
=
complete_user_list
(
index
,
text
,
len
,
&
R
);
index
=
complete_user_list
(
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
return
R
;
case
2
:
case
2
:
index
=
complete_user_chat_list
(
index
,
text
,
len
,
&
R
);
index
=
complete_user_chat_list
(
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
return
R
;
case
3
:
case
3
:
return
rl_filename_completion_function
(
text
,
state
);
R
=
rl_filename_completion_function
(
text
,
state
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
case
4
:
case
4
:
index
=
complete_chat_list
(
index
,
text
,
len
,
&
R
);
index
=
complete_chat_list
(
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
return
R
;
default:
default:
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
0
;
return
0
;
}
}
}
}
...
@@ -268,6 +271,7 @@ char **complete_text (char *text, int start UU, int end UU) {
...
@@ -268,6 +271,7 @@ char **complete_text (char *text, int start UU, int end UU) {
}
}
void
interpreter
(
char
*
line
UU
)
{
void
interpreter
(
char
*
line
UU
)
{
if
(
!
line
)
{
return
;
}
if
(
line
&&
*
line
)
{
if
(
line
&&
*
line
)
{
add_history
(
line
);
add_history
(
line
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment