GRASS Programmer's Manual  6.4.2(2012)
ascii_chk.c
Go to the documentation of this file.
00001 
00017 #include <grass/gis.h>
00018 
00019 
00020 #define TAB     011
00021 #define SPACE   040
00022 
00023 
00034 int G_ascii_check(char *string)
00035 {
00036     char *ptr1, *ptr2;
00037 
00038     ptr1 = string;
00039     ptr2 = string;
00040 
00041     while (*ptr1) {
00042         if ((*ptr1 >= 040) && (*ptr1 <= 0176))
00043             *ptr2++ = *ptr1;
00044         else if (*ptr1 == TAB)
00045             *ptr2++ = SPACE;
00046         ptr1++;
00047     }
00048     *ptr2 = 0;
00049 
00050     return 0;
00051 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines