GRASS Programmer's Manual 6.4.1(2011)
token.c File Reference

GIS Library - Token functions. More...

#include <stdlib.h>
#include <grass/gis.h>
Include dependency graph for token.c:

Go to the source code of this file.

Functions

char ** G_tokenize (const char *buf, const char *delim)
 Tokenize string.
int G_number_of_tokens (char **tokens)
 Return number of tokens.
int G_free_tokens (char **tokens)
 Free memory allocated to tokens.

Detailed Description

GIS Library - Token functions.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author:
GRASS GIS Development Team
Date:
1999-2008

Definition in file token.c.


Function Documentation

int G_free_tokens ( char **  tokens)

Free memory allocated to tokens.

Note: G_free_tokens() must be called when finished with tokens to release memory.

Parameters:
[in,out]tokens
Returns:
always returns 0

Definition at line 98 of file token.c.

References G_free(), and NULL.

Referenced by G_get_window(), and G_parser().

int G_number_of_tokens ( char **  tokens)

Return number of tokens.

Note: Function is incomplete.

Parameters:
[in]tokens
Returns:
number of tokens

Definition at line 76 of file token.c.

References NULL.

char** G_tokenize ( const char *  buf,
const char *  delim 
)

Tokenize string.

Given a string, buf, turn delimiter, delim, into '\0' (NULL) and place pointers to tokens in tokens. buf must not contain a new line (
).

Parameters:
[in]bufinput string
[in]delimstring delimiter
Returns:
Pointer to string token

Definition at line 33 of file token.c.

References G_index(), G_store(), and NULL.

Referenced by G_get_window(), and G_parser().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines