Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
php_pdo_dblib_int.h File Reference
#include <sybfront.h>
#include <sybdb.h>
#include <syberror.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pdo_dblib_err
struct  pdo_dblib_db_handle
struct  pdo_dblib_col
struct  pdo_dblib_colval
struct  pdo_dblib_stmt

Defines

#define PDO_DBLIB_FLAVOUR   "Generic DB-lib"
#define SQLTEXT   SYBTEXT
#define SQLCHAR   SYBCHAR
#define SQLVARCHAR   SYBVARCHAR
#define SQLINT1   SYBINT1
#define SQLINT2   SYBINT2
#define SQLINT4   SYBINT4
#define SQLINTN   SYBINTN
#define SQLBIT   SYBBIT
#define SQLFLT4   SYBREAL
#define SQLFLT8   SYBFLT8
#define SQLFLTN   SYBFLTN
#define SQLDECIMAL   SYBDECIMAL
#define SQLNUMERIC   SYBNUMERIC
#define SQLDATETIME   SYBDATETIME
#define SQLDATETIM4   SYBDATETIME4
#define SQLDATETIMN   SYBDATETIMN
#define SQLMONEY   SYBMONEY
#define SQLMONEY4   SYBMONEY4
#define SQLMONEYN   SYBMONEYN
#define SQLIMAGE   SYBIMAGE
#define SQLBINARY   SYBBINARY
#define SQLVARBINARY   SYBVARBINARY
#define DBERRHANDLE(a, b)   dberrhandle(b)
#define DBMSGHANDLE(a, b)   dbmsghandle(b)
#define DBSETOPT(a, b, c)   dbsetopt(a, b, c, -1)
#define NO_MORE_RPC_RESULTS   3
#define dbfreelogin   dbloginfree
#define dbrpcexec   dbrpcsend
#define DBLIB_G(v)   (dblib_globals.v)

Typedefs

typedef short TDS_SHORT
typedef unsigned char * LPBYTE
typedef float DBFLT4

Functions

int error_handler (DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
int msg_handler (DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line)
 ZEND_EXTERN_MODULE_GLOBALS (dblib)

Variables

pdo_driver_t pdo_dblib_driver
pdo_dblib_err err
char sqlstate [6]

Class Documentation

struct pdo_dblib_err

Definition at line 99 of file php_pdo_dblib_int.h.

Class Members
int dberr
char * dberrstr
char * lastmsg
int oserr
char * oserrstr
int severity
char * sqlstate
struct pdo_dblib_db_handle

Definition at line 109 of file php_pdo_dblib_int.h.

Collaboration diagram for pdo_dblib_db_handle:
Class Members
pdo_dblib_err err
DBPROCESS * link
LOGINREC * login
struct pdo_dblib_col

Definition at line 116 of file php_pdo_dblib_int.h.

Class Members
int coltype
int maxlen
char * name
char * source
struct pdo_dblib_colval

Definition at line 123 of file php_pdo_dblib_int.h.

Class Members
char * data
unsigned long len
struct pdo_dblib_stmt

Definition at line 128 of file php_pdo_dblib_int.h.

Collaboration diagram for pdo_dblib_stmt:
Class Members
pdo_dblib_col * cols
int current
pdo_dblib_err err
pdo_dblib_db_handle * H
int ncols
int nrows
pdo_dblib_colval * rows

Define Documentation

#define DBERRHANDLE (   a,
 
)    dberrhandle(b)

Definition at line 76 of file php_pdo_dblib_int.h.

#define dbfreelogin   dbloginfree

Definition at line 80 of file php_pdo_dblib_int.h.

#define DBLIB_G (   v)    (dblib_globals.v)

Definition at line 150 of file php_pdo_dblib_int.h.

#define DBMSGHANDLE (   a,
 
)    dbmsghandle(b)

Definition at line 77 of file php_pdo_dblib_int.h.

#define dbrpcexec   dbrpcsend

Definition at line 81 of file php_pdo_dblib_int.h.

#define DBSETOPT (   a,
  b,
 
)    dbsetopt(a, b, c, -1)

Definition at line 78 of file php_pdo_dblib_int.h.

#define NO_MORE_RPC_RESULTS   3

Definition at line 79 of file php_pdo_dblib_int.h.

#define PDO_DBLIB_FLAVOUR   "Generic DB-lib"

Definition at line 26 of file php_pdo_dblib_int.h.

#define SQLBINARY   SYBBINARY

Definition at line 70 of file php_pdo_dblib_int.h.

#define SQLBIT   SYBBIT

Definition at line 57 of file php_pdo_dblib_int.h.

#define SQLCHAR   SYBCHAR

Definition at line 51 of file php_pdo_dblib_int.h.

