Rename function to be less win32 specific.

This commit is contained in:
Bruce Momjian 2004-05-01 01:34:47 +00:00
parent 1a273556a3
commit 0a2b9f9cde
2 changed files with 18 additions and 12 deletions

View File

@ -1,12 +1,12 @@
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* pgtz.c * pgtz.c
* Timezone Library Integration Functions * Timezone Library Integration Functions
* *
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.3 2004/04/30 20:23:28 momjian Exp $ * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.4 2004/05/01 01:34:47 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -16,27 +16,33 @@
static char tzdir[MAXPGPATH]; static char tzdir[MAXPGPATH];
static int done_tzdir = 0; static int done_tzdir = 0;
char *pgwin32_TZDIR(void) { char *
char *p; pg_TZDIR(void)
{
char *p;
if (done_tzdir) if (done_tzdir)
return tzdir; return tzdir;
#ifndef WIN32 #ifndef WIN32
StrNCpy(tzdir, PGDATADIR, MAXPGPATH); StrNCpy(tzdir, PGDATADIR, MAXPGPATH);
#else #else
if (GetModuleFileName(NULL,tzdir,MAXPGPATH) == 0) if (GetModuleFileName(NULL, tzdir, MAXPGPATH) == 0)
return NULL; return NULL;
#endif #endif
canonicalize_path(tzdir); canonicalize_path(tzdir);
#if 0
if ((p = last_path_separator(tzdir)) == NULL) if ((p = last_path_separator(tzdir)) == NULL)
return NULL; return NULL;
else else
*p = '\0'; *p = '\0';
#endif
strcat(tzdir,"/timezone"); strcat(tzdir, "/timezone");
puts(tzdir);
done_tzdir=1; done_tzdir = 1;
return tzdir; return tzdir;
} }

View File

@ -6,6 +6,6 @@
#define NOID #define NOID
#define TZDIR pgwin32_TZDIR() #define TZDIR pg_TZDIR()
char *pgwin32_TZDIR(void); char *pg_TZDIR(void);