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

Function gen_based

src/gpre/c_cxx.cpp:778–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

C_CXX_actionFunction · 0.70

Calls 3

CPR_errorFunction · 0.85
MSC_popFunction · 0.85
alignFunction · 0.70

Tested by

no test coverage detected