GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
key_value3.c File Reference

Key_Value management. More...

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

Go to the source code of this file.

Functions

int G_write_key_value_file (const char *file, const struct Key_Value *kv, int *stat)
 Write key/value pairs to file. More...
 
struct Key_Value * G_read_key_value_file (const char *file, int *stat)
 Read key/values pairs from file. More...
 

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_value3.c.

Function Documentation

struct Key_Value* G_read_key_value_file ( const char *  file,
int stat 
)

Read key/values pairs from file.

Allocated memory must be freed G_free_key_value().

Parameters
[in]filefilename for reading
[out]statstatus (0 ok, -1 cannot open file, -2 error writing key/value)
Returns
poiter to allocated Key_Value structure
NULL on error

Definition at line 54 of file key_value3.c.

References fclose(), fd, G_fread_key_value(), and NULL.

Referenced by G3d_readHeader(), G3d_readWindow(), G__check_fp_type(), G_ask_proj_name(), G_get_ellipsoid_parameters(), G_get_projinfo(), G_get_projunits(), G_lookup_key_value_from_file(), and G_update_key_value_file().

int G_write_key_value_file ( const char *  file,
const struct Key_Value *  kv,
int stat 
)

Write key/value pairs to file.

Parameters
[in]filefilename for writing
[in]kvKey_Value structure
[out]statstatus (0 ok, -3 cannot open file, -4 error writing key/value)
Returns
0 success
1 error writing

Definition at line 29 of file key_value3.c.

References fclose(), fd, G_fwrite_key_value(), and NULL.

Referenced by G3d_writeHeader(), G__make_location(), G__write_fp_format(), and G_update_key_value_file().