MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / MET_context_field

Function MET_context_field

src/gpre/boot/gpre_meta_boot.cpp:50–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 */
49
50gpre_fld* MET_context_field( gpre_ctx* context, const char* string)
51{
52 SCHAR name[NAME_SIZE];
53
54 if (context->ctx_relation) {
55 return (MET_field(context->ctx_relation, string));
56 }
57
58 if (!context->ctx_procedure) {
59 return NULL;
60 }
61
62 strcpy(name, string);
63 gpre_prc* procedure = context->ctx_procedure;
64
65 // At this point the procedure should have been scanned, so all
66 // its fields are in the symbol table.
67
68 gpre_fld* field = NULL;
69 for (gpre_sym* symbol = HSH_lookup(name); symbol; symbol = symbol->sym_homonym)
70 {
71 if (symbol->sym_type == SYM_field && (field = (gpre_fld*) symbol->sym_object) &&
72 field->fld_procedure == procedure)
73 {
74 return field;
75 }
76 }
77
78 return field;
79}
80
81
82/*____________________________________________________________

Callers 2

SQE_fieldFunction · 0.85
resolveFunction · 0.85

Calls 2

MET_fieldFunction · 0.85
HSH_lookupFunction · 0.85

Tested by

no test coverage detected