GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-55b2a2bccc
valuefmt.c File Reference

DBMI Library (base) - value formatting. More...

#include <stdio.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for valuefmt.c:

Go to the source code of this file.


int db_convert_Cstring_to_value (const char *Cstring, int sqltype, dbValue *value)
 Convert string to value. More...
int db_convert_value_to_string (dbValue *value, int sqltype, dbString *string)
 Convert value to string. More...

Detailed Description

DBMI Library (base) - value formatting.

(C) 1999-2009, 2011 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.

Joel Jones (CERL/UIUC), Radim Blazek
Doxygenized by Martin Landa <landa.martin> (2011)

Definition in file valuefmt.c.

Function Documentation

◆ db_convert_Cstring_to_value()

int db_convert_Cstring_to_value ( const char *  Cstring,
int  sqltype,
dbValue value 

Convert string to value.

Cstringstring buffer
sqltypeSQL data type
[out]valuepointer to dbValue
DB_OK on success
DB_FAILED on error

Definition at line 31 of file valuefmt.c.

Referenced by db_convert_Cstring_to_column_default_value(), and db_convert_Cstring_to_column_value().

◆ db_convert_value_to_string()

int db_convert_value_to_string ( dbValue value,
int  sqltype,
dbString string 

Convert value to string.

valuepointer to dbValue
sqltypeSQL data type
[out]stringpointer to dbString
DB_OK on success

Definition at line 68 of file valuefmt.c.

References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_value_datetime_into_string(), db_error(), DB_FAILED, db_get_value_double(), db_get_value_int(), db_get_value_string(), db_set_string(), db_sqltype_to_Ctype(), db_test_value_isnull(), and G_trim_decimal().

Referenced by db_convert_column_default_value_to_string(), and db_convert_column_value_to_string().