[GRASS5] Re: G_index, G_strstr, G_trim_decimal

Michel Wurtz - ENGEES/CEREG mw at engees.u-strasbg.fr
Thu Jun 8 07:07:19 EDT 2000


Markus Neteler wrote:
> 
> On Wed, Jun 07, 2000 at 11:38:31PM +0200, Andreas Lange wrote:
> > Hi developers,
> >
> > i am desperately searching for information about the functions G_index,
> > G_strstr and G_trim_decimal. They are used in some of the sites modules,
> > but nowhere documented (not in the 5.0 or 4.2 programming manual).
[...]
> I found:
[...]
> src/libes/gis/index.c
> char *
> G_index (str, delim)
> 
> -> mhh, is it comparing str and delimiter?
> 
> char *
> G_rindex (str, delim)
> 
> -> what's this?
> 
> src/libes/gis/string.c
>  * string/chring movement functions
>  * G_strcpy (T, F)      copy F up to null, copy null
>  * G_strncpy (T, F, n)  copy F up to null or n, always copy null
>  * G_chrcpy (T, F, n)   copy F up to n,    copy null
>  *
>  * G_strmov (T, F)      copy F up to null
>  * G_chrmov (T, F, n)   copy F up to n
>  *
>  * G_strcat (T, F)      cat F up to null, copy null
>  * G_chrcat (T, F, n)   cat F up to n,    copy null
>  * the -cpy and -cat functions are for null-terminated destinations;
>  * the -mov functions are for non-null-terminated ('chring') destinations.

the -cpy and -cat functions seems very close from the standard unix (POSIX)
ones. G_index and G_rindex looks also very close from their BSD4.3 equivalent :

INDEX(3)            Linux Programmer's Manual            INDEX(3)
 
NAME
       index, rindex - locate character in string
 
SYNOPSIS
       #include <string.h>
 
       char *index(const char *s, int c);
 
       char *rindex(const char *s, int c);
 
DESCRIPTION
       The index() function returns a pointer to the first occurrence of the
charac-
       ter c in the string s.
 
       The rindex() function returns a pointer to the last occurrence of the
charac-
       ter c in the string s.

It seems that Grass developpers take the best from the two world (BSD+SVID) and
implemented the function in Grass in order to be system independant...

-- 
Michel Wurtz    ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45  Fax: +33 03.88.37.04.97

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list