db_id.h File Reference

Functions for parsing a database URL and works with db identifier. More...

#include "../str.h"

Include dependency graph for db_id.h:

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

Go to the source code of this file.

Data Structures

struct  db_id

Functions

unsigned char cmp_db_id (const struct db_id *id1, const struct db_id *id2)
void free_db_id (struct db_id *id)
struct db_idnew_db_id (const str *url)


Detailed Description

Functions for parsing a database URL and works with db identifier.

Definition in file db_id.h.


Function Documentation

unsigned char cmp_db_id ( const struct db_id id1,
const struct db_id id2 
)

Compare two connection identifiers

Parameters:
id1 first identifier
id2 second identifier
Returns:
1 if both identifier are equal, 0 if there not equal
Compare two connection identifiers
Parameters:
id1 first identifier
id2 second identifier
Returns:
one if both are equal, zero otherwise

Definition at line 259 of file db_id.c.

References db_id::database, db_id::host, db_id::password, db_id::port, db_id::scheme, and db_id::username.

Referenced by pool_get().

void free_db_id ( struct db_id id  ) 

Free a connection identifier

Parameters:
id the identifier that should released
Free a connection identifier
Parameters:
id identifier

Definition at line 285 of file db_id.c.

References db_id::database, db_id::host, db_id::password, pkg_free, db_id::scheme, and db_id::username.

Referenced by db_do_init(), db_mysql_free_connection(), db_oracle_free_connection(), and db_postgres_free_connection().

struct db_id* new_db_id ( const str url  )  [read]

Create a new connection identifier

Parameters:
url database URL
Returns:
new allocated db_id structure, NULL on failure
Create a new connection identifier
Parameters:
url database URL
Returns:
connection identifier, or zero on error

Definition at line 224 of file db_id.c.

References _str::len, LM_ERR, parse_db_url(), pkg_free, pkg_malloc, and _str::s.

Referenced by db_do_init().


Generated on Mon May 21 18:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6