00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <string.h>
00020 #include <unistd.h>
00021 #include "gis.h"
00022 #include "glocale.h"
00023
00024
00038 char *
00039 G_location_path()
00040 {
00041 char *location;
00042
00043 location = G__location_path();
00044 if(access(location,0) != 0)
00045 {
00046 char msg[400];
00047
00048 sprintf(msg,_("LOCATION << %s >> not available"), location) ;
00049 G_fatal_error (msg);
00050 }
00051
00052 return location;
00053 }
00054
00055
00068 char *
00069 G_location()
00070 {
00071 return G_getenv ("LOCATION_NAME");
00072 }
00073
00074 char *
00075 G__location_path()
00076 {
00077 char *location = 0;
00078 char *base;
00079 char *name;
00080
00081 name = G_location();
00082 base = G_gisdbase();
00083 location = G_malloc (strlen (base) + strlen (name) + 2);
00084 sprintf (location, "%s/%s", base, name);
00085
00086 return location;
00087 }