|
Revision 1665, 1.3 kB
(checked in by ensc, 4 years ago)
|
handle plain-style char** args also
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifdef HAVE_CONFIG_H |
|---|
| 20 |
# include <config.h> |
|---|
| 21 |
#endif |
|---|
| 22 |
|
|---|
| 23 |
#include "command.h" |
|---|
| 24 |
#include "util.h" |
|---|
| 25 |
|
|---|
| 26 |
void |
|---|
| 27 |
Command_appendParameter(struct Command *cmd, char const *param) |
|---|
| 28 |
{ |
|---|
| 29 |
switch (cmd->params_style_) { |
|---|
| 30 |
case parNONE : |
|---|
| 31 |
Vector_init(&cmd->params.v, 10); |
|---|
| 32 |
cmd->params_style_ = parVEC; |
|---|
| 33 |
|
|---|
| 34 |
case parVEC : { |
|---|
| 35 |
char const **p = Vector_pushback(&cmd->params.v); |
|---|
| 36 |
*p = param; |
|---|
| 37 |
break; |
|---|
| 38 |
} |
|---|
| 39 |
|
|---|
| 40 |
default : |
|---|
| 41 |
WRITE_MSG(2, "internal error: conflicting functions Command_appendParameter() and Command_setParams() used together; aborting...\n"); |
|---|
| 42 |
abort(); |
|---|
| 43 |
} |
|---|
| 44 |
} |
|---|