mjc 96/10/09 08:23:12
Modified: src http_config.c http_config.h CHANGES Log: Added additional TAKExx options for directives, to allow directives to have a variable number of arguments between one and three. Revision Changes Path 1.26 +50 -2 apache/src/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache/src/http_config.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C3 -r1.25 -r1.26 *** http_config.c 1996/10/08 22:19:20 1.25 --- http_config.c 1996/10/09 15:23:08 1.26 *************** *** 50,56 **** * */ ! /* $Id: http_config.c,v 1.25 1996/10/08 22:19:20 brian Exp $ */ /* * http_config.c: once was auxillary functions for reading httpd's config --- 50,56 ---- * */ ! /* $Id: http_config.c,v 1.26 1996/10/09 15:23:08 mjc Exp $ */ /* * http_config.c: once was auxillary functions for reading httpd's config *************** *** 400,406 **** char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args) { ! char *w, *w2, *errmsg; if ((parms->override & cmd->req_override) == 0) return pstrcat (parms->pool, cmd->name, " not allowed here", NULL); --- 400,406 ---- char *invoke_cmd(command_rec *cmd, cmd_parms *parms, void *mconfig, char *args) { ! char *w, *w2, *w3, *errmsg; if ((parms->override & cmd->req_override) == 0) return pstrcat (parms->pool, cmd->name, " not allowed here", NULL); *************** *** 449,454 **** --- 449,502 ---- cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); return (*cmd->func) (parms, mconfig, w, *w2 ? w2 : NULL); + + case TAKE3: + + w = getword_conf (parms->pool, &args); + w2 = getword_conf (parms->pool, &args); + w3 = getword_conf (parms->pool, &args); + + if (*w == '\0' || *w2 == '\0' || *w3 == '\0' || *args != 0) + return pstrcat (parms->pool, cmd->name, " takes three arguments", + cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); + + return (*cmd->func) (parms, mconfig, w, w2, w3); + + case TAKE23: + + w = getword_conf (parms->pool, &args); + w2 = getword_conf (parms->pool, &args); + w3 = *args ? getword_conf (parms->pool, &args) : NULL; + + if (*w == '\0' || *w2 == '\0' || *args != 0) + return pstrcat (parms->pool, cmd->name, " takes two or three arguments", + cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); + + return (*cmd->func) (parms, mconfig, w, w2, w3); + + case TAKE123: + + w = getword_conf (parms->pool, &args); + w2 = *args ? getword_conf (parms->pool, &args) : NULL; + w3 = *args ? getword_conf (parms->pool, &args) : NULL; + + if (*w == '\0' || *args != 0) + return pstrcat (parms->pool, cmd->name, " takes one, two or three arguments", + cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); + + return (*cmd->func) (parms, mconfig, w, w2, w3); + + case TAKE13: + + w = getword_conf (parms->pool, &args); + w2 = *args ? getword_conf (parms->pool, &args) : NULL; + w3 = *args ? getword_conf (parms->pool, &args) : NULL; + + if (*w == '\0' || (*w2 && !w3) || *args != 0) + return pstrcat (parms->pool, cmd->name, " takes one or three arguments", + cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); + + return (*cmd->func) (parms, mconfig, w, w2, w3); case ITERATE: 1.15 +6 -2 apache/src/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache/src/http_config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C3 -r1.14 -r1.15 *** http_config.h 1996/10/08 22:19:21 1.14 --- http_config.h 1996/10/09 15:23:08 1.15 *************** *** 50,56 **** * */ ! /* $Id: http_config.h,v 1.14 1996/10/08 22:19:21 brian Exp $ */ /* * The central data structures around here... --- 50,56 ---- * */ ! /* $Id: http_config.h,v 1.15 1996/10/09 15:23:08 mjc Exp $ */ /* * The central data structures around here... *************** *** 70,76 **** */ FLAG, /* One of 'On' or 'Off' */ NO_ARGS, /* No args at all, e.g. </Directory> */ ! TAKE12 /* one or two arguments */ }; typedef struct command_struct { --- 70,80 ---- */ FLAG, /* One of 'On' or 'Off' */ NO_ARGS, /* No args at all, e.g. </Directory> */ ! TAKE12, /* one or two arguments */ ! TAKE3, /* three arguments only */ ! TAKE23, /* two or three arguments */ ! TAKE123, /* one, two or three arguments */ ! TAKE13 /* one or three arguments */ }; typedef struct command_struct { 1.69 +4 -1 apache/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.68 retrieving revision 1.69 diff -C3 -r1.68 -r1.69 *** CHANGES 1996/09/29 14:16:09 1.68 --- CHANGES 1996/10/09 15:23:09 1.69 *************** *** 1,6 **** ! $Id: CHANGES,v 1.68 1996/09/29 14:16:09 chuck Exp $ Changes with Apache 1.2b1: *) Phase I proxy overhaul: Added support for null form data set [Petr Lampa] --- 1,9 ---- ! $Id: CHANGES,v 1.69 1996/10/09 15:23:09 mjc Exp $ Changes with Apache 1.2b1: + + *) Allow directives to have any number of arguments between one + and three, with TAKE12, TAKE23, TAKE123, TAKE13 and TAKE3. *) Phase I proxy overhaul: Added support for null form data set [Petr Lampa]