1 /* Test for strverscmp() */
7 #define MAX_STRINGS 256
8 #define MAX_LINE_SIZE 32
11 compare (const void *p1
, const void *p2
)
13 return strverscmp (*((char **) p1
), *((char **) p2
));
19 char line
[MAX_LINE_SIZE
+ 1];
20 char *str
[MAX_STRINGS
];
24 while (count
< MAX_STRINGS
&& fgets (line
, MAX_LINE_SIZE
, stdin
) != NULL
)
26 n
= strlen (line
) - 1;
31 str
[count
] = strdup (line
);
33 if (str
[count
] == NULL
)
39 qsort (str
, count
, sizeof (char *), compare
);
41 for (i
= 0; i
< count
; ++i
)
47 #include <support/test-driver.c>