Functions

db_id.c File Reference

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

#include "db.h"
#include "db_id.h"
#include "../../dprint.h"
#include "../../mem/mem.h"
#include "../../pt.h"
#include "../../ut.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for db_id.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file db_id.c.


Function Documentation

unsigned char cmp_db_id ( const struct db_id id1,
const struct db_id id2 
)
Parameters:
id1 first identifier
id2 second identifier
Returns:
one if both are equal, zero otherwise

Definition at line 272 of file db_id.c.

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

Referenced by pool_get().

Here is the caller graph for this function:

static int dupl_string ( char **  dst,
const char *  begin,
const char *  end 
) [static]
Parameters:
dst destination
begin start of the string
end end of the string

Definition at line 46 of file db_id.c.

Referenced by parse_db_url().

Here is the caller graph for this function:

void free_db_id ( struct db_id id  ) 
Parameters:
id identifier

Definition at line 308 of file db_id.c.

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

Referenced by db_do_init2(), db_mysql_free_connection(), and db_postgres_free_connection().

Here is the caller graph for this function:

struct db_id* new_db_id ( const str url,
db_pooling_t  pooling 
) [read]
Parameters:
url database URL
pooling whether or not a pooled connection may be used
Returns:
connection identifier, or zero on error

Definition at line 232 of file db_id.c.

References _str::len, parse_db_url(), db_id::pid, db_id::poolid, and _str::s.

Referenced by db_do_init2().

Here is the call graph for this function:

Here is the caller graph for this function:

static int parse_db_url ( struct db_id id,
const str url 
) [static]
Parameters:
id filled id struct
url parsed URL
Returns:
0 if parsing was successful and -1 otherwise

Definition at line 69 of file db_id.c.

References db_id::database, dupl_string(), db_id::host, _str::len, db_id::password, _str::s, db_id::scheme, and db_id::username.

Referenced by new_db_id().

Here is the call graph for this function:

Here is the caller graph for this function: