Back to index

php5  5.3.10
Classes | Functions | Variables
pdo_sqlstate.c File Reference
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_pdo.h"
#include "php_pdo_driver.h"

Go to the source code of this file.

Classes

struct  pdo_sqlstate_info

Functions

void pdo_sqlstate_fini_error_table (void)
int pdo_sqlstate_init_error_table (void)
const char * pdo_sqlstate_state_to_description (char *state)

Variables

static HashTable err_hash
static struct pdo_sqlstate_info []

Class Documentation

struct pdo_sqlstate_info

Definition at line 31 of file pdo_sqlstate.c.

Class Members
const char * desc
const char state

Function Documentation

Definition at line 307 of file pdo_sqlstate.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 312 of file pdo_sqlstate.c.

{
       int i;
       const struct pdo_sqlstate_info *info;

       if (FAILURE == zend_hash_init(&err_hash,
                     sizeof(err_initializer)/sizeof(err_initializer[0]), NULL, NULL, 1)) {
              return FAILURE;
       }

       for (i = 0; i < sizeof(err_initializer)/sizeof(err_initializer[0]); i++) {
              info = &err_initializer[i];

              zend_hash_add(&err_hash, info->state, sizeof(info->state), &info, sizeof(info), NULL);
       }

       return SUCCESS;
}

Here is the caller graph for this function:

const char* pdo_sqlstate_state_to_description ( char *  state)

Definition at line 331 of file pdo_sqlstate.c.

{
       const struct pdo_sqlstate_info **info;
       if (SUCCESS == zend_hash_find(&err_hash, state, sizeof(err_initializer[0].state),
                     (void**)&info)) {
              return (*info)->desc;
       }
       return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

HashTable err_hash [static]

Definition at line 36 of file pdo_sqlstate.c.

struct pdo_sqlstate_info[] [static]

Definition at line 38 of file pdo_sqlstate.c.