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

Function gen_based

src/gpre/obj_cxx.cpp:787–916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785//
786
787static void gen_based( const act* action, int column)
788{
789 USHORT datatype;
790 SLONG length = -1;
791
792 align(column);
793 bas* based_on = (bas*) action->act_object;
794 const gpre_fld* field = based_on->bas_field;
795
796 if (based_on->bas_flags & BAS_segment)
797 {
798 datatype = gpreGlob.sw_cstring ? dtype_cstring : dtype_text;
799 if (!(length = field->fld_seg_length))
800 length = 256;
801 if (datatype == dtype_cstring)
802 length++;
803 }
804 else if (field->fld_array_info)
805 datatype = field->fld_array_info->ary_dtype;
806 else
807 datatype = field->fld_dtype;
808
809 switch (datatype)
810 {
811 case dtype_short:
812 fprintf(gpreGlob.out_file, "short");
813 break;
814
815 case dtype_long:
816 fprintf(gpreGlob.out_file, DCL_LONG);
817 break;
818
819 case dtype_quad:
820 fprintf(gpreGlob.out_file, DCL_QUAD);
821 break;
822
823 // Begin date/time/timestamp
824 case dtype_sql_date:
825 fprintf(gpreGlob.out_file, "ISC_DATE");
826 break;
827
828 case dtype_sql_time:
829 fprintf(gpreGlob.out_file, "ISC_TIME");
830 break;
831
832 case dtype_timestamp:
833 fprintf(gpreGlob.out_file, "ISC_TIMESTAMP");
834 break;
835 // End date/time/timestamp
836
837 case dtype_int64:
838 fprintf(gpreGlob.out_file, "ISC_INT64");
839 break;
840
841 case dtype_blob:
842 fprintf(gpreGlob.out_file, "ISC_QUAD");
843 break;
844

Callers 1

OBJ_CXX_actionFunction · 0.70

Calls 3

CPR_errorFunction · 0.85
MSC_popFunction · 0.85
alignFunction · 0.70

Tested by

no test coverage detected