Lines Matching refs:var
41 XSQLVAR const *var = &sqlda->sqlvar[i]; in free_sqlda() local
43 if (var->sqlind) { in free_sqlda()
44 efree(var->sqlind); in free_sqlda()
106 XSQLVAR *var = &S->out_sqlda.sqlvar[i]; in firebird_stmt_execute() local
107 var->sqlind = (void*)ecalloc(1, var->sqllen + 2 * sizeof(short)); in firebird_stmt_execute()
108 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_execute()
202 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_describe() local
206 colname_len = (S->H->fetch_table_names && var->relname_length) in firebird_stmt_describe()
207 ? (var->aliasname_length + var->relname_length + 1) in firebird_stmt_describe()
208 : (var->aliasname_length); in firebird_stmt_describe()
209 col->precision = -var->sqlscale; in firebird_stmt_describe()
210 col->maxlen = var->sqllen; in firebird_stmt_describe()
213 if (colname_len > var->aliasname_length) { in firebird_stmt_describe()
214 memmove(cp, var->relname, var->relname_length); in firebird_stmt_describe()
215 cp += var->relname_length; in firebird_stmt_describe()
218 memmove(cp, var->aliasname, var->aliasname_length); in firebird_stmt_describe()
219 *(cp+var->aliasname_length) = '\0'; in firebird_stmt_describe()
221 if (var->sqlscale < 0) { in firebird_stmt_describe()
224 switch (var->sqltype & ~1) { in firebird_stmt_describe()
329 XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_get_col() local
331 if (*var->sqlind == -1) { in firebird_stmt_get_col()
336 if (var->sqlscale < 0) { in firebird_stmt_get_col()
354 ISC_INT64 n, f = scales[-var->sqlscale]; in firebird_stmt_get_col()
356 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
358 n = *(short*)var->sqldata; in firebird_stmt_get_col()
361 n = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
364 n = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
371 n / f, -var->sqlscale, n % f); in firebird_stmt_get_col()
374 n / f, -var->sqlscale, -n % f); in firebird_stmt_get_col()
376 *len = slprintf(*ptr, CHAR_BUF_LEN, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); in firebird_stmt_get_col()
379 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
384 *ptr = &var->sqldata[2]; in firebird_stmt_get_col()
385 *len = *(short*)var->sqldata; in firebird_stmt_get_col()
388 *ptr = var->sqldata; in firebird_stmt_get_col()
389 *len = var->sqllen; in firebird_stmt_get_col()
394 *(zend_long *)*ptr = *(short*)var->sqldata; in firebird_stmt_get_col()
399 *(zend_long *)*ptr = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
405 *(zend_long *)*ptr = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
408 *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); in firebird_stmt_get_col()
413 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F", *(float*)var->sqldata); in firebird_stmt_get_col()
417 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F" , *(double*)var->sqldata); in firebird_stmt_get_col()
420 isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); in firebird_stmt_get_col()
424 isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); in firebird_stmt_get_col()
428 isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t); in firebird_stmt_get_col()
438 (ISC_QUAD*)var->sqldata); in firebird_stmt_get_col()
494 XSQLVAR *var; in firebird_stmt_param_hook() local
516 XSQLVAR *var = &sqlda->sqlvar[i]; in firebird_stmt_param_hook() local
518 if ((var->aliasname_length && !strncasecmp(ZSTR_VAL(param->name), var->aliasname, in firebird_stmt_param_hook()
519 min(ZSTR_LEN(param->name), var->aliasname_length))) in firebird_stmt_param_hook()
520 || (var->sqlname_length && !strncasecmp(ZSTR_VAL(param->name), var->sqlname, in firebird_stmt_param_hook()
521 min(ZSTR_LEN(param->name), var->sqlname_length)))) { in firebird_stmt_param_hook()
534 var = &sqlda->sqlvar[param->paramno]; in firebird_stmt_param_hook()
545 if (var->sqlind) { in firebird_stmt_param_hook()
546 efree(var->sqlind); in firebird_stmt_param_hook()
548 var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); in firebird_stmt_param_hook()
549 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_param_hook()
558 *var->sqlind = 0; in firebird_stmt_param_hook()
579 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
588 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
593 *var->sqlind = -1; in firebird_stmt_param_hook()
596 return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter); in firebird_stmt_param_hook()
606 var->sqltype = (sizeof(zend_long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); in firebird_stmt_param_hook()
607 var->sqldata = (void*)&Z_LVAL_P(parameter); in firebird_stmt_param_hook()
608 var->sqllen = sizeof(zend_long); in firebird_stmt_param_hook()
612 var->sqltype = SQL_DOUBLE | (var->sqltype & 1); in firebird_stmt_param_hook()
613 var->sqldata = (void*)&Z_DVAL_P(parameter); in firebird_stmt_param_hook()
614 var->sqllen = sizeof(double); in firebird_stmt_param_hook()
620 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
633 var->sqltype = SQL_TEXT | (var->sqltype & 1); in firebird_stmt_param_hook()
634 var->sqldata = Z_STRVAL_P(parameter); in firebird_stmt_param_hook()
635 var->sqllen = Z_STRLEN_P(parameter); in firebird_stmt_param_hook()
640 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
645 *var->sqlind = -1; in firebird_stmt_param_hook()