Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / mysqlnd / mysqlnd_reverse_api.c
blobdaa43ec5139f6760adb1f142ddc6f7e62df36f97
1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2006-2013 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Andrey Hristov <andrey@mysql.com> |
16 | Ulf Wendel <uwendel@mysql.com> |
17 | Georg Richter <georg@mysql.com> |
18 +----------------------------------------------------------------------+
21 /* $Id: mysqlnd.c 317989 2011-10-10 20:49:28Z andrey $ */
22 #include "php.h"
23 #include "mysqlnd.h"
24 #include "mysqlnd_priv.h"
25 #include "mysqlnd_debug.h"
26 #include "mysqlnd_reverse_api.h"
29 static HashTable mysqlnd_api_ext_ht;
32 /* {{{ mysqlnd_reverse_api_init */
33 PHPAPI void
34 mysqlnd_reverse_api_init(TSRMLS_D)
36 zend_hash_init(&mysqlnd_api_ext_ht, 3, NULL, NULL, 1);
38 /* }}} */
41 /* {{{ mysqlnd_reverse_api_end */
42 PHPAPI void
43 mysqlnd_reverse_api_end(TSRMLS_D)
45 zend_hash_destroy(&mysqlnd_api_ext_ht);
47 /* }}} */
50 /* {{{ myslqnd_get_api_extensions */
51 PHPAPI HashTable *
52 mysqlnd_reverse_api_get_api_list(TSRMLS_D)
54 return &mysqlnd_api_ext_ht;
56 /* }}} */
59 /* {{{ mysqlnd_reverse_api_register_api */
60 PHPAPI void
61 mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
63 zend_hash_add(&mysqlnd_api_ext_ht, apiext->module->name, strlen(apiext->module->name) + 1, &apiext,
64 sizeof(MYSQLND_REVERSE_API), NULL);
66 /* }}} */
69 /* {{{ zval_to_mysqlnd */
70 PHPAPI MYSQLND *
71 zval_to_mysqlnd(zval * zv TSRMLS_DC)
73 MYSQLND * retval;
74 MYSQLND_REVERSE_API ** elem;
76 for (zend_hash_internal_pointer_reset(&mysqlnd_api_ext_ht);
77 zend_hash_get_current_data(&mysqlnd_api_ext_ht, (void **)&elem) == SUCCESS;
78 zend_hash_move_forward(&mysqlnd_api_ext_ht))
80 if ((*elem)->conversion_cb) {
81 retval = (*elem)->conversion_cb(zv TSRMLS_CC);
82 if (retval) {
83 return retval;
88 return NULL;
90 /* }}} */
94 * Local variables:
95 * tab-width: 4
96 * c-basic-offset: 4
97 * End:
98 * vim600: noet sw=4 ts=4 fdm=marker
99 * vim<600: noet sw=4 ts=4