[BACK]Return to test-getsubopt.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/test-getsubopt.c, Revision 1.2

1.1       kristaps    1: #if defined(__linux__) || defined(__MINT__)
                      2: # define _GNU_SOURCE /* getsubopt() */
                      3: #endif
                      4:
                      5: #include <stdlib.h>
                      6:
1.2     ! schwarze    7: extern char *suboptarg;
        !             8:
1.1       kristaps    9: int
1.2     ! schwarze   10: main(void)
1.1       kristaps   11: {
1.2     ! schwarze   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));
1.1       kristaps   19: }

CVSweb