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

Function make_port

src/gpre/obj_cxx.cpp:3704–3795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3702//
3703
3704static void make_port(const gpre_port* port, int column)
3705{
3706 printa(column, "struct fb_%d_struct {", port->por_ident);
3707
3708 for (const ref* reference = port->por_references; reference; reference = reference->ref_next)
3709 {
3710 align(column + INDENT);
3711 const gpre_fld* field = reference->ref_field;
3712 const TEXT* name;
3713 const gpre_sym* symbol = field->fld_symbol;
3714 if (symbol)
3715 name = symbol->sym_string;
3716 else
3717 name = "<expression>";
3718 if (reference->ref_value && (reference->ref_flags & REF_array_elem))
3719 field = field->fld_array;
3720 int fld_len = 0;
3721 const TEXT* dtype;
3722
3723 switch (field->fld_dtype)
3724 {
3725 case dtype_short:
3726 dtype = "short";
3727 break;
3728
3729 case dtype_long:
3730 dtype = DCL_LONG;
3731 break;
3732
3733 case dtype_cstring:
3734 case dtype_text:
3735 dtype = "char ";
3736 if (field->fld_sub_type != 1 || field->fld_length > 1)
3737 fld_len = field->fld_length;
3738 break;
3739
3740 case dtype_quad:
3741 dtype = DCL_QUAD;
3742 break;
3743
3744 // Begin date/time/timestamp
3745 case dtype_sql_date:
3746 dtype = "ISC_DATE";
3747 break;
3748
3749 case dtype_sql_time:
3750 dtype = "ISC_TIME";
3751 break;
3752
3753 case dtype_timestamp:
3754 dtype = "ISC_TIMESTAMP";
3755 break;
3756 // End date/time/timestamp
3757
3758 case dtype_int64:
3759 dtype = "ISC_INT64";
3760 break;
3761

Callers 2

gen_functionFunction · 0.70
gen_routineFunction · 0.70

Calls 4

CPR_errorFunction · 0.85
printaFunction · 0.70
alignFunction · 0.70
snprintfFunction · 0.50

Tested by

no test coverage detected