summaryrefslogtreecommitdiff
path: root/ext/interbase/php_interbase.h
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2004-02-01 16:13:07 +0000
committerArd Biesheuvel <abies@php.net>2004-02-01 16:13:07 +0000
commit69d53a767644033f6a26e5b8b4abc6663588aeef (patch)
tree7b7651d113ac78a8c5a29c030d8be8e6fa0eddb2 /ext/interbase/php_interbase.h
parente4ad9209ed2afe2a03cdb020cd98edc37d066980 (diff)
downloadphp-git-69d53a767644033f6a26e5b8b4abc6663588aeef.tar.gz
Added backup/restore functions
Split interbase.c into several files # It was becoming too big to handle
Diffstat (limited to 'ext/interbase/php_interbase.h')
-rw-r--r--ext/interbase/php_interbase.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h
index fbd42b3340..917473e29c 100644
--- a/ext/interbase/php_interbase.h
+++ b/ext/interbase/php_interbase.h
@@ -25,9 +25,33 @@
#include <ibase.h>
+#ifndef SQLDA_CURRENT_VERSION
+#define SQLDA_CURRENT_VERSION SQLDA_VERSION1
+#endif
+
+/* IB < 6 doesn't define these */
+#ifndef SQL_DIALECT_CURRENT
+#define SQL_DIALECT_CURRENT 1 /* == SQL_DIALECT_V5 */
+
+#ifdef PHP_WIN32
+typedef __int64 ISC_INT64;
+typedef unsigned __int64 ISC_UINT64;
+#else
+typedef long long ISC_INT64;
+typedef unsigned long long ISC_UINT64;
+#endif /* PHP_WIN32 */
+#endif /* SQL_DIALECT_CURRENT */
+
extern zend_module_entry ibase_module_entry;
#define phpext_interbase_ptr &ibase_module_entry
+#define RESET_ERRMSG { IBG(errmsg)[0] = '\0'; IBG(sql_code) = 0; }
+
+#define IB_STATUS (IBG(status))
+
+extern int le_blob, le_link, le_plink, le_result, le_query, le_trans,
+ le_event, le_service;
+
PHP_MINIT_FUNCTION(ibase);
PHP_RINIT_FUNCTION(ibase);
PHP_MSHUTDOWN_FUNCTION(ibase);
@@ -80,6 +104,11 @@ PHP_FUNCTION(ibase_modify_user);
PHP_FUNCTION(ibase_delete_user);
PHP_FUNCTION(ibase_rollback_ret);
+
+PHP_FUNCTION(ibase_service_attach);
+PHP_FUNCTION(ibase_service_detach);
+PHP_FUNCTION(ibase_backup);
+PHP_FUNCTION(ibase_restore);
#endif
PHP_FUNCTION(ibase_errmsg);
PHP_FUNCTION(ibase_errcode);
@@ -111,6 +140,8 @@ ZEND_BEGIN_MODULE_GLOBALS(ibase)
long sql_code;
ZEND_END_MODULE_GLOBALS(ibase)
+ZEND_EXTERN_MODULE_GLOBALS(ibase)
+
typedef struct {
isc_db_handle handle;
struct tr_list *tr_list;
@@ -175,6 +206,12 @@ typedef struct {
void **thread_ctx;
} ibase_event;
+typedef struct {
+ isc_svc_handle handle;
+ char *hostname;
+ char *username;
+} ibase_service;
+
enum php_interbase_option {
PHP_IBASE_DEFAULT = 0,
/* fetch flags */
@@ -205,6 +242,35 @@ enum php_interbase_option {
#define IBG(v) (ibase_globals.v)
#endif
+#define BLOB_ID_LEN 18
+#define BLOB_ID_MASK "0x%" LL_MASK "x"
+
+#define BLOB_INPUT 1
+#define BLOB_OUTPUT 2
+
+#ifdef PHP_WIN32
+#define LL_MASK "I64"
+#define LL_LIT(lit) lit ## I64
+#else
+#define LL_MASK "ll"
+#define LL_LIT(lit) lit ## ll
+#endif
+
+int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd);
+char *_php_ibase_quad_to_string(ISC_QUAD const qd);
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC);
+int _php_ibase_blob_add(zval **string_arg, ibase_blob *ib_blob TSRMLS_DC);
+
+void _php_ibase_error(TSRMLS_D);
+void _php_ibase_module_error(char * TSRMLS_DC, ...)
+ PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2);
+
+int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC);
+void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval **link_id,
+ ibase_db_link **ib_link, ibase_trans **trans);
+
+void _php_ibase_event_free(char *event_buf, char *result_buf);
+
#else
#define phpext_interbase_ptr NULL