static void dump_vars(struct scope_info *scope) { struct var_info *var_info; if (scope->handle != -1) dump_ref(scope->handle); else { scope->handle = dump_store(); if (scope->outer) dump_op(fop_DOTTED_LIST1); else dump_op(fop_LIST1); dump_vector_header(scope->nvars); for (var_info=scope->vars; var_info != NULL; var_info=var_info->next) { int loc_info = var_info->offset << 2; if (var_info->indirect) loc_info |= 2; if (var_info->argument) loc_info |= 1; dump_op(fop_VECTOR2); dump_symbol(var_info->var->symbol); dump_integer(loc_info); } if (scope->outer) dump_vars(scope->outer); } }
void Dump_specific_section( uint sect, const uint_8 *data, uint len ) /*******************************************************************/ { sort_tables(); switch( sect ) { case DW_DEBUG_ABBREV: dump_abbrevs( data, len ); break; case DW_DEBUG_INFO: dump_info( data, len ); break; case DW_DEBUG_ARANGES: dump_aranges( data, len ); break; case DW_DEBUG_LINE: Dump_lines( data, len ); break; case DW_DEBUG_REF: dump_ref( data, len ); break; case DW_DEBUG_PUBNAMES: dump_pubnames( data, len ); break; default: dump_hex( data, len ); break; } }
static void dump_symbol(struct symbol *symbol) { if (symbol->handle != -1) dump_ref(symbol->handle); else { symbol->handle = implicit_store(); dump_string_guts(fop_SHORT_SYMBOL, fop_SYMBOL, (char *)symbol->name, strlen((char *)symbol->name)); } }
int main(void) { OCI_Connection *cn; OCI_Statement *st; OCI_Resultset *rs; OCI_Ref *ref; if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT)) return EXIT_FAILURE; cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT); st = OCI_StatementCreate(cn); OCI_ExecuteStmt(st, "select ref(e) from table_obj e"); rs = OCI_GetResultset(st); printf("\n\n=> fetch refs from object table\n\n"); while (OCI_FetchNext(rs)) { dump_ref(OCI_GetRef(rs, 1)); } printf("\n\n=> bind a local ref object to a PL/SQL statement\n\n"); ref = OCI_RefCreate(cn, OCI_TypeInfoGet(cn, "ARTICLE_T", OCI_TIF_TYPE)); OCI_Prepare(st, "begin " " select ref(e) into :r from table_obj e where e.id = 1; " "end; "); OCI_BindRef(st, ":r", ref); OCI_Execute(st); dump_ref(ref); OCI_RefFree(ref); OCI_Cleanup(); return EXIT_SUCCESS; }