2 * Copyright (c) 2004-2009 Oracle. All rights reserved.
4 * http://www.apache.org/licenses/LICENSE-2.0.txt
6 * authors: George Schlossnagle <george@omniti.com>
12 extern zend_module_entry db4_module_entry;
13 #define phpext_db4_ptr &db4_module_entry
16 #define PHP_DB4_API __declspec(dllexport)
27 PHP_DB4_API zend_class_entry *db_txn_ce_get(void);
28 PHP_DB4_API zend_class_entry *dbc_ce_get(void);
29 PHP_DB4_API zend_class_entry *db_env_ce_get(void);
30 PHP_DB4_API zend_class_entry *db_ce_get(void);
31 PHP_DB4_API DB_ENV *php_db4_getDbEnvFromObj(zval *z TSRMLS_DC);
32 PHP_DB4_API DB *php_db4_getDbFromObj(zval *z TSRMLS_DC);
33 PHP_DB4_API DB_TXN *php_db4_getDbTxnFromObj(zval *z TSRMLS_DC);
34 PHP_DB4_API DBC *php_db4_getDbcFromObj(zval *z TSRMLS_DC);
36 Declare any global variables you may need between the BEGIN
39 ZEND_BEGIN_MODULE_GLOBALS(db4)
42 ZEND_END_MODULE_GLOBALS(db4)
45 /* In every utility function you add that needs to use variables
46 in php_db4_globals, call TSRM_FETCH(); after declaring other
47 variables used by that function, or better yet, pass in TSRMLS_CC
48 after the last function argument and declare your utility function
49 with TSRMLS_DC after the last declared argument. Always refer to
50 the globals in your function as DB4_G(variable). You are
51 encouraged to rename these macros something shorter, see
52 examples in any other php module directory.
56 #define DB4_G(v) TSRMG(db4_globals_id, zend_db4_globals *, v)
58 #define DB4_G(v) (db4_globals.v)
61 #endif /* PHP_DB4_H */