}
};
-
game_definition : TYPE_CMDQUEUE
{
if (myconfig[ncnf]->cmdqueue) {
{
myconfig[ncnf]->cmdqueue = curr_cmdqueue;
}
+ | TYPE_GAME_ARGS '=' game_args_list
+ {
+ /* nothing */
+ }
| KeyType '=' TYPE_VALUE
{
switch ( $1 ) {
myconfig[ncnf]->inprogressdir = strdup($3);
break;
- case TYPE_GAME_ARGS:
- {
- char **tmpargs;
- if (myconfig[ncnf]->bin_args) {
- myconfig[ncnf]->num_args++;
- tmpargs = calloc((myconfig[ncnf]->num_args+1), sizeof(char *));
- memcpy(tmpargs, myconfig[ncnf]->bin_args, (myconfig[ncnf]->num_args * sizeof(char *)));
- free(myconfig[ncnf]->bin_args);
- myconfig[ncnf]->bin_args = tmpargs;
- } else {
- myconfig[ncnf]->num_args = 1;
- myconfig[ncnf]->bin_args = calloc(2, sizeof(char *));
- }
- myconfig[ncnf]->bin_args[(myconfig[ncnf]->num_args)-1] = strdup($3);
- myconfig[ncnf]->bin_args[(myconfig[ncnf]->num_args)] = 0;
- }
- break;
-
default:
fprintf(stderr, "%s:%d: token does not belong into game definition, bailing out\n",
config, line);
}
;
-game_definitions : game_definitions game_definition
- | game_definition
+game_arg : TYPE_VALUE
+ {
+ char **tmpargs;
+ if (myconfig[ncnf]->bin_args) {
+ myconfig[ncnf]->num_args++;
+ tmpargs = calloc((myconfig[ncnf]->num_args+1), sizeof(char *));
+ memcpy(tmpargs, myconfig[ncnf]->bin_args, (myconfig[ncnf]->num_args * sizeof(char *)));
+ free(myconfig[ncnf]->bin_args);
+ myconfig[ncnf]->bin_args = tmpargs;
+ } else {
+ myconfig[ncnf]->num_args = 1;
+ myconfig[ncnf]->bin_args = calloc(2, sizeof(char *));
+ }
+ myconfig[ncnf]->bin_args[(myconfig[ncnf]->num_args)-1] = strdup($1);
+ myconfig[ncnf]->bin_args[(myconfig[ncnf]->num_args)] = 0;
+ }
+ ;
+
+game_args_list : game_arg
+ | game_arg ',' game_args_list
+ ;
+
+game_definitions : game_definition
+ | game_definition game_definitions
;
definegame : TYPE_DEFINE_GAME '{'
| TYPE_PATH_PASSWD { $$ = TYPE_PATH_PASSWD; }
| TYPE_PATH_LOCKFILE { $$ = TYPE_PATH_LOCKFILE; }
| TYPE_PATH_INPROGRESS { $$ = TYPE_PATH_INPROGRESS; }
- | TYPE_GAME_ARGS { $$ = TYPE_GAME_ARGS; }
| TYPE_RC_FMT { $$ = TYPE_RC_FMT; }
;
short_name = "NHstb"
# arguments for when we exec the binary
-game_args = "/bin/nethackstub"
-game_args = "foo"
-game_args = "user:%n"
-game_args = "shed_uid:%u"
-game_args = "bar"
+game_args = "/bin/nethackstub",
+ "foo",
+ "user:%n",
+ "shed_uid:%u",
+ "bar"
# From inside the jail, where dgamelaunch should put mail - should match up with
# NetHack settings.
game_name = "NetHack 3.4.3"
short_name = "NH343"
-game_args = "/bin/nethack"
-game_args = "-u"
-game_args = "%n"
+game_args = "/bin/nethack", "-u", "%n"
spooldir = "/var/mail/"
rc_template = "/dgl-default-rcfile"
short_name = "Cr017"
-game_args = "/bin/crawlss017"
-game_args = "-name"
-game_args = "%n"
-game_args = "-dir"
-game_args = "/crawlss017/"
-game_args = "-rc"
-game_args = "%rrcfiles/%n.crawlrc"
-game_args = "-morgue"
-game_args = "/crawlss017/morgues/"
-game_args = "-macro"
-game_args = "/crawlss017/macros/%n.macro"
+game_args = "/bin/crawlss017",
+ "-name", "%n",
+ "-dir", "/crawlss017/",
+ "-rc", "%rrcfiles/%n.crawlrc",
+ "-morgue", "/crawlss017/morgues/",
+ "-macro", "/crawlss017/macros/%n.macro"
rc_template = "/dgl-default-rcfile.crawl"
short_name = "Cr020"
-game_args = "/bin/crawlss020"
-game_args = "-name"
-game_args = "%n"
-game_args = "-dir"
-game_args = "/crawlss020/"
-game_args = "-rc"
-game_args = "/crawlss020/plr/%n/%n.crawlrc"
-game_args = "-morgue"
-game_args = "/crawlss020/plr/%n/"
-game_args = "-macro"
-game_args = "/crawlss020/plr/%n/"
+game_args = "/bin/crawlss020",
+ "-name", "%n",
+ "-dir", "/crawlss020/",
+ "-rc", "/crawlss020/plr/%n/%n.crawlrc",
+ "-morgue", "/crawlss020/plr/%n/",
+ "-macro", "/crawlss020/plr/%n/"
rc_template = "/dgl-default-rcfile.crawl"
rc_fmt = "/crawlss020/plr/%n/%n.crawlrc"