22 #include <sys/types.h>
23 #include <grass/gis.h>
29 static char *G_strend(
const char *S)
50 while ((*d++ = *F++)) ;
203 if (xx >=
'A' && xx <=
'Z')
205 if (yy >=
'A' && yy <=
'Z')
230 char *
G_strstr(
const char *mainString,
const char *subString)
238 length = strlen(subString);
241 while (*q !=
'\0' && *q != *p) {
244 }
while (*q !=
'\0' && strncmp(p, q, length) != 0 && q++);
269 p = G_malloc(strlen(
string) + 1);
287 char *
G_strchg(
char *bug,
char character,
char new)
292 if (*help == character)
325 if (old_str ==
NULL || new_str ==
NULL)
332 B = strstr(buffer, old_str);
337 if (strlen(new_str) > strlen(old_str)) {
340 len = strlen(old_str);
342 while (B !=
NULL && *B !=
'\0') {
350 len = count * (strlen(new_str) - strlen(old_str))
355 len = strlen(buffer);
358 replace = G_malloc(len + 1);
365 len = strlen(old_str);
367 if (*B == old_str[0] && strncmp(B, old_str, len) == 0) {
391 register char *a, *
b;
394 for (a = b = buf; *a ==
' ' || *a ==
'\t'; a++) ;
396 while ((*b++ = *a++)) ;
398 for (a = buf; *a; a++) ;
400 for (a--; *a ==
' ' || *a ==
'\t'; a--) ;
420 register char *f = line, *t = line;
430 for (t = line; *t; t++)
432 while (isspace(*--t)) ;
456 str[i] = toupper(str[i]);
474 str[i] = tolower(str[i]);
500 if (!(*c >=
'A' && *c <=
'Z') && !(*c >=
'a' && *c <=
'z') &&
501 !(*c >=
'0' && *c <=
'9')) {
509 if (!(*c >=
'A' && *c <=
'Z') && !(*c >=
'a' && *c <=
'z')) {