2
* CORBA C language mapping tests
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2, or (at your option) any
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
* Author: Phil Dawes <philipd@users.sourceforge.net>
22
#include "everything.h"
23
#include "constants.h"
28
SequenceServer_opStrSeq(PortableServer_Servant _servant,
29
const test_StrSeq * inArg,
30
test_StrSeq * inoutArg,
31
test_StrSeq ** outArg,
32
CORBA_Environment * ev) {
35
for (i=0;i<inArg->_length;i++){
36
g_assert(strcmp(inArg->_buffer[i],constants_SEQ_STRING_IN[i]) == 0);
39
for (i=0;i<inoutArg->_length;i++){
40
g_assert(strcmp(inoutArg->_buffer[i],constants_SEQ_STRING_INOUT_IN[i]) == 0);
43
if (CORBA_sequence_get_release (inoutArg))
44
CORBA_free(inoutArg->_buffer);
45
inoutArg->_buffer = CORBA_sequence_CORBA_string_allocbuf(2);
46
inoutArg->_length = 2;
47
CORBA_sequence_set_release(inoutArg, CORBA_TRUE);
49
for (i=0;i<inoutArg->_length;i++)
50
inoutArg->_buffer[i] = CORBA_string_dup(constants_SEQ_STRING_INOUT_OUT[i]);
52
*outArg = CORBA_sequence_CORBA_string__alloc();
53
(*outArg)->_buffer = CORBA_sequence_CORBA_string_allocbuf(2);
54
(*outArg)->_length = 2;
55
CORBA_sequence_set_release(*outArg, CORBA_TRUE);
57
for (i=0;i<(*outArg)->_length;i++)
58
(*outArg)->_buffer[i] = CORBA_string_dup(constants_SEQ_STRING_OUT[i]);
61
retn = CORBA_sequence_CORBA_string__alloc();
62
retn->_buffer = CORBA_sequence_CORBA_string_allocbuf(2);
64
CORBA_sequence_set_release(retn, CORBA_TRUE);
66
for (i=0;i<retn->_length;i++)
67
retn->_buffer[i] = CORBA_string_dup(constants_SEQ_STRING_RETN[i]);
73
test_BoundedStructSeq *
74
SequenceServer_opBoundedStructSeq(PortableServer_Servant _servant,
75
const test_BoundedStructSeq * inArg,
76
test_BoundedStructSeq * inoutArg,
77
test_BoundedStructSeq ** outArg,
78
CORBA_Environment * ev){
79
test_BoundedStructSeq *retn;
81
for (i=0;i<inArg->_length;i++){
82
g_assert(strcmp(inArg->_buffer[i].a.a,constants_SEQ_STRING_IN[i]) == 0);
85
for (i=0;i<inoutArg->_length;i++){
86
g_assert(strcmp(inoutArg->_buffer[i].a.a,constants_SEQ_STRING_INOUT_IN[i]) == 0);
89
if (CORBA_sequence_get_release (inoutArg))
90
CORBA_free(inoutArg->_buffer);
91
inoutArg->_buffer = CORBA_sequence_test_CompoundStruct_allocbuf(2);
92
inoutArg->_length = 2;
93
CORBA_sequence_set_release(inoutArg, CORBA_TRUE);
95
for (i=0;i<inoutArg->_length;i++)
96
inoutArg->_buffer[i].a.a = CORBA_string_dup(constants_SEQ_STRING_INOUT_OUT[i]);
98
*outArg = CORBA_sequence_test_CompoundStruct__alloc();
99
(*outArg)->_buffer = CORBA_sequence_test_CompoundStruct_allocbuf(2);
100
(*outArg)->_length = 2;
101
CORBA_sequence_set_release(*outArg, CORBA_TRUE);
103
for (i=0;i<(*outArg)->_length;i++)
104
(*outArg)->_buffer[i].a.a = CORBA_string_dup(constants_SEQ_STRING_OUT[i]);
107
retn = CORBA_sequence_test_CompoundStruct__alloc();
108
retn->_buffer = CORBA_sequence_test_CompoundStruct_allocbuf(2);
110
CORBA_sequence_set_release(retn, CORBA_TRUE);
112
for (i=0;i<retn->_length;i++)
113
retn->_buffer[i].a.a = CORBA_string_dup(constants_SEQ_STRING_RETN[i]);
120
PortableServer_ServantBase__epv SequenceServer_base_epv = {NULL,NULL,NULL};
122
POA_test_SequenceServer__epv SequenceServer_epv = {
124
SequenceServer_opStrSeq,
125
SequenceServer_opBoundedStructSeq,
128
POA_test_SequenceServer__vepv SequenceServer_vepv = {&SequenceServer_base_epv,&SequenceServer_epv};
130
POA_test_SequenceServer SequenceServer_servant = {NULL,&SequenceServer_vepv}; /* Singleton */