Previous section.

CDE 1.1: Remote Procedure Call
Copyright © 1997 The Open Group

IDL to C-language Mappings

This appendix specifies the bindings of IDL data types to NDR data types and to a set of C-language defined data types. It also specifies the mapping of IDL syntax to the C-language syntax of generated stubs.

Data Type Bindings

The the data type mappings are specified in IDL/NDR/C Type Mappings . For definitions of the NDR data types, refer to Transfer Syntax NDR . Stubs use the C defined data types; to ensure portability, applications should use them as well. The C types shown in the last column of the table are recommended definitions for the C defined types for 32-bit machines.


IDL Type NDR Type Defined C Type C Type
boolean boolean idl_boolean unsigned char
char character idl_char unsigned char
byte uninterpreted octet idl_byte unsigned char
small small idl_small_int char
short short idl_short_int short int
long long idl_long_int long int
hyper hyper idl_hyper_int
16- or 32- Bit Machines:
Big Endian:
struct {
long high;
unsigned long low;
}

Little Endian:
struct {
unsigned long low;
long high;
}

64-Bit Machines:
long
unsigned small unsigned small idl_usmall_int unsigned char
unsigned short unsigned short idl_ushort_int unsigned short int
unsigned long unsigned long idl_ulong_int unsigned long int
unsigned hyper unsigned hyper idl_uhyper_int
16 or 32-Bit Machines:
Big Endian:
struct {
unsigned long high;
unsigned long low;
}

Little Endian:
struct {
unsigned long low;
unsigned long high;
}

64-Bit Machines:
unsigned long
float float idl_float float
double double idl_double double
handle_t not transmitted handle_t void *
error_status_t unsigned long idl_ulong_int unsigned long int
ISO_LATIN_1 uninterpreted octet ISO_LATIN_1 byte
ISO_MULTI_LINGUAL (Note 1.) ISO_MULTI_LINGUAL
struct{
byte row;
byte column;
}
ISO_UCS (Note 1.) ISO_UCS
struct{
byte group;
byte plane;
byte row;
byte column;
}


Table: IDL/NDR/C Type Mappings

  1. The ISO_MULTILINGUAL and ISO_UCS types are structures and are NDR encoded as constructed types.

The recommended values for the Boolean constants are specified in Recommended Boolean Constant Values .


Constant Value
TRUE 1
FALSE 0


Table: Recommended Boolean Constant Values

Syntax Mappings

Unless specified otherwise, the code generated for the C language is syntactically identical to the IDL declarations. The following are the mappings from IDL to the C language for which the syntax is not identical to IDL. These mappings use the conventions, notation and productions defined in Interface Definition Language .

Mappings to languages other than C will be specified by The Open Group DCE as they become standardised.


Please note that the html version of this specification may contain formatting aberrations. The definitive version is available as an electronic publication on CD-ROM from The Open Group.

Contents Next section Index