8 void g_date_debug_print(GDate
* d
)
10 if (!d
) g_print("NULL!\n");
12 g_print("julian: %u (%s) DMY: %u %u %u (%s)\n",
14 d
->julian
? "valid" : "invalid",
18 d
->dmy
? "valid" : "invalid");
23 /* These only work in the POSIX locale, maybe C too -
24 * type POSIX into the program to check them
26 char* posix_tests
[] = {
39 int main(int argc
, char** argv
)
45 loc
= setlocale(LC_ALL
,"");
47 g_print("\nLocale set to %s\n", loc
);
49 g_print("\nLocale unchanged\n");
53 while (fgets(input
, 1023, stdin
))
57 g_print("Enter a date to parse and press enter, or type `POSIX':\n");
61 if (strcmp(input
,"POSIX\n") == 0)
63 char** s
= posix_tests
;
65 g_date_set_parse(d
, *s
);
67 g_print("POSIXy parse test `%s' ...", *s
);
71 g_print(" failed.\n");
77 g_date_strftime(buf
,100," parsed `%x' (%B %d %Y)\n",
87 g_date_set_parse(d
, input
);
91 g_print("Parse failed.\n");
97 g_date_strftime(buf
,100,"Parsed: `%x' (%B %d %Y)\n",