~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/ic/test/erl_client_c_server_proto_SUITE_data/callbacks.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * %CopyrightBegin%
 
3
 * 
 
4
 * Copyright Ericsson AB 2004-2011. All Rights Reserved.
 
5
 * 
 
6
 * The contents of this file are subject to the Erlang Public License,
 
7
 * Version 1.1, (the "License"); you may not use this file except in
 
8
 * compliance with the License. You should have received a copy of the
 
9
 * Erlang Public License along with this software. If not, it can be
 
10
 * retrieved online at http://www.erlang.org/.
 
11
 * 
 
12
 * Software distributed under the License is distributed on an "AS IS"
 
13
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
 * the License for the specific language governing rights and limitations
 
15
 * under the License.
 
16
 * 
 
17
 * %CopyrightEnd%
 
18
 *
 
19
 */
 
20
#include <stdio.h>
 
21
#include <stdlib.h>
 
22
#ifndef __WIN32__
 
23
#  include <unistd.h>
 
24
#endif
 
25
#include <string.h>
 
26
#include <ctype.h>
 
27
#include <ic.h>
 
28
#include <erl_interface.h>
 
29
#include <ei.h>
 
30
#include "m_i__s.h"
 
31
 
 
32
 
 
33
 
 
34
/* OK */
 
35
 
 
36
void my_void_test(CORBA_Object oe_obj, 
 
37
                  CORBA_Environment *oe_env)
 
38
{
 
39
    /* printf("void test !\n"); */
 
40
}
 
41
 
 
42
m_i_void_test__rs* m_i_void_test__cb(CORBA_Object oe_obj, 
 
43
                                     CORBA_Environment *oe_env)
 
44
{
 
45
    return (m_i_void_test__rs*) (my_void_test);
 
46
}
 
47
 
 
48
 
 
49
 
 
50
/* OK */
 
51
 
 
52
void my_long_test(CORBA_Object oe_obj, 
 
53
                  long* a, 
 
54
                  long* b, 
 
55
                  long* c, 
 
56
                  CORBA_Environment *oe_env)
 
57
{
 
58
    /* printf("long test !\n"); */
 
59
}
 
60
 
 
61
 
 
62
m_i_long_test__rs* m_i_long_test__cb(CORBA_Object oe_obj, 
 
63
                                     long* a, 
 
64
                                     long* b, 
 
65
                                     long* c, 
 
66
                                     CORBA_Environment *oe_env)
 
67
 
68
    *a = *b;
 
69
    *c = *b;
 
70
    return (m_i_long_test__rs*) (my_long_test);
 
71
}
 
72
 
 
73
/* OK */
 
74
 
 
75
void my_longlong_test(CORBA_Object oe_obj, 
 
76
                      CORBA_long_long* a, 
 
77
                      CORBA_long_long* b, 
 
78
                      CORBA_long_long* c, 
 
79
                      CORBA_Environment *oe_env)
 
80
{
 
81
    /* printf("long test !\n"); */
 
82
}
 
83
 
 
84
m_i_longlong_test__rs* m_i_longlong_test__cb(CORBA_Object oe_obj, 
 
85
                                             CORBA_long_long* a, 
 
86
                                             CORBA_long_long* b, 
 
87
                                             CORBA_long_long* c, 
 
88
                                             CORBA_Environment *oe_env)
 
89
 
90
    *a = *b;
 
91
    *c = *b;
 
92
    return (m_i_longlong_test__rs*) (my_longlong_test);
 
93
}
 
94
 
 
95
/* OK */
 
96
void my_ulong_test(CORBA_Object oe_obj, 
 
97
                   unsigned long* a, 
 
98
                   unsigned long* b, 
 
99
                   unsigned long* c, 
 
100
                   CORBA_Environment *oe_env)
 
101
{
 
102
    /* printf("ulong test !\n"); */
 
103
}
 
104
 
 
105
m_i_ulong_test__rs* m_i_ulong_test__cb(CORBA_Object oe_obj, 
 
106
                                       unsigned long* a, 
 
107
                                       unsigned long* b, 
 
108
                                       unsigned long* c, 
 
109
                                       CORBA_Environment *oe_env)
 
110
{
 
111
    *a = *b;
 
112
    *c = *b;
 
113
    return (m_i_ulong_test__rs*) (my_ulong_test);
 
114
}
 
115
 
 
116
/* OK */
 
117
void my_ulonglong_test(CORBA_Object oe_obj,
 
118
                       CORBA_unsigned_long_long* a,
 
119
                       CORBA_unsigned_long_long* b,
 
120
                       CORBA_unsigned_long_long* c,
 
121
                       CORBA_Environment *oe_env)
 
