dbi-dev.h | dbi-dev.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A | |||
* | * | |||
* $Id: dbi-dev.h,v 1.39 2005/08/14 21:02:05 mhoenicka Exp $ | * $Id: dbi-dev.h,v 1.41 2006/06/02 17:18:38 qu1j0t3 Exp $ | |||
*/ | */ | |||
#ifndef __DBI_DEV_H__ | #ifndef __DBI_DEV_H__ | |||
#define __DBI_DEV_H__ | #define __DBI_DEV_H__ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#include <dbi/dbi.h> /* for dbi_conn_error_handler_func */ | #include <dbi/dbi.h> /* for dbi_conn_error_handler_func */ | |||
skipping to change at line 170 | skipping to change at line 170 | |||
int error_number; /*XXX*/ | int error_number; /*XXX*/ | |||
char *error_message; /*XXX*/ | char *error_message; /*XXX*/ | |||
dbi_conn_error_handler_func error_handler; | dbi_conn_error_handler_func error_handler; | |||
void *error_handler_argument; | void *error_handler_argument; | |||
dbi_result_t **results; /* for garbage-collector-mandated result dis joins */ | dbi_result_t **results; /* for garbage-collector-mandated result dis joins */ | |||
int results_used; | int results_used; | |||
int results_size; | int results_size; | |||
struct dbi_conn_s *next; /* so libdbi can unload all conns at exit * / | struct dbi_conn_s *next; /* so libdbi can unload all conns at exit * / | |||
} dbi_conn_t; | } dbi_conn_t; | |||
extern int dbi_verbosity; | ||||
unsigned int _isolate_attrib(unsigned int attribs, unsigned int rangemin, u nsigned int rangemax); | unsigned int _isolate_attrib(unsigned int attribs, unsigned int rangemin, u nsigned int rangemax); | |||
void _error_handler(dbi_conn_t *conn, dbi_error_flag errflag); | void _error_handler(dbi_conn_t *conn, dbi_error_flag errflag); | |||
void _verbose_handler(dbi_conn_t *conn, const char* fmt, ...); | ||||
void _logquery(dbi_conn_t *conn, const char* fmt, ...); | ||||
void _logquery_null(dbi_conn_t *conn, const char* statement, size_t st_leng | ||||
th); | ||||
int _disjoin_from_conn(dbi_result_t *result); | int _disjoin_from_conn(dbi_result_t *result); | |||
void _set_field_flag(dbi_row_t *row, unsigned int fieldidx, unsigned char f lag, unsigned char value); | void _set_field_flag(dbi_row_t *row, unsigned int fieldidx, unsigned char f lag, unsigned char value); | |||
int _get_field_flag(dbi_row_t *row, unsigned int fieldidx, unsigned char fl ag); | int _get_field_flag(dbi_row_t *row, unsigned int fieldidx, unsigned char fl ag); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif /* __cplusplus */ | #endif /* __cplusplus */ | |||
#endif /* __DBI_DEV_H__ */ | #endif /* __DBI_DEV_H__ */ | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 7 lines changed or added | |||
dbi.h | dbi.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* | * | |||
* This library is distributed in the hope that it will be useful, | * This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the Free Software | * License along with this library; if not, write to the Free Software | |||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A | |||
* | * | |||
* $Id: dbi.h,v 1.60 2005/08/14 21:02:05 mhoenicka Exp $ | * $Id: dbi.h.in,v 1.1 2006/10/18 20:17:24 mhoenicka Exp $ | |||
*/ | */ | |||
#ifndef __DBI_H__ | #ifndef __DBI_H__ | |||
#define __DBI_H__ | #define __DBI_H__ | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
#include <time.h> | #include <time.h> | |||
#include <limits.h> /* for the *_MAX definitions */ | #include <limits.h> /* for the *_MAX definitions */ | |||
/* opaque type definitions */ | /* opaque type definitions */ | |||
typedef void * dbi_driver; | typedef void * dbi_driver; | |||
typedef void * dbi_conn; | typedef void * dbi_conn; | |||
typedef void * dbi_result; | typedef void * dbi_result; | |||
/* other type definitions */ | /* other type definitions */ | |||
typedef enum { DBI_ERROR_USER = -1, DBI_ERROR_NONE = 0, DBI_ERROR_DBD, DBI_ | typedef enum { | |||
ERROR_BADOBJECT, DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, DBI_ERROR_BADNAME, DB | DBI_ERROR_USER = -1, DBI_ERROR_NONE = 0, DBI_ERROR_DBD, DBI_ERROR_BADOBJE | |||
I_ERROR_UNSUPPORTED, DBI_ERROR_NOCONN, DBI_ERROR_NOMEM, DBI_ERROR_BADPTR } | CT, | |||
dbi_error_flag; | DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, DBI_ERROR_BADNAME, DBI_ERROR_UNSUPPO | |||
RTED, | ||||
DBI_ERROR_NOCONN, DBI_ERROR_NOMEM, DBI_ERROR_BADPTR | ||||
} dbi_error_flag; | ||||
/* some _MAX definitions. The size_t hack may not be portable */ | /* some _MAX definitions. The size_t hack may not be portable */ | |||
#ifndef SIZE_T_MAX | #ifndef SIZE_T_MAX | |||
# define SIZE_T_MAX UINT_MAX | # define SIZE_T_MAX UINT_MAX | |||
#endif | #endif | |||
#ifndef ULLONG_MAX | #ifndef ULLONG_MAX | |||
# define ULLONG_MAX ULONG_LONG_MAX | # define ULLONG_MAX ULONG_LONG_MAX | |||
#endif | #endif | |||
typedef struct { | typedef struct { | |||
skipping to change at line 77 | skipping to change at line 81 | |||
} dbi_time; | } dbi_time; | |||
typedef struct { | typedef struct { | |||
dbi_date date; | dbi_date date; | |||
dbi_time time; | dbi_time time; | |||
} dbi_datetime; | } dbi_datetime; | |||
/* function callback definitions */ | /* function callback definitions */ | |||
typedef void (*dbi_conn_error_handler_func)(dbi_conn, void *); | typedef void (*dbi_conn_error_handler_func)(dbi_conn, void *); | |||
/* definitions of the library interface versions */ | ||||
#define LIBDBI_LIB_CURRENT 0 | ||||
#define LIBDBI_LIB_REVISION 5 | ||||
#define LIBDBI_LIB_AGE 0 | ||||
/* values for the int in field_types[] */ | /* values for the int in field_types[] */ | |||
#define DBI_TYPE_INTEGER 1 | #define DBI_TYPE_INTEGER 1 | |||
#define DBI_TYPE_DECIMAL 2 | #define DBI_TYPE_DECIMAL 2 | |||
#define DBI_TYPE_STRING 3 | #define DBI_TYPE_STRING 3 | |||
#define DBI_TYPE_BINARY 4 | #define DBI_TYPE_BINARY 4 | |||
#define DBI_TYPE_DATETIME 5 | #define DBI_TYPE_DATETIME 5 | |||
/* values for the bitmask in field_type_attributes[] */ | /* values for the bitmask in field_type_attributes[] */ | |||
#define DBI_INTEGER_UNSIGNED (1 << 0) | #define DBI_INTEGER_UNSIGNED (1 << 0) | |||
#define DBI_INTEGER_SIZE1 (1 << 1) | #define DBI_INTEGER_SIZE1 (1 << 1) | |||
#define DBI_INTEGER_SIZE2 (1 << 2) | #define DBI_INTEGER_SIZE2 (1 << 2) | |||
#define DBI_INTEGER_SIZE3 (1 << 3) | #define DBI_INTEGER_SIZE3 (1 << 3) | |||
#define DBI_INTEGER_SIZE4 (1 << 4) | #define DBI_INTEGER_SIZE4 (1 << 4) | |||
#define DBI_INTEGER_SIZE8 (1 << 5) | #define DBI_INTEGER_SIZE8 (1 << 5) | |||
#define DBI_INTEGER_SIZEMASK (DBI_INTEGER_SIZE1|DBI_INTEGER_SIZE2 \ | ||||
|DBI_INTEGER | ||||
_SIZE3|DBI_INTEGER_SIZE4 \ | ||||
|DBI_INTEGER | ||||
_SIZE8) // isolate the size flags | ||||
#define DBI_DECIMAL_UNSIGNED (1 << 0) | #define DBI_DECIMAL_UNSIGNED (1 << 0) | |||
#define DBI_DECIMAL_SIZE4 (1 << 1) | #define DBI_DECIMAL_SIZE4 (1 << 1) | |||
#define DBI_DECIMAL_SIZE8 (1 << 2) | #define DBI_DECIMAL_SIZE8 (1 << 2) | |||
#define DBI_DECIMAL_SIZEMASK (DBI_DECIMAL_SIZE4|DBI_DECIMAL_SIZE8) | ||||
#define DBI_STRING_FIXEDSIZE (1 << 0) /* XXX unused as of now */ | #define DBI_STRING_FIXEDSIZE (1 << 0) /* XXX unused as of now */ | |||
#define DBI_DATETIME_DATE (1 << 0) | #define DBI_DATETIME_DATE (1 << 0) | |||
#define DBI_DATETIME_TIME (1 << 1) | #define DBI_DATETIME_TIME (1 << 1) | |||
/* values for the bitmask in field_flags (unique to each row) */ | /* values for the bitmask in field_flags (unique to each row) */ | |||
#define DBI_VALUE_NULL (1 << 0) | #define DBI_VALUE_NULL (1 << 0) | |||
/* error code for type retrieval functions */ | /* error code for type retrieval functions */ | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 19 lines changed or added | |||