summaryrefslogtreecommitdiff
path: root/src/timezone/pgtz.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timezone/pgtz.c')
-rw-r--r--src/timezone/pgtz.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c
new file mode 100644
index 0000000000..7bb789340b
--- /dev/null
+++ b/src/timezone/pgtz.c
@@ -0,0 +1,42 @@
+/*-------------------------------------------------------------------------
+ *
+ * pgtz.c
+ * Timezone Library Integration Functions
+ *
+ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
+ *
+ * IDENTIFICATION
+ * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.1 2004/04/30 04:09:23 momjian Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgtz.h"
+#include "tzfile.h"
+
+
+#ifdef WIN32
+static char tzdir[MAXPGPATH];
+static int done_tzdir = 0;
+char *pgwin32_TZDIR(void) {
+ char *p;
+ if (done_tzdir)
+ return tzdir;
+
+ if (GetModuleFileName(NULL,tzdir,MAXPGPATH) == 0)
+ return NULL;
+
+ canonicalize_path(tzdir);
+ if ((p = last_path_separator(tzdir)) == NULL)
+ return NULL;
+ else
+ *p = '\0';
+
+ strcat(tzdir,"/../share/timezone");
+
+ done_tzdir=1;
+ return tzdir;
+}
+#else
+#error pgwin32_TZDIR not implemented on non win32 yet!
+#endif