+#if 0
+// Debug loading of locales... Strace does a better job though.
+ printf("Message catalog directory: %s\n", bindtextdomain("citadel-setup", LOCALEDIR"/locale"));
+ printf("Text domain: %s\n", textdomain("citadel-setup"));
+ printf("Text domain Charset: %s\n", bind_textdomain_codeset("citadel-setup","UTF8"));
+ {
+ int i;
+ for (i = 0; i < eMaxQuestions; i++)
+ printf("%s - %s\n", setup_titles[i], _(setup_titles[i]));
+ exit(0);
+ }
+#endif
+}
+
+/*
+ * print the actual stack frame.
+ */
+void cit_backtrace(void)
+{
+#ifdef HAVE_BACKTRACE
+ void *stack_frames[50];
+ size_t size, i;
+ char **strings;
+
+ size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
+ strings = backtrace_symbols(stack_frames, size);
+ for (i = 0; i < size; i++) {
+ if (strings != NULL)
+ fprintf(stderr, "%s\n", strings[i]);
+ else
+ fprintf(stderr, "%p\n", stack_frames[i]);
+ }
+ free(strings);
+#endif
+}