122
{
 
123
    /* printf("ulong test !\n"); */
 
124
}
 
125
 
 
126
m_i_ulonglong_test__rs* m_i_ulonglong_test__cb(CORBA_Object oe_obj,
 
127
                                               CORBA_unsigned_long_long* a,
 
128
                                               CORBA_unsigned_long_long* b,
 
129
                                               CORBA_unsigned_long_long* c,
 
130
                                               CORBA_Environment *oe_env)
 
131
{
 
132
    *a = *b;
 
133
    *c = *b;
 
134
    return (m_i_ulonglong_test__rs*) (my_ulonglong_test);
 
135
}
 
136
 
 
137
m_i_ushort_test__rs* m_i_ushort_test__cb(CORBA_Object oe_obj,
 
138
                                         unsigned short* a,
 
139
                                         unsigned short* b,
 
140
                                         unsigned short* c,
 
141
                                         CORBA_Environment *oe_env)
 
142
{
 
143
    *a = *b;
 
144
    *c = *b;
 
145
    return (m_i_ushort_test__rs*) NULL;
 
146
}
 
147
 
 
148
 
 
149
/* OK */
 
150
void my_double_test(CORBA_Object oe_obj,
 
151
                    double* a,
 
152
                    double* b,
 
153
                    double* c,
 
154
                    CORBA_Environment *oe_env)
 
155
{
 
156
    /* printf("double test !\n"); */
 
157
}
 
158
 
 
159
m_i_double_test__rs* m_i_double_test__cb(CORBA_Object oe_obj,
 
160
                                         double* a,
 
161
                                         double* b,
 
162
                                         double* c,
 
163
                                         CORBA_Environment *oe_env)
 
164
{
 
165
    *a = *b;
 
166
    *c = *b;
 
167
    return (m_i_double_test__rs*) (my_double_test);
 
168
}
 
169
 
 
170
/* OK */
 
171
m_i_char_test__rs* m_i_char_test__cb(CORBA_Object oe_obj,
 
172
                                     char* a,
 
173
                                     char* b,
 
174
                                     char* c,
 
175
                                     CORBA_Environment *oe_env)
 
176
{
 
177
    m_i_char_test__rs* rs = NULL; 
 
178
 
 
179
    *a = *b;
 
180
    *c = *b;
 
181
    return rs;
 
182
}
 
183
 
 
184
 
 
185
/* OK */
 
186
m_i_wchar_test__rs* m_i_wchar_test__cb(CORBA_Object oe_obj,
 
187
                                       CORBA_wchar* a,
 
188
                                       CORBA_wchar* b,
 
189
                                       CORBA_wchar* c,
 
190
                                       CORBA_Environment *oe_env)
 
191
{
 
192
    m_i_wchar_test__rs* rs = NULL; 
 
193
 
 
194
    *a = *b;
 
195
    *c = *b;
 
196
    return rs;
 
197
}
 
198
 
 
199
/* OK */
 
200
m_i_octet_test__rs* m_i_octet_test__cb(CORBA_Object oe_obj,
 
201
                                       char* a,
 
202
                                       char* b,
 
203
                                       char* c,
 
204
                                       CORBA_Environment *oe_env)
 
205
{
 
206
    m_i_octet_test__rs* rs = NULL; 
 
207
 
 
208
    *a = *b;
 
209
    *c = *b;
 
210
    return rs;
 
211
}
 
212
 
 
213
/* OK */
 
214
m_i_bool_test__rs* m_i_bool_test__cb(CORBA_Object oe_obj,
 
215
                                     CORBA_boolean* a,
 
216
                                     CORBA_boolean* b,
 
217
                                     CORBA_boolean* c,
 
218
                                     CORBA_Environment *oe_env)
 
219
{
 
220
    m_i_bool_test__rs* rs = NULL; 
 
221
 
 
222
    *a = *b;
 
223
    *c = *b;
 
224
    return rs;
 
225
}
 
226
 
 
227
/* OK */
 
228
void my_struct_test(CORBA_Object oe_obj,
 
229
                    m_b* a,
 
230
                    m_b* b,
 
231
                    m_b* c,
 
232
                    CORBA_Environment *oe_env)
 
233
{
 
234
    /* printf("struct test !\n"); */
 
235
}
 
236
 
 
237
m_i_struct_test__rs* m_i_struct_test__cb(CORBA_Object oe_obj,
 
238
                                         m_b* a,
 
239
                                         m_b* b,
 
240
                                         m_b* c,
 
241
                                         CORBA_Environment *oe_env)
 
