Back to index

php5  5.3.10
php_pdo.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author: Wez Furlong <wez@php.net>                                    |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_pdo.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_PDO_H
00022 #define PHP_PDO_H
00023 
00024 #include "zend.h"
00025 
00026 #if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)
00027 #define can_handle_soft_dependency_on_SPL 1
00028 #endif
00029 
00030 extern zend_module_entry pdo_module_entry;
00031 #define phpext_pdo_ptr &pdo_module_entry
00032 
00033 #ifdef PHP_WIN32
00034 #      if defined(PDO_EXPORTS) || (!defined(COMPILE_DL_PDO))
00035 #             define PDO_API __declspec(dllexport)
00036 #      elif defined(COMPILE_DL_PDO)
00037 #             define PDO_API __declspec(dllimport)
00038 #      else
00039 #             define PDO_API /* nothing special */
00040 #      endif
00041 #elif defined(__GNUC__) && __GNUC__ >= 4
00042 #      define PDO_API __attribute__ ((visibility("default")))
00043 #else
00044 #      define PDO_API /* nothing special */
00045 #endif
00046 
00047 #ifdef ZTS
00048 # include "TSRM.h"
00049 #endif
00050 
00051 PHP_MINIT_FUNCTION(pdo);
00052 PHP_MSHUTDOWN_FUNCTION(pdo);
00053 PHP_MINFO_FUNCTION(pdo);
00054 
00055 ZEND_BEGIN_MODULE_GLOBALS(pdo)
00056        long  global_value;
00057 ZEND_END_MODULE_GLOBALS(pdo)
00058 
00059 #ifdef ZTS
00060 # define PDOG(v) TSRMG(pdo_globals_id, zend_pdo_globals *, v)
00061 #else
00062 # define PDOG(v) (pdo_globals.v)
00063 #endif
00064 
00065 #define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
00066        zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
00067 
00068 #define REGISTER_PDO_CONST_LONG(const_name, value) { \
00069        zend_class_entry **pce;     \
00070        if (zend_hash_find(CG(class_table), "pdo", sizeof("pdo"), (void **) &pce) != FAILURE)      \
00071               zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);  \
00072 }      \
00073 
00074 #define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \
00075        zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
00076 
00077 #define PDO_CONSTRUCT_CHECK \
00078        if (!dbh->driver) {  \
00079               pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC);      \
00080               return;       \
00081        }      \
00082 
00083 
00084 #endif /* PHP_PDO_H */
00085 
00086 
00087 /*
00088  * Local variables:
00089  * tab-width: 4
00090  * c-basic-offset: 4
00091  * End:
00092  * vim600: noet sw=4 ts=4 fdm=marker
00093  * vim<600: noet sw=4 ts=4
00094  */