GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
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_Value * G_create_key_value (void)
 Allocate and initialize Key_Value structure.
 
void G_set_key_value (const char *key, const char *value, struct Key_Value *kv)
 Set value for given key.
 
const char * G_find_key_value (const char *key, const struct Key_Value *kv)
 Find given key (case sensitive)
 
void G_free_key_value (struct Key_Value *kv)
 Free allocated Key_Value structure.
 

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

◆ G_create_key_value()

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(), and 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)

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

Definition at line 85 of file key_value1.c.

References NULL.

Referenced by G_compare_projections(), G_get_datumparams_from_projinfo(), G_get_projinfo(), G_get_projsrid(), G_lookup_key_value_from_file(), GPJ__get_datum_params(), GPJ__get_ellipsoid_params(), GPJ_grass_to_osr(), GPJ_grass_to_osr2(), GPJ_osr_to_grass(), and pj_get_kv().

◆ G_free_key_value()

void G_free_key_value ( struct Key_Value * kv)

Free allocated Key_Value structure.

Parameters
[in]kvKey_Value structure to be freed

Definition at line 104 of file key_value1.c.

References G_free().

Referenced by G_get_ellipsoid_parameters(), G_get_projinfo(), G_get_projsrid(), G_lookup_key_value_from_file(), G_update_key_value_file(), GPJ_get_datum_params(), GPJ_get_ellipsoid_params(), and GPJ_osr_to_grass().

◆ G_set_key_value()

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 39 of file key_value1.c.

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

Referenced by G_fread_key_value(), G_get_projinfo(), G_update_key_value_file(), and GPJ_osr_to_grass().