#define SQLDATETIM4   SYBDATETIME4

Definition at line 64 of file php_pdo_dblib_int.h.

#define SQLDATETIME   SYBDATETIME

Definition at line 63 of file php_pdo_dblib_int.h.

#define SQLDATETIMN   SYBDATETIMN

Definition at line 65 of file php_pdo_dblib_int.h.

#define SQLDECIMAL   SYBDECIMAL

Definition at line 61 of file php_pdo_dblib_int.h.

#define SQLFLT4   SYBREAL

Definition at line 58 of file php_pdo_dblib_int.h.

#define SQLFLT8   SYBFLT8

Definition at line 59 of file php_pdo_dblib_int.h.

#define SQLFLTN   SYBFLTN

Definition at line 60 of file php_pdo_dblib_int.h.

#define SQLIMAGE   SYBIMAGE

Definition at line 69 of file php_pdo_dblib_int.h.

#define SQLINT1   SYBINT1

Definition at line 53 of file php_pdo_dblib_int.h.

#define SQLINT2   SYBINT2

Definition at line 54 of file php_pdo_dblib_int.h.

#define SQLINT4   SYBINT4

Definition at line 55 of file php_pdo_dblib_int.h.

#define SQLINTN   SYBINTN

Definition at line 56 of file php_pdo_dblib_int.h.

#define SQLMONEY   SYBMONEY

Definition at line 66 of file php_pdo_dblib_int.h.

#define SQLMONEY4   SYBMONEY4

Definition at line 67 of file php_pdo_dblib_int.h.

#define SQLMONEYN   SYBMONEYN

Definition at line 68 of file php_pdo_dblib_int.h.

#define SQLNUMERIC   SYBNUMERIC

Definition at line 62 of file php_pdo_dblib_int.h.

#define SQLTEXT   SYBTEXT

Definition at line 50 of file php_pdo_dblib_int.h.

#define SQLVARBINARY   SYBVARBINARY

Definition at line 71 of file php_pdo_dblib_int.h.

#define SQLVARCHAR   SYBVARCHAR

Definition at line 52 of file php_pdo_dblib_int.h.


Typedef Documentation

typedef float DBFLT4

Definition at line 87 of file php_pdo_dblib_int.h.

typedef unsigned char* LPBYTE

Definition at line 85 of file php_pdo_dblib_int.h.

typedef short TDS_SHORT

Definition at line 83 of file php_pdo_dblib_int.h.


Function Documentation

int error_handler ( DBPROCESS *  dbproc,
int  severity,
int  dberr,
int  oserr,
char *  dberrstr,
char *  oserrstr 
)

Definition at line 89 of file pdo_dblib.c.

{
       pdo_dblib_err *einfo;
       char *state = "HY000";
       TSRMLS_FETCH();

       einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
       if (!einfo) einfo = &DBLIB_G(err);

       einfo->severity = severity;
       einfo->oserr = oserr;
       einfo->dberr = dberr;
       if (einfo->oserrstr) {
              efree(einfo->oserrstr);
       }
       if (einfo->dberrstr) {
              efree(einfo->dberrstr);
       }
       if (oserrstr) {
              einfo->oserrstr = estrdup(oserrstr);
       } else {
              einfo->oserrstr = NULL;
       }
       if (dberrstr) {
              einfo->dberrstr = estrdup(dberrstr);
       } else {
              einfo->dberrstr = NULL;
       }

       switch (dberr) {
              case SYBESEOF:
              case SYBEFCON:       state = "01002"; break;
              case SYBEMEM: state = "HY001"; break;
              case SYBEPWD: state = "28000"; break;
       }
       strcpy(einfo->sqlstate, state);

#if 0
       php_error_docref(NULL TSRMLS_CC, E_WARNING,
              "dblib error: %d %s (severity %d)",
              dberr, dberrstr, severity); 
#endif

       return INT_CANCEL;
}

Here is the caller graph for this function:

int msg_handler ( DBPROCESS *  dbproc,
DBINT  msgno,
int  msgstate,
int  severity,
char *  msgtext,
char *  srvname,
char *  procname,
DBUSMALLINT  line 
)

Definition at line 136 of file pdo_dblib.c.

{
       pdo_dblib_err *einfo;
       TSRMLS_FETCH();

       if (severity) {
              einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
              if (!einfo) {
                     einfo = &DBLIB_G(err);
              }

              if (einfo->lastmsg) {
                     efree(einfo->lastmsg);
              }

              einfo->lastmsg = estrdup(msgtext);
       }

#if 0
       php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity);
#endif

       return 0;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 143 of file php_pdo_dblib_int.h.

Definition at line 268 of file dblib_driver.c.

char sqlstate[6]

Definition at line 144 of file php_pdo_dblib_int.h.