GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-5c00b4e944
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.


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.


Definition in file key_value1.c.

Function Documentation

◆ G_create_key_value()

struct Key_Value* G_create_key_value ( void  )

Allocate and initialize Key_Value structure.

pointer to allocated Key_Value structure

Definition at line 23 of file key_value1.c.

References G_malloc, and G_zero().

Referenced by GPJ_osr_to_grass().

◆ G_find_key_value()

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

Find given key (case sensitive)

keykey to be found
kvpointer to Key_value structure
pointer to value of key
NULL if no key found

Definition at line 84 of file key_value1.c.

Referenced by G_compare_projections(), G_get_datumparams_from_projinfo(), G_get_projinfo(), GPJ__get_datum_params(), GPJ_osr_to_grass(), Rast__check_fp_type(), and Vect_close().

◆ G_free_key_value()

void G_free_key_value ( struct Key_Value kv)

Free allocated Key_Value structure.

[in]kvKey_Value structure to be freed

Definition at line 103 of file key_value1.c.

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

Referenced by G_get_projinfo(), GPJ_get_datum_params(), and Rast__check_fp_type().

◆ G_set_key_value()

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

Set value for given key.

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.

Referenced by G_get_projinfo(), and GPJ_osr_to_grass().