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()
187 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_describe() local
192 var->sqlind = (void*)ecalloc(1, var->sqllen + 2*sizeof(short)); in firebird_stmt_describe()
193 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_describe()
195 colname_len = (S->H->fetch_table_names && var->relname_length) in firebird_stmt_describe()
196 ? (var->aliasname_length + var->relname_length + 1) in firebird_stmt_describe()
197 : (var->aliasname_length); in firebird_stmt_describe()
198 col->precision = -var->sqlscale; in firebird_stmt_describe()
199 col->maxlen = var->sqllen; in firebird_stmt_describe()
202 if (colname_len > var->aliasname_length) { in firebird_stmt_describe()
203 memmove(cp, var->relname, var->relname_length); in firebird_stmt_describe()
204 cp += var->relname_length; in firebird_stmt_describe()
207 memmove(cp, var->aliasname, var->aliasname_length); in firebird_stmt_describe()
208 *(cp+var->aliasname_length) = '\0'; in firebird_stmt_describe()
302 XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; in firebird_stmt_get_col() local
304 if (*var->sqlind == -1) { in firebird_stmt_get_col()
309 if (var->sqlscale < 0) { in firebird_stmt_get_col()
327 ISC_INT64 n, f = scales[-var->sqlscale]; in firebird_stmt_get_col()
329 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
331 n = *(short*)var->sqldata; in firebird_stmt_get_col()
334 n = *(ISC_LONG*)var->sqldata; in firebird_stmt_get_col()
337 n = *(ISC_INT64*)var->sqldata; in firebird_stmt_get_col()
344 n / f, -var->sqlscale, n % f); in firebird_stmt_get_col()
347 n / f, -var->sqlscale, -n % f); in firebird_stmt_get_col()
349 *len = slprintf(*ptr, CHAR_BUF_LEN, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); in firebird_stmt_get_col()
352 switch (var->sqltype & ~1) { in firebird_stmt_get_col()
357 *ptr = &var->sqldata[2]; in firebird_stmt_get_col()
358 *len = *(short*)var->sqldata; in firebird_stmt_get_col()
361 *ptr = var->sqldata; in firebird_stmt_get_col()
362 *len = var->sqllen; in firebird_stmt_get_col()
366 *len = slprintf(*ptr, CHAR_BUF_LEN, "%d", *(short*)var->sqldata); in firebird_stmt_get_col()
370 *len = slprintf(*ptr, CHAR_BUF_LEN, "%ld", *(ISC_LONG*)var->sqldata); in firebird_stmt_get_col()
374 *len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d", *(ISC_INT64*)var->sqldata); in firebird_stmt_get_col()
378 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F", *(float*)var->sqldata); in firebird_stmt_get_col()
382 *len = slprintf(*ptr, CHAR_BUF_LEN, "%F" , *(double*)var->sqldata); in firebird_stmt_get_col()
385 isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); in firebird_stmt_get_col()
389 isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); in firebird_stmt_get_col()
393 isc_decode_timestamp((ISC_TIMESTAMP*)var->sqldata, &t); in firebird_stmt_get_col()
403 (ISC_QUAD*)var->sqldata TSRMLS_CC); in firebird_stmt_get_col()
455 XSQLVAR *var; in firebird_stmt_param_hook() local
477 XSQLVAR *var = &sqlda->sqlvar[i]; in firebird_stmt_param_hook() local
479 if ((var->aliasname_length && !strncasecmp(param->name, var->aliasname, in firebird_stmt_param_hook()
480 min(param->namelen, var->aliasname_length))) in firebird_stmt_param_hook()
481 || (var->sqlname_length && !strncasecmp(param->name, var->sqlname, in firebird_stmt_param_hook()
482 min(param->namelen, var->sqlname_length)))) { in firebird_stmt_param_hook()
495 var = &sqlda->sqlvar[param->paramno]; in firebird_stmt_param_hook()
505 if (var->sqlind) { in firebird_stmt_param_hook()
506 efree(var->sqlind); in firebird_stmt_param_hook()
508 var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); in firebird_stmt_param_hook()
509 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in firebird_stmt_param_hook()
518 *var->sqlind = 0; in firebird_stmt_param_hook()
520 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
527 return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, in firebird_stmt_param_hook()
537 var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); in firebird_stmt_param_hook()
538 var->sqldata = (void*)&Z_LVAL_P(param->parameter); in firebird_stmt_param_hook()
539 var->sqllen = sizeof(long); in firebird_stmt_param_hook()
543 var->sqltype = SQL_DOUBLE | (var->sqltype & 1); in firebird_stmt_param_hook()
544 var->sqldata = (void*)&Z_DVAL_P(param->parameter); in firebird_stmt_param_hook()
545 var->sqllen = sizeof(double); in firebird_stmt_param_hook()
551 switch (var->sqltype & ~1) { in firebird_stmt_param_hook()
564 var->sqltype = SQL_TEXT | (var->sqltype & 1); in firebird_stmt_param_hook()
565 var->sqldata = Z_STRVAL_P(param->parameter); in firebird_stmt_param_hook()
566 var->sqllen = Z_STRLEN_P(param->parameter); in firebird_stmt_param_hook()
571 if (~var->sqltype & 1) { in firebird_stmt_param_hook()
576 *var->sqlind = -1; in firebird_stmt_param_hook()