1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

config: Reduce the interface offered to exmode.

(cherry picked from commit 63e82e68e40ac7a4732b8e5911ce25ffd7bbc13b,
 but removed the parse_config_file change that broke the build)
This commit is contained in:
Kalle Olavi Niemitalo 2008-02-03 00:20:07 +02:00 committed by Kalle Olavi Niemitalo
parent e4243bd8a3
commit 0a5652da1c
3 changed files with 15 additions and 8 deletions

View File

@ -339,7 +339,7 @@ static const struct parse_handler parse_handlers[] = {
};
enum parse_error
static enum parse_error
parse_config_command(struct option *options, unsigned char **file, int *line,
struct string *mirror, int is_system_conf)
{
@ -376,6 +376,16 @@ parse_config_command(struct option *options, unsigned char **file, int *line,
return ERROR_COMMAND;
}
#ifdef CONFIG_EXMODE
enum parse_error
parse_config_exmode_command(unsigned char *cmd)
{
int dummyline = 0;
return parse_config_command(config_options, &cmd, &dummyline, NULL, 0);
}
#endif /* CONFIG_EXMODE */
void
parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,

View File

@ -14,10 +14,9 @@ enum parse_error {
};
void load_config(void);
enum parse_error parse_config_command(struct option *options,
unsigned char **file, int *line,
struct string *mirror,
int is_system_conf);
#ifdef CONFIG_EXMODE
enum parse_error parse_config_exmode_command(unsigned char *cmd);
#endif
void parse_config_file(struct option *options, unsigned char *name,
unsigned char *file, struct string *mirror,
int is_system_conf);

View File

@ -63,7 +63,6 @@ static int
exmode_confcmd_handler(struct session *ses, unsigned char *command,
unsigned char *args)
{
int dummyline = 0;
enum parse_error err;
assert(ses && command && args);
@ -74,8 +73,7 @@ exmode_confcmd_handler(struct session *ses, unsigned char *command,
/* Undo the arguments separation. */
if (*args) *(--args) = ' ';
err = parse_config_command(config_options, &command, &dummyline, NULL,
0);
err = parse_config_exmode_command(command);
return err;
}