Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <string.h>
00030 #include <grass/gis.h>
00031 #include <grass/glocale.h>
00032 char *G_mask_info(void)
00033 {
00034 static char text[200];
00035 char name[GNAME_MAX];
00036 char mapset[GMAPSET_MAX];
00037
00038 switch (G__mask_info(name, mapset)) {
00039 case 1:
00040 sprintf(text, _("<%s> in mapset <%s>"), name, mapset);
00041 break;
00042 case -1:
00043 strcpy(text, _("none"));
00044 break;
00045 default:
00046 strcpy(text, _("not known"));
00047 break;
00048 }
00049
00050 return text;
00051 }
00052
00053 int G__mask_info(char *name, char *mapset)
00054 {
00055 char rname[GNAME_MAX], rmapset[GMAPSET_MAX];
00056
00057 strcpy(name, "MASK");
00058 strcpy(mapset, G_mapset());
00059
00060 if (!G_find_cell(name, mapset))
00061 return -1;
00062
00063 if (G_is_reclass(name, mapset, rname, rmapset) > 0) {
00064 strcpy(name, rname);
00065 strcpy(mapset, rmapset);
00066 }
00067
00068 return 1;
00069 }