GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71746
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
key_value1.c File Reference

Subroutines for 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_ValueG_create_key_value (void)
 Allocate and initialize Key_Value structure. More...
 
void G_set_key_value (const char *key, const char *value, struct Key_Value *kv)
 Set value for given key. More...
 
const char * G_find_key_value (const char *key, const struct Key_Value *kv)
 Find given key (case sensitive) More...
 
void G_free_key_value (struct Key_Value *kv)
 Free allocated Key_Value structure. More...
 

Detailed Description

Subroutines for Key/Value management.

(C) 2001-2008, 2012 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  )

Allocate and initialize Key_Value structure.

Returns
pointer to allocated Key_Value structure

Definition at line 23 of file key_value1.c.

References G_zero().

Referenced by G_fread_key_value(), GPJ_get_ellipsoid_params(), GPJ_osr_to_grass(), Rast3d_write_header(), and Rast_create_gdal_link().

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

Set value for given key.

Parameters
keykey to be set up
valuevalue for given key
[in,out]kvKey_value structure to be modified

Definition at line 38 of file key_value1.c.

References G_free(), G_store(), Key_Value::key, Key_Value::nalloc, Key_Value::nitems, NULL, and Key_Value::value.

Referenced by G_fread_key_value(), G_update_key_value_file(), GPJ_osr_to_grass(), Rast3d_key_set_double(), Rast3d_key_set_int(), Rast3d_key_set_string(), Rast3d_key_set_value(), and Rast_create_gdal_link().