db_postgres/val.c File Reference

DB_POSTGRES :: Core

Module: DB_POSTGRES :: the PostgreSQL driver for Kamailio. More...

#include "../../db/db_val.h"
#include "../../db/db_ut.h"
#include "../../dprint.h"
#include "pg_con.h"
#include "../../mem/mem.h"
#include "val.h"

Include dependency graph for db_postgres/val.c:

Go to the source code of this file.

Functions

int db_postgres_str2val (const db_type_t _t, db_val_t *_v, const char *_s, const int _l)
 Convert a str to a db value, copy strings.
int db_postgres_val2str (const db_con_t *_con, const db_val_t *_v, char *_s, int *_len)
 Converting a value to a string.


Detailed Description

DB_POSTGRES :: Core

Module: DB_POSTGRES :: the PostgreSQL driver for Kamailio.

Definition in file db_postgres/val.c.


Function Documentation

int db_postgres_str2val ( const db_type_t  _t,
db_val_t _v,
const char *  _s,
const int  _l 
)

Convert a str to a db value, copy strings.

Convert a str to a db value, copy strings. The postgresql module uses a custom escape function for BLOBs. If the _s is linked in the db_val result, it will be returned zero

Parameters:
_t destination value type
_v destination value
_s source string
_l string length
Returns:
0 on success, negative on error

Definition at line 58 of file db_postgres/val.c.

References DB_BLOB, db_str2val(), len, LM_DBG, LM_ERR, NULL, pkg_malloc, s, VAL_BLOB, VAL_FREE, and VAL_TYPE.

Referenced by db_postgres_convert_row().

int db_postgres_val2str ( const db_con_t _con,
const db_val_t _v,
char *  _s,
int *  _len 
)

Converting a value to a string.

Converting a value to a string, used when converting result from a query

Parameters:
_con database connection
_v source value
_s target string
_len target string length
Returns:
0 on success, negative on error

Definition at line 105 of file db_postgres/val.c.

References CON_CONNECTION, DB_BLOB, DB_STR, DB_STRING, db_val2str(), LM_DBG, LM_ERR, NULL, VAL_BLOB, VAL_STR, VAL_STRING, and VAL_TYPE.

Referenced by db_postgres_delete(), db_postgres_insert(), db_postgres_query(), and db_postgres_update().


Generated on Tue May 22 14:00:44 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6