Go to the documentation of this file.00001
00014 #include <unistd.h>
00015 #include <grass/gis.h>
00016 #include <grass/glocale.h>
00017
00018 #define PERMANENT "PERMANENT"
00019
00025 struct Key_Value *G_get_projunits(void)
00026 {
00027 int stat;
00028 struct Key_Value *in_units_keys;
00029 char path[GPATH_MAX];
00030
00031 G__file_name(path, "", UNIT_FILE, PERMANENT);
00032 if (access(path, 0) != 0) {
00033 G_warning(_("<%s> file not found for location <%s>"),
00034 UNIT_FILE, G_location());
00035 return NULL;
00036 }
00037 in_units_keys = G_read_key_value_file(path, &stat);
00038 if (stat != 0) {
00039 G_warning(_("ERROR in reading <%s> file for location <%s>"),
00040 UNIT_FILE, G_location());
00041 return NULL;
00042 }
00043
00044 return in_units_keys;
00045 }
00046
00052 struct Key_Value *G_get_projinfo(void)
00053 {
00054 int stat;
00055 struct Key_Value *in_proj_keys;
00056 char path[GPATH_MAX];
00057
00058 G__file_name(path, "", PROJECTION_FILE, PERMANENT);
00059 if (access(path, 0) != 0) {
00060 G_warning(_("<%s> file not found for location <%s>"),
00061 PROJECTION_FILE, G_location());
00062 return NULL;
00063 }
00064 in_proj_keys = G_read_key_value_file(path, &stat);
00065 if (stat != 0) {
00066 G_warning(_("ERROR in reading <%s> file for location <%s>"),
00067 PROJECTION_FILE, G_location());
00068 return NULL;
00069 }
00070 return in_proj_keys;
00071 }