aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ic/test/erl_client_c_server_SUITE_data/erl_c_test.idl
blob: 6ed28f0822a5d03c57f5dbef6a0353cd888d7c01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// %CopyrightBegin%
// 
// Copyright Ericsson AB 2002-2016. All Rights Reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// 
// %CopyrightEnd%

#include "erlang.idl"


const short TestConst = 1;

module m {

  const short TestConst = 2;

  struct b {
    long l;
    char c;
  }; 

  struct simple {
    long l;
    b    b_t;
  };

  enum fruit {orange, banana, apple, peach, pear};

  typedef sequence<long> lseq;

  typedef sequence<b> bseq;

  struct a {
    long l;
    bseq y;
    double d;
  };

  typedef sequence<a> aseq;

  typedef sequence<string> sseq;
  typedef string str;
  typedef long myLong;

  typedef long arr1[500], dd[2][3];

  typedef erlang::term apa;
  typedef erlang::port banan;

  typedef sequence<erlang::term> etseq;

  struct s {
    long l;
    sequence<long> sl;
  };

  struct es {
    fruit f;
    myLong l;
  };

  struct et {
    erlang::term e;
    long l;
  };


  typedef sequence<char> str1;
  typedef string<12> str2;
  typedef char str3[3];  	

  typedef sequence<string> sstr3;  // sequence of string
  typedef sequence<sstr3> ssstr3;  // sequence of sequences of strings

  typedef long  arr3[3];           // array of long
  typedef sequence<arr3> sarr3;    // sequence of array
  typedef sequence<sarr3> ssarr3;  // sequence of sequnces of arrays of strings
    
 struct strRec{
    boolean bb;
    string str4;
    long str7[3][2];
    sequence<char> str5; 
    string<12> str6;
    str3 str8;
    str2 str9;
    str1 str10; 	
  };


  struct dyn {
    long l;
    sequence<long> sl;
  };
  typedef dyn arr2[1][2];


  interface i {

    const short TestConst = 3;	

    //arr2 suck(in arr2 x, out arr2 y );

    ///////////////////////////////// attribute long l;

    // simple types
    void void_test();
    long long_test(in long a, out long a1);
    long long longlong_test(in long long a, out long long a1);	
    unsigned short ushort_test(in unsigned short a, out unsigned short a1);
    unsigned long ulong_test(in unsigned long a, out unsigned long a1);
    unsigned long long ulonglong_test(in unsigned long long a, out unsigned long long a1);
    double double_test(in double a, out double a1);
    char char_test(in char a, out char a1);
    wchar wchar_test(in wchar a, out wchar a1);
    octet octet_test(in octet a, out octet a1);
    boolean bool_test(in boolean a, out boolean a1);

    // Seq. and struct tests
    b struct_test(in b a, out b a1);
    es struct2_test(in es a, out es a1);
    //simple struct3_test(in simple x, out simple y);	
    bseq seq1_test(in bseq a, out bseq a1);
    aseq seq2_test(in aseq a, out aseq a1);
    lseq seq3_test(in lseq a, out lseq a1);
    ssstr3 seq4_test(in ssstr3 a, out ssstr3 a1);
    ssarr3 seq5_test(in ssarr3 a, out ssarr3 a1);

    // Array tests
    arr1 array1_test(in arr1 a, out arr1 a1);
    dd array2_test(in dd a, out dd a1);

    // enum test
    fruit enum_test(in fruit a, out fruit a1);

    // string tests
    string string1_test(in string a, out string a1);
    wstring wstring1_test(in wstring a, out wstring a1);
    sseq string2_test(in sseq a, out sseq a1);
    str string3_test(in str a, out str a1);
    strRec string4_test(in strRec a, out strRec a1);

    // Special erlang types
    erlang::pid pid_test(in erlang::pid a, out erlang::pid a1);
    erlang::port port_test(in erlang::port a, out erlang::port a1);
    erlang::ref ref_test(in erlang::ref a, out erlang::ref a1);
    erlang::term term_test(in erlang::term a, out erlang::term a1);
    
    // typedef test
    long typedef_test(in apa a, in banan b, out apa a1, out banan b1);

    // inlined seq. test
    s inline_sequence_test(in s a, out s a1);

    // term seq. test
    etseq term_sequence_test(in etseq a, out etseq a1);
    // term struct test
    et term_struct_test(in et a, out et a1);
   
  };

};