File: ic_clib.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (193 lines) | stat: -rw-r--r-- 6,605 bytes parent folder | download
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
.TH ic_clib 3 "ic  4.2.18" "Ericsson AB" "C LIBRARY FUNCTIONS"
.SH NAME
IC C Library Functions \- IC C Library Functions
.SH DESCRIPTION
.LP
This manual page lists some of the functions in the IC C runtime library\&. 

.SH ALLOCATION AND DEALLOCATION FUNCTIONS
.LP
The following functions are used for allocating and deallocating a \fICORBA_Environment\fR structure\&.
.SH EXPORTS
.LP
.B
CORBA_Environment* CORBA_Environment_alloc(int inbufsz, int outbufsz)
.br
.RS
.LP
This function is used to allocate and initiate the \fICORBA_Environment\fR structure\&. In particular, it is used to dynamically allocate a CORBA_Environment structure and set the default values for the structure\&'s fields\&.
.LP
\fIinbufsize\fR is the initial size of the input buffer\&.
.LP
\fIoutbufsize\fR is the initial size of the output buffer\&.
.LP
\fICORBA_Environment\fR is the CORBA 2\&.0 state structure used by the generated stub\&.
.LP
This function will set all needed default values and allocate buffers the lengths of which are equal to the values passed, but will not allocate space for the _to_pid and _from_pid fields\&.
.LP
To free the space allocated by CORBA_Environment_alloc() do as follows\&.
.RS 2
.TP 2
*
First call CORBA_free for the input and output buffers\&.
.TP 2
*
After freeing the buffer space, call CORBA_free for the CORBA_Environment space\&.
.RE
.RE
.LP
.B
void CORBA_free(void *p)
.br
.RS
.LP
Frees allocated space pointed to by \fIp\fR\&.
.RE
.LP
.B
CORBA_char* CORBA_string_alloc(CORBA_unsigned_long len)
.br
.RS
.LP
Allocates a (simple) CORBA character string of length \fIlen + 1\fR\&.
.RE
.LP
.B
CORBA_wchar* CORBA_wstring_alloc(CORBA_unsigned_long len)
.br
.RS
.LP
Allocates a CORBA wide string of length \fIlen + 1\fR\&.
.RE
.SH EXCEPTION FUNCTIONS
.LP
Functions for retrieving exception ids and values, and for setting exceptions\&. 
.SH EXPORTS
.LP
.B
CORBA_char* CORBA_exception_id(CORBA_Environment *env)
.br
.RS
.LP
Returns the exception identity if an exception is set, otherwise it returns \fINULL\fR\&.
.RE
.LP
.B
void* CORBA_exception_value(CORBA_Environment *env)
.br
.RS
.LP
Returns the exception value, if an exception is set, otherwise it returns \fINULL\fR\&.
.RE
.LP
.B
void CORBA_exc_set(CORBA_Environment *env, CORBA_exception_type Major, CORBA_char *Id, CORBA_char *Value)
.br
.RS
.LP
Sets the exception type, exception identity, and exception value in the environment pointed to by \fIenv\fR\&.
.RE
.SH SERVER RECEPTION
.LP
The following function is provided for convenience\&. 
.SH EXPORTS
.LP
.B
int oe_server_receive(CORBA_Environment *env, oe_map_t *map)
.br
.B
int oe_server_receive_tmo(CORBA_Environment *env, oe_map_t *map, unsigned int send_ms, unsigned int recv_ms)
.br
.RS
.LP
Provides a loop that receives one message, executes the operation in question, and in case of a two-way operation sends a reply\&.
.LP
\fIsend_ms\fR and \fIrecv_ms\fR specify timeout values in milliseconds for send and receive, respectively\&.
.RE
.SH GENERIC EXECUTION SWITCH AND MAP MERGING
.LP
Function for searching for server operation function, and for calling it if found\&. Function for merging maps (see the include file \fIic\&.h\fR for definitions)\&. 
.SH EXPORTS
.LP
.B
int oe_exec_switch(CORBA_Object obj, CORBA_Environment *env, oe_map_t *map)
.br
.RS
.LP
Search for server operation and execute it\&.
.RE
.LP
.B
oe_map_t* oe_merge_maps(oe_map_t *maps, int size)
.br
.RS
.LP
Merge an array of server maps to one single map\&.
.RE
.SH THE CORBA_ENVIRONMENT STRUCTURE
.LP
Here is the complete definition of the CORBA_Environment structure, defined in file \fIic\&.h\fR: 

.nf
      /* Environment definition */
      typedef struct {

      /*----- CORBA compatibility part ------------------------*/
      /* Exception tag, initially set to CORBA_NO_EXCEPTION ---*/
      CORBA_exception_type   _major;          

      /*----- External Implementation part - initiated by the user ---*/
      /* File descriptor                                              */
      int                    _fd;             
      /* Size of input buffer                                         */
      int                    _inbufsz;        
      /* Pointer to always dynamically allocated buffer for input     */
      char                  *_inbuf;         
      /* Size of output buffer                                        */
      int                    _outbufsz;       
      /* Pointer to always dynamically allocated buffer for output    */ 
      char                  *_outbuf;        
      /* Size of memory chunks in bytes, used for increasing the output
      buffer, set to >= 32, should be around >= 1024 for performance
      reasons                                                       */ 
      int                    _memchunk;       
      /* Pointer for registered name                                   */
      char                   _regname[256];   
      /* Process identity for caller                                   */
      erlang_pid            *_to_pid;         
      /* Process identity for callee                                  */ 
      erlang_pid            *_from_pid;      

      /*- Internal Implementation part - used by the server/client ---*/
      /* Index for input buffer                                       */
      int                    _iin;            
      /* Index for output buffer                                      */
      int                    _iout;          
      /* Pointer for operation name                                   */
      char                   _operation[256];
      /* Used to count parameters                                    */
      int                    _received;      
      /* Used to identify the caller                                  */
      erlang_pid             _caller;        
      /* Used to identify the call                                     */
      erlang_ref             _unique;         
      /* Exception id field                                           */
      CORBA_char            *_exc_id;        
      /* Exception value field                                        */
      void                  *_exc_value;           

      
      } CORBA_Environment; 
    
.fi
.SS Note:
.LP
Always set the field values \fI_fd\fR, \fI_regname\fR, \fI_to_pid\fR and/or \fI*_from_pid\fR to appropriate application values\&. These are not automatically set by the stubs\&.

.SS Warning:
.LP
Never assign static buffers to the buffer pointers, and never set the \fI_memchunk\fR field to a value less than \fI32\fR\&.

.SH SEE ALSO
.LP
ic(3), ic_c_protocol(3)