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

Function gen_based

src/gpre/languages/ada.cpp:642–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640//
641
642static void gen_based( const act* action, int column)
643{
644 SSHORT datatype;
645 SCHAR s[512], s2[128];
646
647 bas* based_on = (bas*) action->act_object;
648 gpre_fld* field = based_on->bas_field;
649 TEXT* q = s;
650 const TEXT* p;
651
652 if (field->fld_array_info)
653 {
654 datatype = field->fld_array->fld_dtype;
655 sprintf(s, "array (");
656 for (q = s; *q; q++)
657 ;
658
659 // Print out the dimension part of the declaration
660 const dim* dimension = field->fld_array_info->ary_dimension;
661 for (SSHORT i = 1; i < field->fld_array_info->ary_dimension_count;
662 dimension = dimension->dim_next, i++)
663 {
664 sprintf(s2, "%s range %" SLONGFORMAT"..%" SLONGFORMAT",\n ",
665 LONG_DCL, dimension->dim_lower, dimension->dim_upper);
666 for (p = s2; *p; p++, q++)
667 *q = *p;
668 }
669
670 sprintf(s2, "%s range %" SLONGFORMAT"..%" SLONGFORMAT") of ",
671 LONG_DCL, dimension->dim_lower, dimension->dim_upper);
672 for (p = s2; *p; p++, q++)
673 *q = *p;
674 }
675 else
676 datatype = field->fld_dtype;
677
678 SSHORT length;
679
680 switch (datatype)
681 {
682 case dtype_short:
683 sprintf(s2, "%s", SHORT_DCL);
684 break;
685
686 case dtype_long:
687 sprintf(s2, "%s", LONG_DCL);
688 break;
689
690 case dtype_date:
691 case dtype_blob:
692 case dtype_quad:
693 sprintf(s2, "firebird.quad");
694 break;
695
696 case dtype_text:
697 length = field->fld_array_info ? field->fld_array->fld_length : field->fld_length;
698 if (field->fld_sub_type == 1)
699 {

Callers 1

ADA_actionFunction · 0.70

Calls 1

printaFunction · 0.70

Tested by

no test coverage detected