242
{
 
243
    *a = *b;
 
244
    *c = *b;
 
245
    return (m_i_struct_test__rs*) (my_struct_test); 
 
246
}
 
247
 
 
248
/* OK */
 
249
m_i_struct2_test__rs* m_i_struct2_test__cb(CORBA_Object oe_obj,
 
250
                                           m_es* a,
 
251
                                           m_es* b,
 
252
                                           m_es* c,
 
253
                                           CORBA_Environment *oe_env)
 
254
{
 
255
    m_i_struct2_test__rs* rs = NULL; 
 
256
 
 
257
    *a = *b;
 
258
    *c = *b;
 
259
    return rs;
 
260
}
 
261
 
 
262
/* OK */
 
263
/* XXX Commented out
 
264
m_i_struct3_test__rs* m_i_struct3_test__cb(CORBA_Object oe_obj,
 
265
                                           m_simple* a,
 
266
                                           m_simple* b,
 
267
                                           m_simple* c,
 
268
                                           CORBA_Environment *oe_env)
 
269
{
 
270
  m_i_struct3_test__rs* rs = NULL; 
 
271
  *a = *b;
 
272
  *c = *b;
 
273
  return rs;
 
274
}
 
275
*/
 
276
 
 
277
/* OK */
 
278
m_i_seq1_test__rs* m_i_seq1_test__cb(CORBA_Object oe_obj,
 
279
                                     m_bseq** a,
 
280
                                     m_bseq* b,
 
281
                                     m_bseq** c,
 
282
                                     CORBA_Environment *oe_env)
 
283
{
 
284
    m_i_seq1_test__rs* rs = NULL; 
 
285
 
 
286
    *a = b;
 
287
    *c = b;
 
288
    return rs;
 
289
}
 
290
 
 
291
 
 
292
/* OK */
 
293
m_i_seq2_test__rs* m_i_seq2_test__cb(CORBA_Object oe_obj,
 
294
                                     m_aseq** a,
 
295
                                     m_aseq* b,
 
296
                                     m_aseq** c,
 
297
                                     CORBA_Environment *oe_env)
 
298
{
 
299
    m_i_seq2_test__rs* rs = NULL; 
 
300
  
 
301
    *a = b;
 
302
    *c = b;
 
303
    return rs;
 
304
}
 
305
 
 
306
/* OK */
 
307
m_i_seq3_test__rs* m_i_seq3_test__cb(CORBA_Object oe_obj,
 
308
                                     m_lseq** a,
 
309
                                     m_lseq* b,
 
310
                                     m_lseq** c,
 
311
                                     CORBA_Environment *oe_env)
 
312
{
 
313
    m_i_seq3_test__rs* rs = NULL; 
 
314
 
 
315
    *a = b;
 
316
    *c = b;
 
317
    return rs;
 
318
}
 
319
 
 
320
/* OK */
 
321
m_i_seq4_test__rs* m_i_seq4_test__cb(CORBA_Object oe_obj,
 
322
                                     m_ssstr3** a,
 
323
                                     m_ssstr3* b,
 
324
                                     m_ssstr3** c,
 
325
                                     CORBA_Environment *oe_env)
 
326
{
 
327
    m_i_seq4_test__rs* rs = NULL; 
 
328
 
 
329
    *a = b;
 
330
    *c = b;
 
331
    return rs;
 
332
}
 
333
 
 
334
/* OK */
 
335
m_i_seq5_test__rs* m_i_seq5_test__cb(CORBA_Object oe_obj,
 
336
                                     m_ssarr3** a,
 
337
                                     m_ssarr3* b,
 
338
                                     m_ssarr3** c,
 
339
                                     CORBA_Environment *oe_env)
 
340
{
 
341
    m_i_seq5_test__rs* rs = NULL; 
 
342
 
 
343
    *a = b;
 
344
    *c = b;
 
345
    return rs;
 
346
}
 
347
 
 
348
/* OK */
 
349
m_i_array1_test__rs* m_i_array1_test__cb(CORBA_Object oe_obj,
 
350
                                         m_arr1 a,
 
351
                                         m_arr1 b,
 
352
                                         m_arr1 c,
 
353
                                         CORBA_Environment *oe_env)
 
354
{
 
355
    int i;
 
356
    m_i_array1_test__rs* rs = NULL; 
 
357
  
 
358
    for (i = 0; i < 500; i++) {
 
359
        a[i] = b[i]; 
 
360
        c[i] = b[i];
 
361
    }
 
362
    return rs;
 
363
}
 
364
 
 
365
/* OK */
 
