19 #include <grass/gis.h>
20 #include <grass/Vect.h>
21 #include <grass/glocale.h>
41 static const char *keywords[] = {
"and",
"or",
"not",
NULL };
45 sprintf(buf,
"%s", s);
47 if (*s ==
'.' || *s == 0) {
48 G_warning(_(
"Illegal vector map name <%s>. May not contain '.' or 'NULL'."),
54 if (!((*s >=
'A' && *s <=
'Z') || (*s >=
'a' && *s <=
'z'))) {
55 G_warning(_(
"Illegal vector map name <%s>. Must start with a letter."),
61 if (!((*s >=
'A' && *s <=
'Z') || (*s >=
'a' && *s <=
'z') ||
62 (*s >=
'0' && *s <=
'9') || *s ==
'_' || *s ==
'@')) {
63 G_warning(_(
"Illegal vector map name <%s>. Character '%c' not allowed."),
68 for (i = 0; keywords[i]; i++)
70 G_warning(_(
"Illegal vector map name <%s>. SQL keyword cannot be used as vector map name."),
100 if (error == GV_FATAL_EXIT) {
101 G_fatal_error(_(
"Output vector map name <%s> is not valid map name"),
104 else if (error == GV_FATAL_PRINT) {
105 G_warning(_(
"Output vector map name <%s> is not valid map name"),
116 if (mapset ==
NULL) {
117 if (error == GV_FATAL_EXIT) {
120 else if (error == GV_FATAL_PRINT) {
121 G_warning(_(
"Vector map <%s> not found"), input);
129 if (strcmp(mapset,
G_mapset()) == 0) {
131 char nm[GNAME_MAX], ms[GMAPSET_MAX];
140 if (strcmp(in, output) == 0) {
141 if (error == GV_FATAL_EXIT) {
145 else if (error == GV_FATAL_PRINT) {
146 G_warning(_(
"Output vector map <%s> is used as input"),