Lines Matching refs:var

39 		XSQLVAR const *var = &sqlda->sqlvar[i];  in free_sqlda()  local
41 if (var->sqlind) { in free_sqlda()
42 efree(var->sqlind); in free_sqlda()
104 XSQLVAR *var = &S->out_sqlda.sqlvar[i]; in firebird_stmt_execute() local
105 if (var->sqlind) { in firebird_stmt_execute()
106 efree(var->sqlind); in firebird_stmt_execute()
108 var->sqlind = (void*)ecalloc(1, var->sqllen + 2 * sizeof(short)); in firebird_stmt_execute()
109 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_execute()
210 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_describe() local
214 colname_len = (S->H->fetch_table_names && var->relname_length) in firebird_stmt_describe()
215 ? (var->aliasname_length + var->relname_length + 1) in firebird_stmt_describe()
216 : (var->aliasname_length); in firebird_stmt_describe()
217 col->precision = -var->sqlscale; in firebird_stmt_describe()
218 col->maxlen = var->sqllen; in firebird_stmt_describe()
221 if (colname_len > var->aliasname_length) { in firebird_stmt_describe()
222 memmove(cp, var->relname, var->relname_length); in firebird_stmt_describe()
223 cp += var->relname_length; in firebird_stmt_describe()
226 memmove(cp, var->aliasname, var->aliasname_length); in firebird_stmt_describe()
227 *(cp+var->aliasname_length) = '\0'; in firebird_stmt_describe()
229 if (var->sqlscale < 0) { in firebird_stmt_describe()
232 switch (var->sqltype & ~1) { in firebird_stmt_describe()
347 XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_get_col() local
349 if (*var->sqlind == -1) { in firebird_stmt_get_col()
354 if (var->sqlscale < 0) { in firebird_stmt_get_col()
372 ISC_INT64 n, f = scales[-var->sqlscale]; in firebird_stmt_get_col()
374 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
376 n = *(short*)var->sqldata; in firebird_stmt_get_col()
379 n = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
382 n = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
387 if ((var->sqltype & ~1) == SQL_DOUBLE) { in firebird_stmt_get_col()
388 *len = slprintf(*ptr, CHAR_BUF_LEN, "%.*F", -var->sqlscale, *(double*)var->sqldata); in firebird_stmt_get_col()
391 n / f, -var->sqlscale, n % f); in firebird_stmt_get_col()
394 n / f, -var->sqlscale, -n % f); in firebird_stmt_get_col()
396 *len = slprintf(*ptr, CHAR_BUF_LEN, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); in firebird_stmt_get_col()
399 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
404 *ptr = &var->sqldata[2]; in firebird_stmt_get_col()
405 *len = *(short*)var->sqldata; in firebird_stmt_get_col()
408 *ptr = var->sqldata; in firebird_stmt_get_col()
409 *len = var->sqllen; in firebird_stmt_get_col()
414 *(zend_long *)*ptr = *(short*)var->sqldata; in firebird_stmt_get_col()
419 *(zend_long *)*ptr = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
425 *(zend_long *)*ptr = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
428 *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); in firebird_stmt_get_col()
433 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F", *(float*)var->sqldata); in firebird_stmt_get_col()
437 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F" , *(double*)var->sqldata); in firebird_stmt_get_col()
443 *(zend_bool*)*ptr = *(FB_BOOLEAN*)var->sqldata; in firebird_stmt_get_col()
447 isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); in firebird_stmt_get_col()
451 isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); in firebird_stmt_get_col()
455 isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t); in firebird_stmt_get_col()
465 (ISC_QUAD*)var->sqldata); in firebird_stmt_get_col()
520 XSQLVAR *var; in firebird_stmt_param_hook() local
542 XSQLVAR *var = &sqlda->sqlvar[i]; in firebird_stmt_param_hook() local
544 if ((var->aliasname_length && !strncasecmp(ZSTR_VAL(param->name), var->aliasname, in firebird_stmt_param_hook()
545 min(ZSTR_LEN(param->name), var->aliasname_length))) in firebird_stmt_param_hook()
546 || (var->sqlname_length && !strncasecmp(ZSTR_VAL(param->name), var->sqlname, in firebird_stmt_param_hook()
547 min(ZSTR_LEN(param->name), var->sqlname_length)))) { in firebird_stmt_param_hook()
560 var = &sqlda->sqlvar[param->paramno]; in firebird_stmt_param_hook()
571 if (var->sqlind) { in firebird_stmt_param_hook()
572 efree(var->sqlind); in firebird_stmt_param_hook()
574 var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); in firebird_stmt_param_hook()
575 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_param_hook()
584 *var->sqlind = 0; in firebird_stmt_param_hook()
605 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
614 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
619 *var->sqlind = -1; in firebird_stmt_param_hook()
622 return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter); in firebird_stmt_param_hook()
628 if ((var->sqltype & ~1) == SQL_BOOLEAN) { in firebird_stmt_param_hook()
634 *(FB_BOOLEAN*)var->sqldata = zend_is_true(parameter) ? FB_TRUE : FB_FALSE; in firebird_stmt_param_hook()
642 *(FB_BOOLEAN*)var->sqldata = FB_FALSE; in firebird_stmt_param_hook()
648 *(FB_BOOLEAN*)var->sqldata = (lval != 0) ? FB_TRUE : FB_FALSE; in firebird_stmt_param_hook()
651 *(FB_BOOLEAN*)var->sqldata = (dval != 0) ? FB_TRUE : FB_FALSE; in firebird_stmt_param_hook()
655 *(FB_BOOLEAN*)var->sqldata = FB_TRUE; in firebird_stmt_param_hook()
657 *(FB_BOOLEAN*)var->sqldata = FB_FALSE; in firebird_stmt_param_hook()
668 *var->sqlind = -1; in firebird_stmt_param_hook()
686 var->sqltype = (sizeof(zend_long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); in firebird_stmt_param_hook()
687 var->sqldata = (void*)&Z_LVAL_P(parameter); in firebird_stmt_param_hook()
688 var->sqllen = sizeof(zend_long); in firebird_stmt_param_hook()
692 var->sqltype = SQL_DOUBLE | (var->sqltype & 1); in firebird_stmt_param_hook()
693 var->sqldata = (void*)&Z_DVAL_P(parameter); in firebird_stmt_param_hook()
694 var->sqllen = sizeof(double); in firebird_stmt_param_hook()
700 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
713 var->sqltype = SQL_TEXT | (var->sqltype & 1); in firebird_stmt_param_hook()
714 var->sqldata = Z_STRVAL_P(parameter); in firebird_stmt_param_hook()
715 var->sqllen = Z_STRLEN_P(parameter); in firebird_stmt_param_hook()
720 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
725 *var->sqlind = -1; in firebird_stmt_param_hook()