366
m_i_array2_test__rs* m_i_array2_test__cb(CORBA_Object oe_obj,
 
367
                                         m_dd a,
 
368
                                         m_dd b,
 
369
                                         m_dd c,
 
370
                                         CORBA_Environment *oe_env)
 
371
{
 
372
    int i,j;
 
373
    m_i_array2_test__rs* rs = NULL; 
 
374
  
 
375
    for (i = 0; i < 2; i++)
 
376
        for (j = 0; j < 3; j++) {
 
377
            a[i][j] = b[i][j];
 
378
            c[i][j] = b[i][j];
 
379
        }
 
380
    return rs;
 
381
}
 
382
 
 
383
 
 
384
/* OK */
 
385
m_i_enum_test__rs* m_i_enum_test__cb(CORBA_Object oe_obj,
 
386
                                     m_fruit* a,
 
387
                                     m_fruit* b,
 
388
                                     m_fruit* c,
 
389
                                     CORBA_Environment *oe_env)
 
390
{
 
391
    m_i_enum_test__rs* rs = NULL; 
 
392
  
 
393
    *a = *b;
 
394
    *c = *b;
 
395
    return rs;
 
396
}
 
397
 
 
398
/* OK */
 
399
m_i_string1_test__rs* m_i_string1_test__cb(CORBA_Object oe_obj,
 
400
                                           char ** a,
 
401
                                           char * b,
 
402
                                           char ** c,
 
403
                                           CORBA_Environment *oe_env)
 
404
{
 
405
    m_i_string1_test__rs* rs = NULL; 
 
406
 
 
407
    /*printf("\nString in ------> %s\n\n",b);*/
 
408
    *a = b;
 
409
    *c = b;
 
410
    return rs;
 
411
}
 
412
 
 
413
/* OK */
 
414
m_i_string2_test__rs* m_i_string2_test__cb(CORBA_Object oe_obj,
 
415
                                           m_sseq** a,
 
416
                                           m_sseq* b,
 
417
                                           m_sseq** c,
 
418
                                           CORBA_Environment *oe_env)
 
419
{
 
420
    m_i_string2_test__rs* rs = NULL; 
 
421
 
 
422
    *a = b;
 
423
    *c = b;
 
424
    return rs;
 
425
}
 
426
 
 
427
/* OK */
 
428
m_i_string3_test__rs* m_i_string3_test__cb(CORBA_Object oe_obj,
 
429
                                           char ** a,
 
430
                                           char * b,
 
431
                                           char ** c,
 
432
                                           CORBA_Environment *oe_env)
 
433
{
 
434
    m_i_string3_test__rs* rs = NULL; 
 
435
 
 
436
    *a = b;
 
437
    *c = b;
 
438
    return rs;
 
439
}
 
440
 
 
441
m_i_string4_test__rs* m_i_string4_test__cb(CORBA_Object oe_obj,
 
442
                                           m_strRec** a,
 
443
                                           m_strRec* b,
 
444
                                           m_strRec** c,
 
445
                                           CORBA_Environment *oe_env)
 
446
{
 
447
    *a = b;
 
448
    *c = b;
 
449
 
 
450
    return (m_i_string4_test__rs*) NULL; 
 
451
}
 
452
 
 
453
/* OK */
 
454
m_i_wstring1_test__rs* m_i_wstring1_test__cb(CORBA_Object oe_obj,
 
455
                                             CORBA_wchar ** a,
 
456
                                             CORBA_wchar * b,
 
457
                                             CORBA_wchar ** c,
 
458
                                             CORBA_Environment *oe_env)
 
459
{
 
460
    int tmp;
 
461
    m_i_wstring1_test__rs* rs = NULL; 
 
462
 
 
463
    /*printf("\nString in ------> %s\n\n",b);*/
 
464
 
 
465
    for(tmp = 0; tmp < 5; tmp++) 
 
466
        fprintf(stderr,"\np[%d] = %ld\n", tmp, b[tmp]);
 
467
    *a = b;
 
468
    *c = b;
 
469
    return rs;
 
470
}
 
471
 
 
472
 
 
473
/* OK */
 
474
m_i_pid_test__rs* m_i_pid_test__cb(CORBA_Object oe_obj,
 
475
                                   erlang_pid* a,
 
476
                                   erlang_pid* b,
 
477
                                   erlang_pid* c,
 
478
                                   CORBA_Environment *oe_env)
 
479
{
 
480
    m_i_pid_test__rs* rs = NULL; 
 
481
 
 
482
    *a = *b;
 
483
    *c = *b;
 
484
    return rs;
 
485
}
 
486
 
 
487
/* OK */
 
