Annotation of embedaddon/php/ext/mysqli/mysqli_prop.c, revision 1.1.1.1

1.1       misho       1: /*
                      2:   +----------------------------------------------------------------------+
                      3:   | PHP Version 5                                                        |
                      4:   +----------------------------------------------------------------------+
                      5:   | Copyright (c) 1997-2012 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:   | Author: Georg Richter <georg@php.net>                                |
                     16:   +----------------------------------------------------------------------+
                     17: 
                     18:   $Id: mysqli_prop.c 321634 2012-01-01 13:15:04Z felipe $
                     19: */
                     20: 
                     21: #ifdef HAVE_CONFIG_H
                     22: #include "config.h"
                     23: #endif
                     24: 
                     25: #include <signal.h>
                     26: 
                     27: #include "php.h"
                     28: #include "php_ini.h"
                     29: #include "ext/standard/info.h"
                     30: #include "php_mysqli_structs.h"
                     31: #include "mysqli_priv.h"
                     32: 
                     33: #define CHECK_STATUS(value) \
                     34:        if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
                     35:                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
                     36:                ZVAL_NULL(*retval); \
                     37:                return SUCCESS; \
                     38:        } \
                     39: 
                     40: #define MYSQLI_GET_MYSQL(statusval) \
                     41: MYSQL *p; \
                     42: MAKE_STD_ZVAL(*retval);\
                     43: if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
                     44:        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
                     45:        ZVAL_NULL(*retval);\
                     46:        return SUCCESS; \
                     47: } else { \
                     48:        CHECK_STATUS(statusval);\
                     49:     p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\
                     50: }
                     51: 
                     52: #define MYSQLI_GET_RESULT(statusval) \
                     53: MYSQL_RES *p; \
                     54: MAKE_STD_ZVAL(*retval);\
                     55: if (!obj->ptr) { \
                     56:        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
                     57:        ZVAL_NULL(*retval);\
                     58:        return SUCCESS; \
                     59: } else { \
                     60:        CHECK_STATUS(statusval);\
                     61:        p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; \
                     62: }
                     63: 
                     64: 
                     65: #define MYSQLI_GET_STMT(statusval) \
                     66: MYSQL_STMT *p; \
                     67: MAKE_STD_ZVAL(*retval);\
                     68: if (!obj->ptr) { \
                     69:        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name);\
                     70:        ZVAL_NULL(*retval);\
                     71:        return SUCCESS; \
                     72: } else { \
                     73:        CHECK_STATUS(statusval);\
                     74:        p = (MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt;\
                     75: }
                     76: 
                     77: #define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
                     78: static int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \
                     79: {\
                     80:        __ret_type l;\
                     81:        __get_type;\
                     82:        if (!p) {\
                     83:                ZVAL_NULL(*retval);\
                     84:        } else {\
                     85:                l = (__ret_type)__int_func(p);\
                     86:                if (l < LONG_MAX) {\
                     87:                        ZVAL_LONG(*retval, (long) l);\
                     88:                } else { \
                     89:                        char *ret; \
                     90:                        int ret_len = spprintf(&ret, 0, __ret_type_sprint_mod, l); \
                     91:                        ZVAL_STRINGL(*retval, ret, ret_len, 0); \
                     92:                } \
                     93:        }\
                     94:        return SUCCESS;\
                     95: }
                     96: 
                     97: #define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
                     98: static int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
                     99: {\
                    100:        char *c;\
                    101:        __get_type;\
                    102:        if (!p) {\
                    103:                ZVAL_NULL(*retval);\
                    104:        } else {\
                    105:                c = (char *)__int_func(p);\
                    106:                if (!c) {\
                    107:                        ZVAL_NULL(*retval);\
                    108:                } else {\
                    109:                        ZVAL_STRING(*retval, c, 1);\
                    110:                }\
                    111:        }\
                    112:        return SUCCESS;\
                    113: }
                    114: 
                    115: /* {{{ property link_client_version_read */
                    116: static int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    117: {
                    118:        MAKE_STD_ZVAL(*retval);
                    119:        ZVAL_LONG(*retval, MYSQL_VERSION_ID);
                    120:        return SUCCESS;
                    121: }
                    122: /* }}} */
                    123: 
                    124: /* {{{ property link_client_info_read */
                    125: static int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    126: {
                    127:        MAKE_STD_ZVAL(*retval);
                    128:        CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
                    129:        ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
                    130:        return SUCCESS;
                    131: }
                    132: /* }}} */
                    133: 
                    134: /* {{{ property link_connect_errno_read */
                    135: static int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    136: {
                    137:        MAKE_STD_ZVAL(*retval);
                    138:        ZVAL_LONG(*retval, (long)MyG(error_no));
                    139:        return SUCCESS;
                    140: }
                    141: /* }}} */
                    142: 
                    143: /* {{{ property link_connect_error_read */
                    144: static int link_connect_error_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    145: {
                    146:        MAKE_STD_ZVAL(*retval);
                    147:        if (MyG(error_msg)) {
                    148:                ZVAL_STRING(*retval, MyG(error_msg), 1);
                    149:        } else {
                    150:                ZVAL_NULL(*retval);
                    151:        }
                    152:        return SUCCESS;
                    153: }
                    154: /* }}} */
                    155: 
                    156: /* {{{ property link_affected_rows_read */
                    157: static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    158: {
                    159:        MY_MYSQL *mysql;
                    160:        my_ulonglong rc;
                    161: 
                    162:        MAKE_STD_ZVAL(*retval);
                    163: 
                    164:        CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
                    165: 
                    166:        mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    167: 
                    168:        if (!mysql) {
                    169:                ZVAL_NULL(*retval);
                    170:        } else {
                    171:                CHECK_STATUS(MYSQLI_STATUS_VALID);
                    172: 
                    173:                rc = mysql_affected_rows(mysql->mysql);
                    174: 
                    175:                if (rc == (my_ulonglong) -1) {
                    176:                        ZVAL_LONG(*retval, -1);
                    177:                        return SUCCESS;
                    178:                }
                    179: 
                    180:                if (rc < LONG_MAX) {
                    181:                        ZVAL_LONG(*retval, (long) rc);
                    182:                } else {
                    183:                        char *ret;
                    184:                        int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
                    185:                        ZVAL_STRINGL(*retval, ret, l, 0);
                    186:                }
                    187:        }
                    188:        return SUCCESS;
                    189: }
                    190: /* }}} */
                    191: 
                    192: /* link properties */
                    193: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_errno_read, mysql_errno, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
                    194: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_error_read, mysql_error, MYSQLI_GET_MYSQL(MYSQLI_STATUS_INITIALIZED))
                    195: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_field_count_read, mysql_field_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
                    196: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_host_info_read, mysql_get_host_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
                    197: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_info_read, mysql_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
                    198: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_insert_id_read, mysql_insert_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
                    199: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_protocol_version_read, mysql_get_proto_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
                    200: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_server_info_read, mysql_get_server_info, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
                    201: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_server_version_read, mysql_get_server_version, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
                    202: MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID))
                    203: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
                    204: MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), ulong, "%lu")
                    205: 
                    206: /* {{{ property link_stat_read */
                    207: static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)\
                    208: {\
                    209:        MY_MYSQL *mysql;
                    210: 
                    211:        MAKE_STD_ZVAL(*retval);
                    212:        ZVAL_NULL(*retval);
                    213: 
                    214:        CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
                    215: 
                    216:        mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    217: 
                    218:        if (mysql) {
                    219:                char * stat_msg;
                    220: #if defined(MYSQLI_USE_MYSQLND)
                    221:                uint stat_msg_len;
                    222:                if (mysqlnd_stat(mysql->mysql, &stat_msg, &stat_msg_len) == PASS) {
                    223:                        ZVAL_STRINGL(*retval, stat_msg, stat_msg_len, 0);
                    224:                }
                    225: #else
                    226:                if ((stat_msg = (char *) mysql_stat(mysql->mysql))) {
                    227:                        ZVAL_STRING(*retval, stat_msg, 1);
                    228:                }
                    229: #endif
                    230:        }
                    231:        return SUCCESS;
                    232: }
                    233: /* }}} */
                    234: 
                    235: /* result properties */
                    236: 
                    237: /* {{{ property result_type_read */
                    238: static int result_type_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    239: {
                    240:        MYSQL_RES *p;
                    241: 
                    242:        MAKE_STD_ZVAL(*retval);
                    243:        CHECK_STATUS(MYSQLI_STATUS_VALID);
                    244:        p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    245: 
                    246:        if (!p) {
                    247:                ZVAL_NULL(*retval);
                    248:        } else {
                    249:                ZVAL_LONG(*retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT);
                    250:        }
                    251:        return SUCCESS;
                    252: }
                    253: /* }}} */
                    254: 
                    255: /* {{{ property result_lengths_read */
                    256: static int result_lengths_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    257: {
                    258:        MYSQL_RES *p;
                    259:        ulong *ret;
                    260: 
                    261:        MAKE_STD_ZVAL(*retval);
                    262: 
                    263:        CHECK_STATUS(MYSQLI_STATUS_VALID);
                    264:        p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    265:        if (!p || !p->field_count || !(ret = mysql_fetch_lengths(p))) {
                    266:                ZVAL_NULL(*retval);
                    267:        } else {
                    268:                ulong i;
                    269: 
                    270:                array_init(*retval);
                    271: 
                    272:                for (i = 0; i < p->field_count; i++) {
                    273:                        add_index_long(*retval, i, ret[i]);
                    274:                }
                    275:        }
                    276:        return SUCCESS;
                    277: }
                    278: /* }}} */
                    279: 
                    280: 
                    281: MYSQLI_MAP_PROPERTY_FUNC_LONG(result_current_field_read, mysql_field_tell, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
                    282: MYSQLI_MAP_PROPERTY_FUNC_LONG(result_field_count_read, mysql_num_fields, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), ulong, "%lu")
                    283: MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_RESULT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
                    284: 
                    285: /* statement properties */
                    286: 
                    287: /* {{{ property stmt_id_read */
                    288: static int stmt_id_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    289: {
                    290:        MY_STMT *p;
                    291: 
                    292:        MAKE_STD_ZVAL(*retval);
                    293:        CHECK_STATUS(MYSQLI_STATUS_VALID);
                    294: 
                    295:        p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    296: 
                    297:        if (!p) {
                    298:                ZVAL_NULL(*retval);
                    299:        } else {
                    300:                ZVAL_LONG(*retval, mysqli_stmt_get_id(p->stmt));
                    301:        }
                    302:        return SUCCESS;
                    303: }
                    304: /* }}} */
                    305: 
                    306: /* {{{ property stmt_affected_rows_read */
                    307: static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC)
                    308: {
                    309:        MY_STMT *p;
                    310:        my_ulonglong rc;
                    311: 
                    312:        MAKE_STD_ZVAL(*retval);
                    313:        CHECK_STATUS(MYSQLI_STATUS_VALID);
                    314: 
                    315:        p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
                    316: 
                    317:        if (!p) {
                    318:                ZVAL_NULL(*retval);
                    319:        } else {
                    320:                rc = mysql_stmt_affected_rows(p->stmt);
                    321: 
                    322:                if (rc == (my_ulonglong) -1) {
                    323:                        ZVAL_LONG(*retval, -1);
                    324:                        return SUCCESS;
                    325:                }
                    326: 
                    327:                if (rc < LONG_MAX) {
                    328:                        ZVAL_LONG(*retval, (long) rc);
                    329:                } else {
                    330:                        char *ret;
                    331:                        int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);
                    332:                        ZVAL_STRINGL(*retval, ret, l, 0);
                    333:                }
                    334:        }
                    335:        return SUCCESS;
                    336: }
                    337: /* }}} */
                    338: 
                    339: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
                    340: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), my_ulonglong, MYSQLI_LLU_SPEC)
                    341: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
                    342: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(MYSQLI_STATUS_VALID), ulong, "%lu")
                    343: MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED), ulong, "%lu")
                    344: MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
                    345: MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT(MYSQLI_STATUS_INITIALIZED))
                    346: 
                    347: /* }}} */
                    348: const mysqli_property_entry mysqli_link_property_entries[] = {
                    349:        {"affected_rows",       sizeof("affected_rows") - 1,    link_affected_rows_read, NULL},
                    350:        {"client_info",         sizeof("client_info") - 1,              link_client_info_read, NULL},
                    351:        {"client_version",      sizeof("client_version") - 1,   link_client_version_read, NULL},
                    352:        {"connect_errno",       sizeof("connect_errno") - 1,    link_connect_errno_read, NULL},
                    353:        {"connect_error",       sizeof("connect_error") - 1,    link_connect_error_read, NULL},
                    354:        {"errno",                       sizeof("errno") - 1,                    link_errno_read, NULL},
                    355:        {"error",                       sizeof("error") - 1,                    link_error_read, NULL},
                    356:        {"field_count",         sizeof("field_count") - 1,              link_field_count_read, NULL},
                    357:        {"host_info",           sizeof("host_info") - 1,                link_host_info_read, NULL},
                    358:        {"info",                        sizeof("info") - 1,                             link_info_read, NULL},
                    359:        {"insert_id",           sizeof("insert_id") - 1,                link_insert_id_read, NULL},
                    360:        {"server_info",         sizeof("server_info") - 1,              link_server_info_read, NULL},
                    361:        {"server_version",      sizeof("server_version") - 1,   link_server_version_read, NULL},
                    362:        {"stat",                        sizeof("stat") - 1,                             link_stat_read, NULL},
                    363:        {"sqlstate",            sizeof("sqlstate") - 1,                 link_sqlstate_read, NULL},
                    364:        {"protocol_version",sizeof("protocol_version") - 1,     link_protocol_version_read, NULL},
                    365:        {"thread_id",           sizeof("thread_id") - 1,                link_thread_id_read, NULL},
                    366:        {"warning_count",       sizeof("warning_count") - 1,    link_warning_count_read, NULL},
                    367:        {NULL, 0, NULL, NULL}
                    368: };
                    369: 
                    370: /* should not be const, as it is patched during runtime */
                    371: zend_property_info mysqli_link_property_info_entries[] = {
                    372:        {ZEND_ACC_PUBLIC, "affected_rows",      sizeof("affected_rows") - 1,    0, NULL, 0, NULL},
                    373:        {ZEND_ACC_PUBLIC, "client_info",        sizeof("client_info") - 1,              0, NULL, 0, NULL},
                    374:        {ZEND_ACC_PUBLIC, "client_version",     sizeof("client_version") - 1,   0, NULL, 0, NULL},
                    375:        {ZEND_ACC_PUBLIC, "connect_errno",      sizeof("connect_errno") - 1,    0, NULL, 0, NULL},
                    376:        {ZEND_ACC_PUBLIC, "connect_error",      sizeof("connect_error") - 1,    0, NULL, 0, NULL},
                    377:        {ZEND_ACC_PUBLIC, "errno",                      sizeof("errno") - 1,                    0, NULL, 0, NULL},
                    378:        {ZEND_ACC_PUBLIC, "error",                      sizeof("error") - 1,                    0, NULL, 0, NULL},
                    379:        {ZEND_ACC_PUBLIC, "field_count",        sizeof("field_count") - 1,              0, NULL, 0, NULL},
                    380:        {ZEND_ACC_PUBLIC, "host_info",          sizeof("host_info") - 1,                0, NULL, 0, NULL},
                    381:        {ZEND_ACC_PUBLIC, "info",                       sizeof("info") - 1,                             0, NULL, 0, NULL},
                    382:        {ZEND_ACC_PUBLIC, "insert_id",          sizeof("insert_id") - 1,                0, NULL, 0, NULL},
                    383:        {ZEND_ACC_PUBLIC, "server_info",        sizeof("server_info") - 1,              0, NULL, 0, NULL},
                    384:        {ZEND_ACC_PUBLIC, "server_version",     sizeof("server_version") - 1,   0, NULL, 0, NULL},
                    385:        {ZEND_ACC_PUBLIC, "stat",                       sizeof("stat") - 1,                             0, NULL, 0, NULL},
                    386:        {ZEND_ACC_PUBLIC, "sqlstate",           sizeof("sqlstate") - 1,                 0, NULL, 0, NULL},
                    387:        {ZEND_ACC_PUBLIC, "protocol_version", sizeof("protocol_version")-1, 0, NULL, 0, NULL},
                    388:        {ZEND_ACC_PUBLIC, "thread_id",          sizeof("thread_id") - 1,                0, NULL, 0, NULL},
                    389:        {ZEND_ACC_PUBLIC, "warning_count",      sizeof("warning_count") - 1,    0, NULL, 0, NULL},
                    390:        {0,                                     NULL,                   0,                                                              0, NULL, 0, NULL}
                    391: };
                    392: 
                    393: 
                    394: const mysqli_property_entry mysqli_result_property_entries[] = {
                    395:        {"current_field",sizeof("current_field")-1,     result_current_field_read, NULL},
                    396:        {"field_count", sizeof("field_count") - 1,      result_field_count_read, NULL},
                    397:        {"lengths",     sizeof("lengths") - 1,          result_lengths_read, NULL},
                    398:        {"num_rows",    sizeof("num_rows") - 1,         result_num_rows_read, NULL},
                    399:        {"type",                sizeof("type") - 1,                     result_type_read, NULL},
                    400:        {NULL, 0, NULL, NULL}
                    401: };
                    402: 
                    403: zend_property_info mysqli_result_property_info_entries[] = {
                    404:        {ZEND_ACC_PUBLIC, "current_field",      sizeof("current_field")-1,      0, NULL, 0, NULL},
                    405:        {ZEND_ACC_PUBLIC, "field_count",        sizeof("field_count") - 1,      0, NULL, 0, NULL},
                    406:        {ZEND_ACC_PUBLIC, "lengths",            sizeof("lengths") - 1,          0, NULL, 0, NULL},
                    407:        {ZEND_ACC_PUBLIC, "num_rows",           sizeof("num_rows") - 1,         0, NULL, 0, NULL},
                    408:        {ZEND_ACC_PUBLIC, "type",                       sizeof("type") - 1,             0, NULL, 0, NULL},
                    409:        {0,                                     NULL,                   0,                                                      0, NULL, 0, NULL}
                    410: };
                    411: 
                    412: const mysqli_property_entry mysqli_stmt_property_entries[] = {
                    413:        {"affected_rows", sizeof("affected_rows")-1,stmt_affected_rows_read, NULL},
                    414:        {"insert_id",   sizeof("insert_id") - 1,        stmt_insert_id_read, NULL},
                    415:        {"num_rows",    sizeof("num_rows") - 1,         stmt_num_rows_read, NULL},
                    416:        {"param_count", sizeof("param_count") - 1,      stmt_param_count_read, NULL},
                    417:        {"field_count", sizeof("field_count") - 1,      stmt_field_count_read, NULL},
                    418:        {"errno",               sizeof("errno") - 1,            stmt_errno_read, NULL},
                    419:        {"error",               sizeof("error") - 1,            stmt_error_read, NULL},
                    420:        {"sqlstate",    sizeof("sqlstate") - 1,         stmt_sqlstate_read, NULL},
                    421:        {"id",                  sizeof("id") - 1,                       stmt_id_read, NULL},
                    422:        {NULL, 0, NULL, NULL}
                    423: };
                    424: 
                    425: 
                    426: zend_property_info mysqli_stmt_property_info_entries[] = {
                    427:        {ZEND_ACC_PUBLIC, "affected_rows", sizeof("affected_rows") - 1, 0, NULL, 0, NULL},
                    428:        {ZEND_ACC_PUBLIC, "insert_id",  sizeof("insert_id") - 1,                0, NULL, 0, NULL},
                    429:        {ZEND_ACC_PUBLIC, "num_rows",   sizeof("num_rows") - 1,                 0, NULL, 0, NULL},
                    430:        {ZEND_ACC_PUBLIC, "param_count",sizeof("param_count") - 1,              0, NULL, 0, NULL},
                    431:        {ZEND_ACC_PUBLIC, "field_count",sizeof("field_count") - 1,              0, NULL, 0, NULL},
                    432:        {ZEND_ACC_PUBLIC, "errno",              sizeof("errno") - 1,                    0, NULL, 0, NULL},
                    433:        {ZEND_ACC_PUBLIC, "error",              sizeof("error") - 1,                    0, NULL, 0, NULL},
                    434:        {ZEND_ACC_PUBLIC, "sqlstate",   sizeof("sqlstate") - 1,                 0, NULL, 0, NULL},
                    435:        {ZEND_ACC_PUBLIC, "id",                 sizeof("id") - 1,                               0, NULL, 0, NULL},
                    436:        {0,                                     NULL,                   0,                                                      0, NULL, 0, NULL}
                    437: };
                    438: 
                    439: /*
                    440:  * Local variables:
                    441:  * tab-width: 4
                    442:  * c-basic-offset: 4
                    443:  * End:
                    444:  * vim600: noet sw=4 ts=4 fdm=marker
                    445:  * vim<600: noet sw=4 ts=4
                    446:  */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>