[GRASS5] Re: G_index, G_strstr, G_trim_decimal

Markus Neteler neteler at geog.uni-hannover.de
Thu Jun 8 06:49:37 EDT 2000


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 think the documentation should be added to the manual. 
> 
> Or are there any reasons why they should not be used?
Hi Andreas,

thanks for notifying about functions not yet described in PM.

I found:
src/libes/gis/trim_dec.c

int G_trim_decimal (char *buf)
/* this routine remove trailing zeros from decimal number
 * for example: 23.45000 would come back as 23.45
 */


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.
 * all functions return 'T'.

 * G_strcasecmp(a, b) char *a, *b;
 *   string compare ignoring case (upper or lower)
 *   returns: -1 a<b; 0 a==b; 1 a>

 * G_strstr(mainString, subString)
 *      Return a pointer to the first occurrence of subString
 *      in mainString, or NULL if no occurrences are found.

 * G_strdup(string)
 *      Return a pointer to a string that is a duplicate of the string
 *      given to G_strdup.  The duplicate is created using malloc.
 *      If unable to allocate the required space, NULL is returned.

src/libes/gis/chop.c
 * G_chop - chop leading and trailing white spaces: 
 *          space, \f, \n, \r, \t, \v
 *        - returns pointer to string
 *    
 * char *G_chop (char *s)
 *
 * modified copy of G_squeeze();    RB March 2000
 *                          <Radim.Blazek at dhv.cz>

----------------
Shall I include a "utility" section within the programmer's manual?
Where to place these information?

Suggestions are welcome.

Markus

---------------------------------------- 
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