pg_con.h File Reference

DB_POSTGRES :: Core

Module: DB_MYSQL :: the MySQL driver for Kamailio. More...

#include "../../db/db_pool.h"
#include "../../db/db_id.h"
#include <time.h>
#include <libpq-fe.h>

Include dependency graph for pg_con.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pg_con

Defines

#define CON_CONNECTED(db_con)   (((struct pg_con*)((db_con)->tail))->connected)
#define CON_CONNECTION(db_con)   (((struct pg_con*)((db_con)->tail))->con)
#define CON_ID(db_con)   (((struct pg_con*)((db_con)->tail))->id)
#define CON_RESULT(db_con)   (((struct pg_con*)((db_con)->tail))->res)
#define CON_ROW(db_con)   (((struct pg_con*)((db_con)->tail))->row)
#define CON_SQLURL(db_con)   (((struct pg_con*)((db_con)->tail))->sqlurl)
#define CON_TIMESTAMP(db_con)   (((struct pg_con*)((db_con)->tail))->timestamp)

Functions

void db_postgres_free_connection (struct pool_con *con)
 Close the connection and release memory.
struct pg_condb_postgres_new_connection (struct db_id *id)
 Create a new connection.


Detailed Description

DB_POSTGRES :: Core

Module: DB_MYSQL :: the MySQL driver for Kamailio.

Definition in file pg_con.h.


Define Documentation

#define CON_CONNECTED ( db_con   )     (((struct pg_con*)((db_con)->tail))->connected)

Definition at line 62 of file pg_con.h.

#define CON_CONNECTION ( db_con   )     (((struct pg_con*)((db_con)->tail))->con)

Definition at line 61 of file pg_con.h.

#define CON_ID ( db_con   )     (((struct pg_con*)((db_con)->tail))->id)

Definition at line 65 of file pg_con.h.

Referenced by reconnect().

#define CON_RESULT ( db_con   )     (((struct pg_con*)((db_con)->tail))->res)

Definition at line 60 of file pg_con.h.

#define CON_ROW ( db_con   )     (((struct pg_con*)((db_con)->tail))->row)

Definition at line 63 of file pg_con.h.

#define CON_SQLURL ( db_con   )     (((struct pg_con*)((db_con)->tail))->sqlurl)

Definition at line 59 of file pg_con.h.

#define CON_TIMESTAMP ( db_con   )     (((struct pg_con*)((db_con)->tail))->timestamp)

Definition at line 64 of file pg_con.h.


Function Documentation

void db_postgres_free_connection ( struct pool_con con  ) 

Close the connection and release memory.

Parameters:
con connection

Definition at line 108 of file pg_con.c.

References pg_con::con, free_db_id(), pg_con::id, LM_DBG, pkg_free, and pg_con::res.

Referenced by db_postgres_close().

struct pg_con* db_postgres_new_connection ( struct db_id id  )  [read]

Create a new connection.

Create a new connection structure in private memory, open the PostgreSQL connection and set reference count to 1

Parameters:
id database id
Returns:
postgres connection structure, 0 on error

Definition at line 46 of file pg_con.c.

References pg_con::con, pg_con::connected, db_id::database, db_id::host, pg_con::id, int2str(), LM_DBG, LM_ERR, NULL, db_id::password, pkg_free, pkg_malloc, db_id::port, pg_con::ref, pg_con::timestamp, db_id::username, and ZSW.

Referenced by db_postgres_init().


Generated on Thu May 24 02:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6