Return to test-getsubopt.c CVS log | Up to [cvsweb.bsd.lv] / mandoc |
version 1.1, 2011/07/24 18:15:14 | version 1.2, 2014/01/04 01:11:00 | ||
---|---|---|---|
|
|
||
#include <stdlib.h> | #include <stdlib.h> | ||
extern char *suboptarg; | |||
int | int | ||
main(int argc, char **argv) | main(void) | ||
{ | { | ||
getsubopt(argv, argv, argv); | char buf[] = "k=v"; | ||
return 0; | char *options = buf; | ||
char token0[] = "k"; | |||
char *const tokens[] = { token0, NULL }; | |||
char *value = NULL; | |||
return( ! (0 == getsubopt(&options, tokens, &value) | |||
&& suboptarg == buf && value == buf+2 && options == buf+3)); | |||
} | } |