ic_clib(3)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

okay bestie, gather round because this is ic_clib(3) β€” the IC C Library Functions. It's literally the manual page that lists some of the functions in the IC C runtime library. No cap, it's giving foundational C library realness. πŸ’…

✨ NAME ✨

ic_clib β€” IC C Library Functions

🌸 DESCRIPTION 🌸

This manual page lists some of the functions in the IC C runtime library.

πŸŽ€ ALLOCATION AND DEALLOCATION FUNCTIONS πŸŽ€

The following functions are used for allocating and deallocating a CORBA_Environment structure.

✨ EXPORTS ✨

  • CORBA_Environment *CORBA_Environment_alloc(int inbufsz, int outbufsz) β€” This function is used to allocate and initiate the CORBA_Environment structure. In particular, it is used to dynamically allocate a CORBA_Environment structure and set the default values for the structure's fields.

inbufsize is the initial size of the input buffer.

outbufsize is the initial size of the output buffer.

CORBA_Environment is the CORBA 2.0 state structure used by the generated stub.

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.

To free the space allocated by CORBA_Environment_alloc() do as follows.

  • First call CORBA_free for the input and output buffers.
  • After freeing the buffer space, call CORBA_free for the CORBA_Environment space.
  • void CORBA_free(void *p) β€” Frees allocated space pointed to by p.
  • CORBA_char *CORBA_string_alloc(CORBA_unsigned_long len) β€” Allocates a (simple) CORBA character string of length len + 1.
  • CORBA_wchar *CORBA_wstring_alloc(CORBA_unsigned_long len) β€” Allocates a CORBA wide string of length len + 1.

πŸ’œ EXCEPTION FUNCTIONS πŸ’œ

Functions for retrieving exception ids and values, and for setting exceptions.

✨ EXPORTS ✨

  • CORBA_char *CORBA_exception_id(CORBA_Environment *env) β€” Returns the exception identity if an exception is set, otherwise it returns NULL.
  • void *CORBA_exception_value(CORBA_Environment *env) β€” Returns the exception value, if an exception is set, otherwise it returns NULL.
  • void CORBA_exc_set(CORBA_Environment *env, CORBA_exception_type Major, CORBA_char *Id, CORBA_char *Value) β€” Sets the exception type, exception identity, and exception value in the environment pointed to by env.

πŸ¦‹ SERVER RECEPTION πŸ¦‹

The following function is provided for convenience.

✨ EXPORTS ✨

       int oe_server_receive(CORBA_Environment *env, oe_map_t *map)
       int oe_server_receive_tmo(CORBA_Environment *env, oe_map_t *map,
       unsigned int send_ms, unsigned int recv_ms)

Provides a loop that receives one message, executes the operation in question, and in case of a two-way operation sends a reply.

send_ms and recv_ms specify timeout values in milliseconds for send and receive, respectively.

🌈 GENERIC EXECUTION SWITCH AND MAP MERGING 🌈

Function for searching for server operation function, and for calling it if found. Function for merging maps (see the include file ic.h for definitions).

✨ EXPORTS ✨

  • int oe_exec_switch(CORBA_Object obj, CORBA_Environment *env, oe_map_t *map) β€” Search for server operation and execute it.
  • oe_map_t *oe_merge_maps(oe_map_t *maps, int size) β€” Merge an array of server maps to one single map.

🧚 HELP FUNCTIONS FOR THE TYPE IC_ERLANG_TERM 🧚

Functions for creating ic_erlang_terms.

✨ EXPORTS ✨

       ic_erlang_term*ic_mk_int_term(long l)

       ic_erlang_term*ic_mk_float_term(double d)

       ic_erlang_term*ic_mk_atom_term(char *atom_name)

       ic_erlang_term*ic_mk_pid_term(char *node, int num, int serial, int
       creation)

       ic_erlang_term*ic_mk_port_term(char *node, int id, int creation)

       ic_erlang_term*ic_mk_ref_term(char *node, int len, int n[3], int
       creation)

       ic_erlang_term*ic_mk_tuple_term(int arity)

       int ic_tuple_add_elem(ic_erlang_term *tuple, ic_erlang_term *elem, int
       pos)

       ic_erlang_term*ic_mk_list_term(long l)

       int ic_list_add_elem(ic_erlang_term *list, ic_erlang_term *term)

       ic_erlang_term*ic_mk_list_term_from_string(char *str)

       ic_erlang_term*ic_mk_binary_term(int size, char *b)

       int ic_free_erlang_term(ic_erlang_term *term)

       void ic_print_erlang_term(ic_erlang_term *term)

πŸ‘‘ THE CORBA_ENVIRONMENT STRUCTURE πŸ‘‘

Here is the complete definition of the CORBA_Environment structure, defined in file ic.h:

             /* 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;

πŸ“Œ Note

Always set the field values _fd, _regname, _to_pid and/or *_from_pid to appropriate application values. These are not automatically set by the stubs.

⚠️ Warning

Never assign static buffers to the buffer pointers, and never set the _memchunk field to a value less than 32.

πŸ’– SEE ALSO πŸ’–

ic(3), ic_c_protocol(3)


okay bestie, that's the whole page. The footer credits Ericsson AB, version ic 5.2.2, and the manual is ic_clib(3). There's no date on the footer, just those iconic credits. Stay slaying with your C library functions. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from