Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

php_db4.h

00001 /*-
00002  *  Copyright (c) 2004
00003  *  Sleepycat Software.  All rights reserved.
00004  *
00005  *  http://www.apache.org/licenses/LICENSE-2.0.txt
00006  * 
00007  *  authors: Thies C. Arntzen <[email protected]>
00008  *           Sterling Hughes <[email protected]>
00009  *           George Schlossnagle <[email protected]>
00010  */
00011 
00012 #ifndef PHP_DB4_H
00013 #define PHP_DB4_H
00014 
00015 extern zend_module_entry db4_module_entry;
00016 #define phpext_db4_ptr &db4_module_entry
00017 
00018 #ifdef PHP_WIN32
00019 #define PHP_DB4_API __declspec(dllexport)
00020 #else
00021 #define PHP_DB4_API
00022 #endif
00023 
00024 #ifdef ZTS
00025 #include "TSRM.h"
00026 #endif
00027 
00028 #include "db.h"
00029 
00030 zend_class_entry *db_txn_ce_get(void);
00031 zend_class_entry *dbc_ce_get(void);
00032 zend_class_entry *db_env_ce_get(void);
00033 zend_class_entry *db_ce_get(void);
00034 
00035 DB_ENV *php_db4_getDbEnvFromObj(zval *z);
00036 DB *php_db4_getDbFromObj(zval *z);
00037 DB_TXN *php_db4_getDbTxnFromObj(zval *z);
00038 DBC *php_db4_getDbcFromObj(zval *z);
00039 
00040 /* 
00041         Declare any global variables you may need between the BEGIN
00042         and END macros here:     
00043 
00044 ZEND_BEGIN_MODULE_GLOBALS(db4)
00045         long  global_value;
00046         char *global_string;
00047 ZEND_END_MODULE_GLOBALS(db4)
00048 */
00049 
00050 /* In every utility function you add that needs to use variables 
00051    in php_db4_globals, call TSRM_FETCH(); after declaring other 
00052    variables used by that function, or better yet, pass in TSRMLS_CC
00053    after the last function argument and declare your utility function
00054    with TSRMLS_DC after the last declared argument.  Always refer to
00055    the globals in your function as DB4_G(variable).  You are 
00056    encouraged to rename these macros something shorter, see
00057    examples in any other php module directory.
00058 */
00059 
00060 #ifdef ZTS
00061 #define DB4_G(v) TSRMG(db4_globals_id, zend_db4_globals *, v)
00062 #else
00063 #define DB4_G(v) (db4_globals.v)
00064 #endif
00065 
00066 #endif  /* PHP_DB4_H */
00067 
00068 
00069 /*
00070  * Local variables:
00071  * tab-width: 4
00072  * c-basic-offset: 4
00073  * indent-tabs-mode: t
00074  * End:
00075  */

Generated on Sun Dec 25 12:14:43 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2