]> git.cameronkatri.com Git - mandoc.git/blob - test-getsubopt.c
Use C99 uint32_t, not BSD-style u_int32_t.
[mandoc.git] / test-getsubopt.c
1 #if defined(__linux__) || defined(__MINT__)
2 # define _GNU_SOURCE /* getsubopt() */
3 #endif
4
5 #include <stdlib.h>
6
7 extern char *suboptarg;
8
9 int
10 main(void)
11 {
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));
19 }