Import mdocml-1.13.1
[dragonfly.git] / contrib / mdocml / test-getsubopt.c
CommitLineData
36342e81
SW
1#if defined(__linux__) || defined(__MINT__)
2# define _GNU_SOURCE /* getsubopt() */
3#endif
4
5#include <stdlib.h>
6
070c62a6
FF
7extern char *suboptarg;
8
36342e81 9int
070c62a6 10main(void)
36342e81 11{
070c62a6
FF
12 char buf[] = "k=v";
13 char *options = buf;
14 char token0[] = "k";
15 char *const tokens[] = { token0, NULL };
16 char *value = NULL;
17 return( ! (0 == getsubopt(&options, tokens, &value)
18 && suboptarg == buf && value == buf+2 && options == buf+3));
36342e81 19}