1 #ifdef GLIB_COMPILATION
2 #undef GLIB_COMPILATION
11 void g_date_debug_print(GDate* d)
13 if (!d) g_print("NULL!\n");
15 g_print("julian: %u (%s) DMY: %u %u %u (%s)\n",
17 d->julian ? "valid" : "invalid",
21 d->dmy ? "valid" : "invalid");
26 /* These only work in the POSIX locale, maybe C too -
27 * type POSIX into the program to check them
29 char* posix_tests [] = {
42 int main(int argc, char** argv)
48 loc = setlocale(LC_ALL,"");
50 g_print("\nLocale set to %s\n", loc);
52 g_print("\nLocale unchanged\n");
56 while (fgets(input, 1023, stdin))
60 g_print("Enter a date to parse and press enter, or type `POSIX':\n");
64 if (strcmp(input,"POSIX\n") == 0)
66 char** s = posix_tests;
68 g_date_set_parse(d, *s);
70 g_print("POSIXy parse test `%s' ...", *s);
74 g_print(" failed.\n");
80 g_date_strftime(buf,100," parsed `%x' (%B %d %Y)\n",
90 g_date_set_parse(d, input);
94 g_print("Parse failed.\n");
100 g_date_strftime(buf,100,"Parsed: `%x' (%B %d %Y)\n",