caller_in_ada.adb 1.25 KB
Newer Older
Maxime Perrotin's avatar
Maxime Perrotin committed
1
2
3
4
-- User implementation of the caller_in_ada function
-- This file will never be overwritten once edited and modified
-- Only the interface of functions is regenerated (in the .ads file)

5
with Text_IO; use Text_IO;
Maxime Perrotin's avatar
Maxime Perrotin committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

with interfaces;
use interfaces;

package body caller_in_ada is
        i1: asn1sccMyInteger := 0;
        i2: asn1SccMyInteger := 1;
        o1: asn1SccMyInteger;
        o2: asn1SccMyInteger;


        ---------------------------------------------------------
        -- Provided interface "pulse"
        ---------------------------------------------------------
        procedure pulse is
        begin
22
            Put_Line ("[Ada] Calling in Ada");
Maxime Perrotin's avatar
Maxime Perrotin committed
23
24

            RunDriver(i1, i2, o1, o2);
25
26
27
28
29
30
31
32
            Put ("[Ada] i1=");
            Put (asn1sccMyInteger'image(i1));
            Put (" i2=");
            Put (asn1sccMyInteger'image(i2));
            Put (" o1=");
            Put (asn1sccMyInteger'image(o1));
            Put (" o2=");
            Put (asn1sccMyInteger'image(o2));
Maxime Perrotin's avatar
Maxime Perrotin committed
33
            if i1 /= o2 or i2 /= o1 then
34
35
                Put_Line("[...ERROR!");
            else Put_Line("...OK");
Maxime Perrotin's avatar
Maxime Perrotin committed
36
37
38
39
40
41
            end if;
            i1 := i1 + 1; 
            i2 := i2 + 1;

        end pulse;
        begin
42
            Put_line("[Ada] startup");
Maxime Perrotin's avatar
Maxime Perrotin committed
43
44

end caller_in_ada;