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

Key_Value management. More...

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

Go to the source code of this file.

Functions

struct Key_Value * G_create_key_value (void)
 Allocate and initialize Key_Value structure.
int G_set_key_value (const char *key, const char *value, struct Key_Value *kv)
 Set value for given key.
char * G_find_key_value (const char *key, const struct Key_Value *kv)
 Find given key.
int G_free_key_value (struct Key_Value *kv)
 Free allocated Key_Value structure.

Detailed Description

Key_Value management.

(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:
CERL

Definition in file key_value1.c.


Function Documentation

struct Key_Value* G_create_key_value ( void  ) [read]

Allocate and initialize Key_Value structure.

Returns:
poiter to allocated Key_Value structure

Definition at line 25 of file key_value1.c.

References NULL.

Referenced by G__write_fp_format(), and G_fread_key_value().

char* G_find_key_value ( const char *  key,
const struct Key_Value *  kv 
)

Find given key.

Parameters:
[in]keykey to be found
[in]kvKey_value structure
Returns:
poiter to value of key
NULL if no key found

Definition at line 128 of file key_value1.c.

References NULL.

Referenced by G__check_fp_type(), G_ask_proj_name(), G_compare_projections(), G_get_datumparams_from_projinfo(), G_get_gdal_link(), and G_lookup_key_value_from_file().

int G_free_key_value ( struct Key_Value *  kv)

Free allocated Key_Value structure.

Parameters:
[in]kvKey_Value structure
Returns:
0

Definition at line 145 of file key_value1.c.

References G_free().

Referenced by G__check_fp_type(), G__write_fp_format(), G_database_datum_name(), G_fread_key_value(), G_get_ellipsoid_parameters(), G_lookup_key_value_from_file(), and G_update_key_value_file().

int G_set_key_value ( const char *  key,
const char *  value,
struct Key_Value *  kv 
)

Set value for given key.

If key has spaces in it, this will break the logic so rule is: NO SPACES IN key.

Parameters:
[in]keykey to be set up
[in]valuevalue for given key
[in,out]kvKey_value structure to be modified
Returns:
0 no memory
1 ok, but key was NULL or "" so ignored
2 ok

Definition at line 55 of file key_value1.c.

References G_free(), and NULL.

Referenced by G__write_fp_format(), G_fread_key_value(), and G_update_key_value_file().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines