Browse Source

Add defaultparam for calcmenu.c32 (tail by default)

master
Mike Hiretsky 11 years ago
parent
commit
d9684f2e90
  1. 2
      calcmenumain.c
  2. 19
      calcreadconfig.c

2
calcmenumain.c

@ -83,6 +83,8 @@ const struct menu_parameter mparm[NPARAMS] = {
#define VSHIFT (cm->mparm[P_VSHIFT])
#define HIDDEN_ROW (cm->mparm[P_HIDDEN_ROW])
/* transfering buffer by default */
char default_tail_cmdline[MAX_CMDLINE_LEN];
/* transfering buffer */
char tail_cmdline[MAX_CMDLINE_LEN];
/* number of parameter in defaultparam */

19
calcreadconfig.c

@ -902,6 +902,8 @@ static void parse_config_file(FILE *f)
p = skipspace(p);
m->fkeyhelp[fkeyno].background = refstrdup(p);
}
} else if ( looking_at(p, "defaultparam") ) {
strncpy(default_tail_cmdline,skipspace(p+12),100);
} else if ( (ep = looking_at(p, "include")) ) {
do_include:
{
@ -1137,6 +1139,8 @@ void parse_configs(char **argv)
const char *filename;
struct menu *m;
struct menu_entry *me;
default_tail_cmdline[0] = 0;
tail_cmdline[0] = 0;
empty_string = refstrdup("");
@ -1156,6 +1160,21 @@ void parse_configs(char **argv)
while ( (filename = *argv++) )
parse_one_config(filename);
}
if(strlen(default_tail_cmdline))
{
char *p = default_tail_cmdline;
while(strchr(p,' '))
{
*strchr(p,' ')= NULL;
if(strlen(p))
parse_one_config(p);
p += strlen(p)+1;
}
if(strlen(p))
{
parse_one_config(p);
}
}
/* On final EOF process the last label statement */
record(current_menu, &ld, append);

Loading…
Cancel
Save