488
m_i_port_test__rs* m_i_port_test__cb(CORBA_Object oe_obj,
 
489
                                     erlang_port* a,
 
490
                                     erlang_port* b,
 
491
                                     erlang_port* c,
 
492
                                     CORBA_Environment *oe_env)
 
493
{
 
494
    m_i_port_test__rs* rs = NULL; 
 
495
 
 
496
    strcpy((*a).node,(*b).node);
 
497
    (*a).id = (*b).id;
 
498
    (*a).creation = 0;
 
499
 
 
500
    strcpy((*c).node,(*b).node);
 
501
    (*c).id = (*b).id;
 
502
    (*c).creation = 0;
 
503
    return rs;
 
504
}
 
505
 
 
506
/* OK */
 
507
m_i_ref_test__rs* m_i_ref_test__cb(CORBA_Object oe_obj,
 
508
                                   erlang_ref* a,
 
509
                                   erlang_ref* b,
 
510
                                   erlang_ref* c,
 
511
                                   CORBA_Environment *oe_env)
 
512
{
 
513
 
 
514
    m_i_ref_test__rs* rs = NULL; 
 
515
 
 
516
    strcpy((*a).node,(*b).node);
 
517
    /*(*a).id = (*b).id;*/
 
518
    (*a).len = (*b).len;
 
519
    (*a).n[0] = (*b).n[0];
 
520
    (*a).n[1] = (*b).n[1];
 
521
    (*a).n[2] = (*b).n[2];
 
522
    (*a).creation = 0;
 
523
 
 
524
    strcpy((*c).node,(*b).node);
 
525
    /*(*c).id = (*b).id;*/
 
526
    (*c).len = (*b).len;
 
527
    (*c).n[0] = (*b).n[0];
 
528
    (*c).n[1] = (*b).n[1];
 
529
    (*c).n[2] = (*b).n[2];
 
530
    (*c).creation = 0;
 
531
    return rs;
 
532
}
 
533
 
 
534
/* OK */
 
535
m_i_term_test__rs* m_i_term_test__cb(CORBA_Object oe_obj,
 
536
                                     ETERM** a,
 
537
                                     ETERM** b,
 
538
                                     ETERM** c,
 
539
                                     CORBA_Environment *oe_env)
 
540
{
 
541
    m_i_term_test__rs* rs = NULL; 
 
542
 
 
543
    *a = *b;
 
544
    *c = *b;
 
545
    return rs;
 
546
}
 
547
 
 
548
m_i_typedef_test__rs* m_i_typedef_test__cb(CORBA_Object oe_obj,
 
549
                                           long* a,
 
550
                                           ETERM** b,
 
551
                                           erlang_port* c,
 
552
                                           ETERM** d ,
 
553
                                           erlang_port* e,
 
554
                                           CORBA_Environment *oe_env)
 
555
{
 
556
    m_i_typedef_test__rs* rs = NULL; 
 
557
  
 
558
    *d = *b;
 
559
    strcpy((*e).node,(*c).node);
 
560
    (*e).id = (*c).id;
 
561
    (*e).creation = 0;
 
562
    *a = 4711;
 
563
    return rs;
 
564
}
 
565
 
 
566
/* OK */
 
567
m_i_inline_sequence_test__rs* m_i_inline_sequence_test__cb(
 
568
    CORBA_Object oe_obj,
 
569
    m_s** a,
 
570
    m_s* b,
 
571
    m_s** c,
 
572
    CORBA_Environment *oe_env)
 
573
{
 
574
    m_i_inline_sequence_test__rs* rs = NULL; 
 
575
 
 
576
    *a = b;
 
577
    *c = b;
 
578
    return rs;
 
579
}
 
580
 
 
581
/* OK */
 
582
m_i_term_sequence_test__rs* m_i_term_sequence_test__cb(
 
583
    CORBA_Object oe_obj,
 
584
    m_etseq** a,
 
585
    m_etseq* b,
 
586
    m_etseq** c,
 
587
    CORBA_Environment *oe_env)
 
588
{
 
589
    m_i_term_sequence_test__rs* rs = NULL; 
 
590
 
 
591
    *a = b;
 
592
    *c = b; 
 
593
    return rs;
 
594
}
 
595
 
 
596
 
 
597
/* OK */
 
598
m_i_term_struct_test__rs* m_i_term_struct_test__cb(CORBA_Object oe_obj,
 
599
                                                   m_et* a,
 
600
                                                   m_et* b,
 
601
                                                   m_et* c,
 
602
                                                   CORBA_Environment *oe_env)
 
603
{
 
604
    m_i_term_struct_test__rs* rs = NULL; 
 
605
  
 
606
    *a = *b;
 
607
    *c = *b;
 
608
    return rs;
 
609
}
 
610