Return to test-getsubopt.c CVS log | Up to [cvsweb.bsd.lv] / mandoc |
File: [cvsweb.bsd.lv] / mandoc / test-getsubopt.c (download)
Revision 1.2, Sat Jan 4 01:11:00 2014 UTC (10 years, 8 months ago) by schwarze
Clean up feature tests: * Split the configure steering script out of the Makefile. * Let the configure step depend on the test sources. * Clean up the test programs such that they can be run. |
#if defined(__linux__) || defined(__MINT__) # define _GNU_SOURCE /* getsubopt() */ #endif #include <stdlib.h> extern char *suboptarg; int main(void) { char buf[] = "k=v"; 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)); }