GRASS 8 Programmer's Manual 8.6.0dev(2026)-0f6a7341fc
Loading...
Searching...
No Matches
key_value3.c File Reference

Key_Value management. More...

#include <errno.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for key_value3.c:

Go to the source code of this file.

Functions

void G_write_key_value_file (const char *file, const struct Key_Value *kv)
 Write key/value pairs to file.
 
struct Key_ValueG_read_key_value_file (const char *file)
 Read key/values pairs from file.
 

Detailed Description

Key_Value management.

SPDX-FileCopyrightText: 2001-2008, 2012 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later

Author
CERL

Definition in file key_value3.c.

Function Documentation

◆ G_read_key_value_file()

struct Key_Value * G_read_key_value_file ( const char file)

Read key/values pairs from file.

Allocated memory must be freed G_free_key_value(). Call G_fatal_error() when unable to read key/value items from the file.

Parameters
[in]filefilename for reading
Returns
pointer to allocated Key_Value structure
NULL on error

Definition at line 53 of file key_value3.c.

References _, file, G_fatal_error(), and G_fread_key_value().

Referenced by G_get_ellipsoid_parameters(), G_get_projepsg(), G_get_projinfo(), G_get_projunits(), G_lookup_key_value_from_file(), G_update_key_value_file(), Rast3d_read_header(), Rast3d_read_window(), and Rast__check_fp_type().

◆ G_write_key_value_file()

void G_write_key_value_file ( const char file,
const struct Key_Value kv 
)

Write key/value pairs to file.

Parameters
filefilename for writing
kvpointer Key_Value structure
Returns
0 success
1 error writing

Definition at line 26 of file key_value3.c.

References _, file, G_fatal_error(), and G_fwrite_key_value().

Referenced by G_make_location(), G_make_location_epsg(), G_update_key_value_file(), and Rast3d_write_header().