Lines Matching refs:var

43 		XSQLVAR const *var = &sqlda->sqlvar[i];  in free_sqlda()  local
45 if (var->sqlind) { in free_sqlda()
46 efree(var->sqlind); in free_sqlda()
189 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_describe() local
194 var->sqlind = (void*)ecalloc(1, var->sqllen + 2*sizeof(short)); in firebird_stmt_describe()
195 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_describe()
197 colname_len = (S->H->fetch_table_names && var->relname_length) in firebird_stmt_describe()
198 ? (var->aliasname_length + var->relname_length + 1) in firebird_stmt_describe()
199 : (var->aliasname_length); in firebird_stmt_describe()
200 col->precision = -var->sqlscale; in firebird_stmt_describe()
201 col->maxlen = var->sqllen; in firebird_stmt_describe()
204 if (colname_len > var->aliasname_length) { in firebird_stmt_describe()
205 memmove(cp, var->relname, var->relname_length); in firebird_stmt_describe()
206 cp += var->relname_length; in firebird_stmt_describe()
209 memmove(cp, var->aliasname, var->aliasname_length); in firebird_stmt_describe()
210 *(cp+var->aliasname_length) = '\0'; in firebird_stmt_describe()
304 XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_get_col() local
306 if (*var->sqlind == -1) { in firebird_stmt_get_col()
311 if (var->sqlscale < 0) { in firebird_stmt_get_col()
329 ISC_INT64 n, f = scales[-var->sqlscale]; in firebird_stmt_get_col()
331 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
333 n = *(short*)var->sqldata; in firebird_stmt_get_col()
336 n = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
339 n = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
346 n / f, -var->sqlscale, n % f); in firebird_stmt_get_col()
349 n / f, -var->sqlscale, -n % f); in firebird_stmt_get_col()
351 *len = slprintf(*ptr, CHAR_BUF_LEN, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); in firebird_stmt_get_col()
354 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
359 *ptr = &var->sqldata[2]; in firebird_stmt_get_col()
360 *len = *(short*)var->sqldata; in firebird_stmt_get_col()
363 *ptr = var->sqldata; in firebird_stmt_get_col()
364 *len = var->sqllen; in firebird_stmt_get_col()
368 *len = slprintf(*ptr, CHAR_BUF_LEN, "%d", *(short*)var->sqldata); in firebird_stmt_get_col()
372 *len = slprintf(*ptr, CHAR_BUF_LEN, "%ld", *(ISC_LONG*)var->sqldata); in firebird_stmt_get_col()
376 *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); in firebird_stmt_get_col()
380 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F", *(float*)var->sqldata); in firebird_stmt_get_col()
384 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F" , *(double*)var->sqldata); in firebird_stmt_get_col()
387 isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); in firebird_stmt_get_col()
391 isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); in firebird_stmt_get_col()
395 isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t); in firebird_stmt_get_col()
405 (ISC_QUAD*)var->sqldata TSRMLS_CC); in firebird_stmt_get_col()
457 XSQLVAR *var; in firebird_stmt_param_hook() local
479 XSQLVAR *var = &sqlda->sqlvar[i]; in firebird_stmt_param_hook() local
481 if ((var->aliasname_length && !strncasecmp(param->name, var->aliasname, in firebird_stmt_param_hook()
482 min(param->namelen, var->aliasname_length))) in firebird_stmt_param_hook()
483 || (var->sqlname_length && !strncasecmp(param->name, var->sqlname, in firebird_stmt_param_hook()
484 min(param->namelen, var->sqlname_length)))) { in firebird_stmt_param_hook()
497 var = &sqlda->sqlvar[param->paramno]; in firebird_stmt_param_hook()
507 if (var->sqlind) { in firebird_stmt_param_hook()
508 efree(var->sqlind); in firebird_stmt_param_hook()
510 var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); in firebird_stmt_param_hook()
511 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_param_hook()
520 *var->sqlind = 0; in firebird_stmt_param_hook()
522 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
529 return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, in firebird_stmt_param_hook()
539 var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); in firebird_stmt_param_hook()
540 var->sqldata = (void*)&Z_LVAL_P(param->parameter); in firebird_stmt_param_hook()
541 var->sqllen = sizeof(long); in firebird_stmt_param_hook()
545 var->sqltype = SQL_DOUBLE | (var->sqltype & 1); in firebird_stmt_param_hook()
546 var->sqldata = (void*)&Z_DVAL_P(param->parameter); in firebird_stmt_param_hook()
547 var->sqllen = sizeof(double); in firebird_stmt_param_hook()
553 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
566 var->sqltype = SQL_TEXT | (var->sqltype & 1); in firebird_stmt_param_hook()
567 var->sqldata = Z_STRVAL_P(param->parameter); in firebird_stmt_param_hook()
568 var->sqllen = Z_STRLEN_P(param->parameter); in firebird_stmt_param_hook()
573 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
578 *var->sqlind = -1; in firebird_stmt_param_hook()