diff options
Diffstat (limited to 'lib/ic/test/ic_SUITE_data')
38 files changed, 4375 insertions, 0 deletions
diff --git a/lib/ic/test/ic_SUITE_data/Corba.idl b/lib/ic/test/ic_SUITE_data/Corba.idl new file mode 100644 index 0000000000..6b81132500 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/Corba.idl @@ -0,0 +1,1013 @@ +// This file contains OMG IDL from CORBA V2.0, July 1995. +// Includes IDL for CORBA Core +// (Interface Repository, ORB Interface, Basic Object Adapter Interface) +// and CORBA Interoperability (IOP, GIOP, IIOP, and DCE CIOP modules) + +// Complete OMG IDL for Interface Repository starts on pg 6-42, CORBA V2.0 July 1995 +// IRObject interface described on pg 6-9 CORBA V2.0, July 1995 +// Contained interface: pg 6-11 CORBA V2, 7-95 +// Container interface: pg 6-12 thru 6-15 CORBA V2, 7-95 +// IDLType interface: pg 6-15 CORBA V2, 7-95 +// Repository interface: pg 6-16 CORBA V2, 7-95 +// ModuleDef interface: pg 6-17 CORBA V2, 7-95 +// ConstantDef interface: pg 6-18 CORBA V2, 7-95 +// TypeDef interface: pg 6-19 CORBA V2, 7-95 +// StructDef interface: pg 6-19 CORBA V2, 7-95 +// UnionDef interface: pg 6-19 CORBA V2, 7-95 +// EnumDef interface: pg 6-20 CORBA V2, 7-95 +// AliasDef interface: pg 6-21 CORBA V2, 7-95 +// PrimitiveDef interface: pg 6-21 CORBA V2, 7-95 +// StringDef interface: pg 6-22 CORBA V2, 7-95 +// SequenceDef interface: pg 6-22 CORBA V2, 7-95 +// ArrayDef interface: pg 6-23 CORBA V2, 7-95 +// ExceptionDef interface: pg 6-24 CORBA V2, 7-95 +// AttributeDef interface: pg 6-25 CORBA V2, 7-95 +// OperationDef interface: pg 6-26 CORBA V2, 7-95 +// InterfaceDef interface: pg 6-28 CORBA V2, 7-95 +// TypeCode interface (PIDL): pg 6-34 CORBA V2, 7-95 +// ORB interface: pg 6-40 CORBA V2, 7-95 + +#ifndef __CORBA_IDL +#define __CORBA_IDL + +// #pragma prefix "omg.org" +module CORBA { + + interface TypeCode; + typedef string Identifier; + typedef string ScopedName; + typedef string RepositoryId; + + /* + * start of section added by Christian Blum + */ + + typedef enum new_type {NO,USER,SYSTEM_EXCEPTION} exception_type; + + /** + * no definition for this type + */ + interface ImplementationDef + { + }; + + /** + * no definition for this type + */ + //interface Principal + struct Principal + { + string str; + }; + + /** + * no definition for this type + */ + interface Environment + { + + }; + + typedef unsigned long Flags; + typedef unsigned long Status; + + struct NamedValue // PIDL + { + Identifier name; // argument name + any argument; // argument + long len; // length/count of argument value + Flags arg_modes; // argument mode flags + + }; + + typedef sequence<NamedValue> NVList; /* C */ + + interface Request // PIDL + { + + Status add_arg ( + in Identifier name, // argument name + in TypeCode arg_type, // argument datatype + // in void * value, // argument value to be added + in any value_LOOK_AT_SOURCE, // changed by blum + in long len, // length/count of argument value + in Flags arg_flags // argument flags + ); + + Status invoke ( + in Flags invoke_flags // invocation flags + ); + + Status delete (); + Status send ( + in Flags invoke_flags // invocation flags + ); + + Status get_response ( + in Flags response_flags // response flags + ); + + }; + + + interface Context // PIDL + { + + Status set_one_value ( + in Identifier prop_name, // property name to add + in string value // property value to add + ); + + Status set_values ( + in NVList values // property values to be changed + ); + + Status get_values ( + in Identifier start_scope, // search scope + in Flags op_flags, // operation flags + in Identifier prop_name, // name of property(s) to retrieve + out NVList values // requested property(s) + ); + + Status delete_values ( + in Identifier prop_name // name of property(s) to delete + ); + + Status create_child ( + in Identifier ctx_name, // name of context object + out Context child_ctx // newly created context object + ); + + Status delete ( + in Flags del_flags // flags controlling deletion + ); + + }; + + /* + * end of section added by Christian Blum + */ + + + enum DefinitionKind { + dk_none, dk_all, + dk_Attribute, dk_Constant, dk_Exception, dk_Interface, + dk_Module, dk_Operation, dk_Typedef, + dk_Alias, dk_Struct, dk_Union, dk_Enum, + dk_Primitive, dk_String, dk_Sequence, dk_Array, + dk_Repository + }; + + + interface IRObject { + // read interface + readonly attribute DefinitionKind def_kind; + + // write interface + void destroy (); + }; + + + + typedef string VersionSpec; + + interface Contained; + interface Repository; + interface Container; + + interface Contained : IRObject { + // read/write interface + + attribute RepositoryId id; + attribute Identifier name; + attribute VersionSpec version; + + // read interface + + readonly attribute Container defined_in; + readonly attribute ScopedName absolute_name; + readonly attribute Repository containing_repository; + + struct Description { + DefinitionKind kind; + any value; + }; + + Description describe (); + + // write interface + + void move ( + in Container new_container, + in Identifier new_name, + in VersionSpec new_version + ); + }; + + + interface ModuleDef; + interface ConstantDef; + interface IDLType; + interface StructDef; + interface UnionDef; + interface EnumDef; + interface AliasDef; + interface InterfaceDef; + typedef sequence <InterfaceDef> InterfaceDefSeq; + + typedef sequence <Contained> ContainedSeq; + + struct StructMember { + Identifier name; + TypeCode type; + IDLType type_def; + }; + typedef sequence <StructMember> StructMemberSeq; + + struct UnionMember { + Identifier name; + any label; + TypeCode type; + IDLType type_def; + }; + typedef sequence <UnionMember> UnionMemberSeq; + + typedef sequence <Identifier> EnumMemberSeq; + + interface Container : IRObject { + // read interface + + Contained lookup ( in ScopedName search_name); + + ContainedSeq contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + ContainedSeq lookup_name ( + in Identifier search_name, + in long levels_to_search, + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + struct Description { + Contained contained_object; + DefinitionKind kind; + any value; + }; + + typedef sequence<Description> DescriptionSeq; + + DescriptionSeq describe_contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited, + in long max_returned_objs + ); + + // write interface + + ModuleDef create_module ( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + + ConstantDef create_constant ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in any value + ); + + StructDef create_struct ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + UnionDef create_union ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType discriminator_type, + in UnionMemberSeq members + ); + + EnumDef create_enum ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in EnumMemberSeq members + ); + + AliasDef create_alias ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type + ); + + InterfaceDef create_interface ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in InterfaceDefSeq base_interfaces + ); + }; + + + + interface IDLType : IRObject { + readonly attribute TypeCode type; + }; + + + + interface PrimitiveDef; + interface StringDef; + interface SequenceDef; + interface ArrayDef; + + enum PrimitiveKind { + pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, + pk_float, pk_double, pk_boolean, pk_char, pk_octet, + pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref + }; + + interface Repository : Container { + // read interface + + Contained lookup_id (in RepositoryId search_id); + + PrimitiveDef get_primitive (in PrimitiveKind kind); + + // write interface + + StringDef create_string (in unsigned long bound); + + SequenceDef create_sequence ( + in unsigned long bound, + in IDLType element_type + ); + + ArrayDef create_array ( + in unsigned long length, + in IDLType element_type + ); + }; + + + interface ModuleDef : Container, Contained { + }; + + struct ModuleDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + }; + + + interface ConstantDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute any value; + }; + + struct ConstantDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + any value; + }; + + + interface TypedefDef : Contained, IDLType { + }; + + struct TypeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + + interface StructDef : TypedefDef { + attribute StructMemberSeq members; + }; + + + interface UnionDef : TypedefDef { + readonly attribute TypeCode discriminator_type; + attribute IDLType discriminator_type_def; + attribute UnionMemberSeq members; + }; + + + interface EnumDef : TypedefDef { + attribute EnumMemberSeq members; + }; + + + interface AliasDef : TypedefDef { + attribute IDLType original_type_def; + }; + + + interface PrimitiveDef: IDLType { + readonly attribute PrimitiveKind kind; + }; + + + interface StringDef : IDLType { + attribute unsigned long bound; + }; + + + interface SequenceDef : IDLType { + attribute unsigned long bound; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ArrayDef : IDLType { + attribute unsigned long length; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + + interface ExceptionDef : Contained { + readonly attribute TypeCode type; + attribute StructMemberSeq members; + }; + struct ExceptionDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + + + enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; + + interface AttributeDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute AttributeMode mode; + }; + + struct AttributeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + AttributeMode mode; + }; + + + + enum OperationMode {OP_NORMAL, OP_ONEWAY}; + + enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; + struct ParameterDescription { + Identifier name; + TypeCode type; + IDLType type_def; + ParameterMode mode; + }; + typedef sequence <ParameterDescription> ParDescriptionSeq; + + typedef Identifier ContextIdentifier; + typedef sequence <ContextIdentifier> ContextIdSeq; + + typedef sequence <ExceptionDef> ExceptionDefSeq; + typedef sequence <ExceptionDescription> ExcDescriptionSeq; + + interface OperationDef : Contained { + readonly attribute TypeCode result; + attribute IDLType result_def; + attribute ParDescriptionSeq params; + attribute OperationMode mode; + attribute ContextIdSeq contexts; + attribute ExceptionDefSeq exceptions; + }; + + struct OperationDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode result; + OperationMode mode; + ContextIdSeq contexts; + ParDescriptionSeq parameters; + ExcDescriptionSeq exceptions; + }; + + + + typedef sequence <RepositoryId> RepositoryIdSeq; + typedef sequence <OperationDescription> OpDescriptionSeq; + typedef sequence <AttributeDescription> AttrDescriptionSeq; + + interface InterfaceDef : Container, Contained, IDLType { + // read/write interface + + attribute InterfaceDefSeq base_interfaces; + + // read interface + + boolean is_a (in RepositoryId interface_id); + + struct FullInterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + RepositoryIdSeq base_interfaces; + TypeCode type; + }; + + FullInterfaceDescription describe_interface(); + + // write interface + + AttributeDef create_attribute ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct InterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq base_interfaces; + }; + + + + enum TCKind { + tk_null, tk_void, + tk_short, tk_long, tk_ushort, tk_ulong, + tk_float, tk_double, tk_boolean, tk_char, + tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, + tk_struct, tk_union, tk_enum, tk_string, + tk_sequence, tk_array, tk_alias, tk_except + }; + + interface TypeCode { // PIDL + exception Bounds {}; + exception BadKind {}; + + // for all TypeCode kinds + boolean equal (in TypeCode tc); + TCKind kind (); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, and tk_except + RepositoryId id () raises (BadKind); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, and tk_except + Identifier name () raises (BadKind); + + // for tk_struct, tk_union, tk_enum, and tk_except + unsigned long member_count () raises (BadKind); + Identifier member_name (in unsigned long index) raises (BadKind, Bounds); + + // for tk_struct, tk_union, and tk_except + TypeCode member_type (in unsigned long index) raises (BadKind, Bounds); + + // for tk_union + any member_label (in unsigned long index) raises (BadKind, Bounds); + TypeCode discriminator_type () raises (BadKind); + long default_index () raises (BadKind); + + // for tk_string, tk_sequence, and tk_array + unsigned long length () raises (BadKind); + + // for tk_sequence, tk_array, and tk_alias + TypeCode content_type () raises (BadKind); + + // deprecated interface + long param_count (); + any parameter (in long index) raises (Bounds); + }; + + + /* + * following line added by Christian Blum + */ + interface BOA; + + interface ORB { + // other operations ... + + TypeCode create_struct_tc ( + in RepositoryId id, + in Identifier name, + in StructMemberSeq members + ); + + TypeCode create_union_tc ( + in RepositoryId id, + in Identifier name, + in TypeCode discriminator_type, + in UnionMemberSeq members + ); + + TypeCode create_enum_tc ( + in RepositoryId id, + in Identifier name, + in EnumMemberSeq members + ); + + TypeCode create_alias_tc ( + in RepositoryId id, + in Identifier name, + in TypeCode original_type + ); + + TypeCode create_exception_tc ( + in RepositoryId id, + in Identifier name, + in StructMemberSeq members + ); + + TypeCode create_interface_tc ( + in RepositoryId id, + in Identifier name + ); + + TypeCode create_string_tc ( + in unsigned long bound + ); + + TypeCode create_sequence_tc ( + in unsigned long bound, + in TypeCode element_type + ); + + TypeCode create_recursive_sequence_tc ( + in unsigned long bound, + in unsigned long offset + ); + + TypeCode create_array_tc ( + in unsigned long length, + in TypeCode element_type + ); + + /* + * following line commented out by Christian Blum + */ + // }; + + // The ORB interface (PIDL) is described in Chapter 7, CORBA V2.0 July 1995 + // Object interface (object reference operations): pg 7-3 CORBA V2, 7-95 + // ORB initialization: pg 7-7 CORBA V2, 7-95 + // Object Adapter and Basic Object Adapter initialization: pg 7-8 CORBA V2 7-95 + // Getting initial references: pg 7-10 CORBA V2 7-95 + //PIDL + + /* + * following line commented out by Christian Blum + */ + //interface ORB { + + + string object_to_string (in Object obj); + Object string_to_object (in string str); + + Status create_list ( + in long count, + out NVList new_list + ); + Status create_operation_list ( + in OperationDef oper, + out NVList new_list + ); + Status get_default_context (out Context ctx); + + // Initializing the ORB + typedef string ORBid; + typedef sequence <string> arg_list; + ORB ORB_init (inout arg_list argv, in ORBid orb_identifier); + + // Initializing an object adapter and the Basic Object Adapter + typedef string OAid; + + // Template for OA initialization operations + // <OA> <OA>_init (inout arg_list argv, + // in OAid oa_identifier); + + + + BOA BOA_init (inout arg_list argv, + in OAid boa_identifier); + + + + // Getting initial object references + typedef string ObjectId; + typedef sequence <ObjectId> ObjectIdList; + + exception InvalidName {}; + + ObjectIdList list_initial_services (); + + Object resolve_initial_references (in ObjectId identifier) + raises (InvalidName); + }; + + // had to be changed..., Gerald Brose 1996 + interface ORBject { + + ImplementationDef get_implementation (); + InterfaceDef get_interface (); + boolean is_nil(); + Object duplicate (); + void release (); + boolean is_a (in string logical_type_id); + boolean non_existent(); + boolean is_equivalent (in Object other_object); + unsigned long hash(in unsigned long maximum); + + + Status create_request ( + in Context ctx, + in Identifier operation, + in NVList arg_list, + inout NamedValue result, + out Request request, + in Flags req_flags + ); + }; + + + // Basic Object Adapter interface described in Chapter 8, CORBA V2.0, July 1995 + // interface InterfaceDef; // from Interface Repository // PIDL + // interface ImplementationDef; // from Implementation Repository + // interface Object; // an object reference + // interface Principal; // for the authentication service + typedef sequence <octet, 1024> ReferenceData; + + interface BOA { + Object create ( + in ReferenceData id, + in InterfaceDef intf, + in ImplementationDef impl + ); + void dispose (in Object obj); + ReferenceData get_id (in Object obj); + + void change_implementation (in Object obj, + in ImplementationDef impl + ); + + Principal get_principal (in Object obj, + in Environment ev + ); + + void set_exception (in exception_type major, // NO, USER, + //or SYSTEM_EXCEPTION + in string userid, // exception type id + in any param_LOOK_AT_SOURCE + // in void *param // pointer to associated data + ); + + void impl_is_ready (in ImplementationDef impl); + void deactivate_impl (in ImplementationDef impl); + void obj_is_ready (in Object obj, in ImplementationDef impl); + void deactivate_obj (in Object obj); + }; +}; + +// IOP module described in chap 10 CORBA V2, 7-95 +module IOP{ // IDL + // + // Standard Protocol Profile tag values + // + typedef unsigned long ProfileId; + const ProfileId TAG_INTERNET_IOP = 0; + const ProfileId TAG_MULTIPLE_COMPONENTS = 1; + + struct TaggedProfile { + ProfileId tag; + sequence <octet> profile_data; + }; + + // + // an Interoperable Object Reference is a sequence of + // object-specific protocol profiles, plus a type ID. + // + struct IOR { + string type_id; + sequence <TaggedProfile> profiles; + }; + + // + // Standard way of representing multicomponent profiles. + // This would be encapsulated in a TaggedProfile. + // + typedef unsigned long ComponentId; + struct TaggedComponent { + ComponentId tag; + sequence <octet> component_data; + }; + typedef sequence <TaggedComponent> MultipleComponentProfile; + + + typedef unsigned long ServiceID; + + struct ServiceContext { + ServiceID context_id; + sequence <octet> context_data; + }; + typedef sequence <ServiceContext> ServiceContextList; + + const ServiceID TransactionService = 0; + + + +}; +// GIOP module described in CORBA V2, 7-95 chap 12 +// Complete IDL for GIOP module in CORBA +// V2.0, 7-95 p 10-29 +// GIOP message header: CORBA V2, 7-95 p 12-16 +// GIOP request header: CORBA V2, 7-95 p 12-17 +// GIOP reply header: CORBA V2, 7-95 p 12-19 +// GIOP cancel request and locate request: CORBA V2, 7-95 pp 12-20 -- 12-21 +// GIOP locate reply: CORBA V2, 7-95 p 12-22 +module GIOP { // IDL + enum MsgType { + Request, Reply, CancelRequest, + LocateRequest, LocateReply, + CloseConnection, MessageError + }; + + struct Version { + char major; + char minor; + }; + + struct MessageHeader { + char magic [4]; + Version GIOP_version; + boolean byte_order; + octet message_type; + unsigned long message_size; + }; + + struct RequestHeader { + ::IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + sequence <octet> object_key; + string operation; + + /* + * ::CORBA:: added for correct scope + */ + ::CORBA::Principal requesting_principal; + }; + + enum ReplyStatusType { + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD + }; + + struct ReplyHeader { + ::IOP::ServiceContextList service_context; + unsigned long request_id; + ReplyStatusType reply_status; + }; + + struct CancelRequestHeader { + unsigned long request_id; + }; + + struct LocateRequestHeader { + unsigned long request_id; + sequence <octet> object_key; + }; + + enum LocateStatusType { + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD + }; + + struct LocateReplyHeader { + unsigned long request_id; + LocateStatusType locate_status; + }; +}; +// IIOP module described in CORBA V2, 7-95 chap 12 +// Complete IDL for IIOP module: CORBA V2, 7-95 p 12-31 +module IIOP { // IDL + struct Version { + char major; + char minor; + }; + + struct ProfileBody { + Version iiop_version; + string host; + unsigned short port; + sequence <octet> object_key; + }; +}; +// DCE CIOP module described in CORBA V2, 7-95 chap 13 +// IDL for DCE CIOP module: CORBA V2, 7-95 p 13-2 +module DCE_CIOP { + struct InvokeRequestHeader { + boolean byte_order; + ::IOP::ServiceContextList service_context; + sequence <octet> object_key; + string endpoint_id; + string operation; + ::CORBA::Principal principal; + sequence <string> client_context; + + // in and inout parameters follow + }; + enum InvokeResponseStatus { + INVOKE_NO_EXCEPTION, + INVOKE_USER_EXCEPTION, + INVOKE_SYSTEM_EXCEPTION, + INVOKE_LOCATION_FORWARD, + INVOKE_TRY_AGAIN + }; + + struct InvokeResponseHeader { + boolean byte_order; + ::IOP::ServiceContextList service_context; + InvokeResponseStatus status; + + // if status = INVOKE_NO_EXCEPTION, + // result then inouts and outs follow + + // if status = INVOKE_USER_EXCEPTION or + // INVOKE_SYSTEM_EXCEPTION, an exception follows + + // if status = INVOKE_LOCATION_FORWARD, an + // ::IOP::MultipleComponentsProfile follows + }; + + struct LocateRequestHeader { + boolean byte_order; + sequence <octet> object_key; + string endpoint_id; + string operation; + + // no body follows + }; + + module IOP { + + /* + * ::IOP:: added to get the right scope + */ + const ::IOP::ComponentId TAG_OBJECT_KEY = 10; + const ::IOP::ComponentId TAG_ENDPOINT_ID = 11; + const ::IOP::ComponentId TAG_LOCATION_POLICY = 12; + // illegal IDL + /* const octet LOCATE_NEVER = 0; + const octet LOCATE_OBJECT = 1; + const octet LOCATE_OPERATION = 2; + const octet LOCATE_ALWAYS = 3; + */ + }; +}; + +#endif diff --git a/lib/ic/test/ic_SUITE_data/Coss.idl b/lib/ic/test/ic_SUITE_data/Coss.idl new file mode 100644 index 0000000000..c84d4a8247 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/Coss.idl @@ -0,0 +1,1537 @@ +// This file contains OMG IDL and PIDL for the Common Object Services. +// CosNaming Module, p 3-6 CORBAservices, Naming Service V1.0, 3/94 + +// A few minor changes for the JacORB distribution: +// +// added am enclosing COSS module and changed scoped names accordingly +// +// corrected a few syntax errors +// +// commented out: +// #includes +// forward declaration of Object + +#include "Corba.idl" + +module COSS { + +module CosNaming { + + typedef string Istring; + struct NameComponent { + Istring id; + Istring kind; + }; + + typedef sequence <NameComponent> Name; + + enum BindingType {nobject, ncontext}; + + struct Binding { + Name binding_name; + BindingType binding_type; + }; + + typedef sequence <Binding> BindingList; + interface BindingIterator; + + interface NamingContext { + + enum NotFoundReason { missing_node, not_context, not_object}; + + exception NotFound { + NotFoundReason why; + Name rest_of_name; + }; + + exception CannotProceed { + NamingContext cxt; + Name rest_of_name; + }; + + exception InvalidName{}; + exception AlreadyBound {}; + exception NotEmpty{}; + + void bind(in Name n, in Object obj) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + void rebind(in Name n, in Object obj) + raises(NotFound, CannotProceed, InvalidName); + void bind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + void rebind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName); + Object resolve (in Name n) + raises(NotFound, CannotProceed, InvalidName); + void unbind(in Name n) + raises(NotFound, CannotProceed, InvalidName); + NamingContext new_context(); + NamingContext bind_new_context(in Name n) + raises(NotFound, AlreadyBound, CannotProceed, InvalidName); + void destroy( ) + raises(NotEmpty); + void list (in unsigned long how_many, + out BindingList bl, out BindingIterator bi); + }; + + interface BindingIterator { + boolean next_one(out Binding b); + boolean next_n(in unsigned long how_many, + out BindingList bl); + void destroy(); + }; +}; + +// Names Library interface in PIDL, CORBAservices p 3- 14, Naming Service V1.0 3/94 +/* +interface LNameComponent { // PIDL + exception NotSet{}; + string get_id() + raises(NotSet); + void set_id(in string i); + string get_kind() + raises(NotSet); + void set_kind(in string k); + void destroy(); +}; + +interface LName { // PIDL + exception NoComponent{}; + exception OverFlow{}; + exception InvalidName{}; + LName insert_component(in unsigned long i, + in LNameComponent n) + raises(NoComponent, OverFlow); + LNameComponent get_component(in unsigned long i) + raises(NoComponent); + LNameComponent delete_component(in unsigned long i) + raises(NoComponent); + unsigned long num_components(); + boolean equal(in LName ln); + boolean less_than(in LName ln); + Name to_idl_form() + raises(InvalidName); + void from_idl_form(in Name n); + void destroy(); +}; + +LName create_lname(); // C/C++ +LNameComponent create_lname_component(); // C/C++ +*/ + +// CosEventComm Module, CORBAservices p 4-8, Event Service V1.0 3/94 + +module CosEventComm { + + exception Disconnected{}; + + interface PushConsumer { + void push (in any data) raises(Disconnected); + void disconnect_push_consumer(); + }; + + interface PushSupplier { + void disconnect_push_supplier(); + }; + + interface PullSupplier { + any pull () raises(Disconnected); + any try_pull (out boolean has_event) + raises(Disconnected); + void disconnect_pull_supplier(); + }; + + interface PullConsumer { + void disconnect_pull_consumer(); + }; + +}; + +// CosEventChannelAdmin Module, p 4-15 CORBAservices, Event +// Service V1.0, 3/94 + +// #include "CosEventComm.idl" + +module CosEventChannelAdmin { + + exception AlreadyConnected {}; + exception TypeError {}; + + interface ProxyPushConsumer: ::COSS::CosEventComm::PushConsumer { + void connect_push_supplier( + in ::COSS::CosEventComm::PushSupplier push_supplier) + raises(AlreadyConnected); + }; + + interface ProxyPullSupplier: ::COSS::CosEventComm::PullSupplier { + void connect_pull_consumer( + in ::COSS::CosEventComm::PullConsumer pull_consumer) + raises(AlreadyConnected); + }; + + interface ProxyPullConsumer: ::COSS::CosEventComm::PullConsumer { + void connect_pull_supplier( + in ::COSS::CosEventComm::PullSupplier pull_supplier) + raises(AlreadyConnected,TypeError); + }; + + interface ProxyPushSupplier: ::COSS::CosEventComm::PushSupplier { + void connect_push_consumer( + in ::COSS::CosEventComm::PushConsumer + push_consumer) + raises(AlreadyConnected, TypeError); + }; + + + interface ConsumerAdmin { + ProxyPushSupplier obtain_push_supplier(); + ProxyPullSupplier obtain_pull_supplier(); + }; + + interface SupplierAdmin { + ProxyPushConsumer obtain_push_consumer(); + ProxyPullConsumer obtain_pull_consumer(); + }; + + interface EventChannel { + ConsumerAdmin for_consumers(); + SupplierAdmin for_suppliers(); + void destroy(); + }; + +}; + + +// CosTyped Event Module, p 4-22 CORBAservices, Event Service +// V1.0, 3/94 + +// // #include "CosEventComm.idl" + +module CosTypedEventComm { + + interface TypedPushConsumer : ::COSS::CosEventComm::PushConsumer { + Object get_typed_consumer(); + }; + + interface TypedPullSupplier : ::COSS::CosEventComm::PullSupplier { + Object get_typed_supplier(); + }; + +}; + +// CosTypedEventChannelAdmin Module, p 4- 25 CORBAservices, +// Event Service V1.0, 3/94 + +// // #include "CosEventChannel.idl" +// // #include "CosTypedEventComm.idl" +module CosTypedEventChannelAdmin { + exception InterfaceNotSupported {}; + exception NoSuchImplementation {}; + typedef string Key; + + interface TypedProxyPushConsumer : + ::COSS::CosEventChannelAdmin::ProxyPushConsumer, + ::COSS::CosTypedEventComm::TypedPushConsumer { }; + + interface TypedProxyPullSupplier : + ::COSS::CosEventChannelAdmin::ProxyPullSupplier, + ::COSS::CosTypedEventComm::TypedPullSupplier { }; + + interface TypedSupplierAdmin : + ::COSS::CosEventChannelAdmin::SupplierAdmin { + TypedProxyPushConsumer obtain_typed_push_consumer( + in Key supported_interface) + raises(InterfaceNotSupported); + ::COSS::CosEventChannelAdmin::ProxyPullConsumer obtain_typed_pull_consumer ( + in Key uses_interface) + raises(NoSuchImplementation); + }; + + interface TypedConsumerAdmin : + ::COSS::CosEventChannelAdmin::ConsumerAdmin { + TypedProxyPullSupplier obtain_typed_pull_supplier( + in Key supported_interface) + raises (InterfaceNotSupported); + ::COSS::CosEventChannelAdmin::ProxyPushSupplier obtain_typed_push_supplier( + in Key uses_interface) + raises(NoSuchImplementation); + }; + + interface TypedEventChannel { + TypedConsumerAdmin for_consumers(); + TypedSupplierAdmin for_suppliers(); + void destroy (); + }; +}; + + +// CosPersistencePID Module, p 5-20 CORBAservices, +// Persistent Object Service V1.0, 3/94 + +//#ifndef __COSPERSISTENCE +//#define __COSPERSISTENCE + +module CosPersistencePID { + + interface PID { + attribute string datastore_type; + string get_PIDString(); + }; +}; + + +// CosPersistencePDS Module, p 5-20 CORBAservices, +// Persistent Object Service V1.0, 3/94 + +// #include "CosPersistencePID.idl" + +module CosPersistencePDS { + +// interface Object; + interface PDS { + PDS connect (in Object obj, + in ::COSS::CosPersistencePID::PID p); + void disconnect (in Object obj, + in ::COSS::CosPersistencePID::PID p); + void store (in Object obj, + in ::COSS::CosPersistencePID::PID p); + void restore (in Object obj, + in ::COSS::CosPersistencePID::PID p); + void delete (in Object obj, + in ::COSS::CosPersistencePID::PID p); + }; +}; + + +// CosPersistencePO Module, p 5-12 CORBAservices, +// Persistent Object Service V1.0, 3/94 + +// // #include "CosPersistencePDS.idl" +// CosPersistencePDS.idl +// // #includes CosPersistencePID.idl + +module CosPersistencePO { + + interface PO { + attribute ::COSS::CosPersistencePID::PID p; + ::COSS::CosPersistencePDS::PDS connect ( + in ::COSS::CosPersistencePID::PID p); + void disconnect (in ::COSS::CosPersistencePID::PID p); + void store (in ::COSS::CosPersistencePID::PID p); + void restore (in ::COSS::CosPersistencePID::PID p); + void delete (in ::COSS::CosPersistencePID::PID p); + }; + + interface SD { + void pre_store(); + void post_restore(); + }; +}; + + +// CosPersistencePOM Module, p 5-15 CORBAservices, +// Persistent Object Service V1.0, 3/94 + +// #include "CosPersistencePDS.idl" + +// CosPersistencePDS.idl // #includes CosPersistencePID.idl + +module CosPersistencePOM { + +// interface Object; + + interface POM { + ::COSS::CosPersistencePDS::PDS connect ( + in Object obj, + in ::COSS::CosPersistencePID::PID p); + void disconnect ( + in Object obj, + in ::COSS::CosPersistencePID::PID p); + void store ( + in Object obj, + in ::COSS::CosPersistencePID::PID p); + void restore ( + in Object obj, + in ::COSS::CosPersistencePID::PID p); + void delete ( + in Object obj, + in ::COSS::CosPersistencePID::PID p); + }; + }; + +// CosPersistencePDS_DA Module, p 5-22 CORBAservices, +// Persistent Object Service, V1.0, 3/94 + +// #include "CosPersistencePDS.idl" +// CosPersistencePDS.idl // #includes CosPersistencePID.idl + +module CosPersistencePDS_DA { + + typedef string DAObjectID; + + interface PID_DA : ::COSS::CosPersistencePID::PID { + attribute DAObjectID oid; + }; + + interface DAObject { + boolean dado_same(in DAObject d); + DAObjectID dado_oid(); + PID_DA dado_pid(); + void dado_remove(); + void dado_free(); + }; + + interface DAObjectFactory { + DAObject create(); + }; + + interface DAObjectFactoryFinder { + DAObjectFactory find_factory(in string key); + }; + + interface PDS_DA : ::COSS::CosPersistencePDS::PDS { + DAObject get_data(); + void set_data(in DAObject new_data); + DAObject lookup(in DAObjectID id); + PID_DA get_pid(); + PID_DA get_object_pid(in DAObject dao); + DAObjectFactoryFinder data_factories(); + }; + + typedef sequence<string> AttributeNames; + interface DynamicAttributeAccess { + AttributeNames attribute_names(); + any attribute_get(in string name); + void attribute_set(in string name, in any value); + }; + + typedef string ClusterID; + typedef sequence<ClusterID> ClusterIDs; + interface PDS_ClusteredDA : PDS_DA{ + ClusterID cluster_id(); + string cluster_kind(); + ClusterIDs clusters_of(); + PDS_ClusteredDA create_cluster(in string kind); + PDS_ClusteredDA open_cluster(in ClusterID cluster); + PDS_ClusteredDA copy_cluster( + in PDS_DA source); + }; +}; + +// CosPersistenceDDO Module, p 5-32 CORBAservices, Persistent Object Service V1.0, 3/94 + +// #include "CosPersistencePID.idl" +module CosPersistenceDDO { + + interface DDO { + attribute string object_type; + attribute ::COSS::CosPersistencePID::PID p; + short add_data(); + short add_data_property (in short data_id); + short get_data_count(); + short get_data_property_count (in short data_id); + void get_data_property (in short data_id, + in short property_id, + out string property_name, + out any property_value); + void set_data_property (in short data_id, + in short property_id, + in string property_name, + in any property_value); + void get_data (in short data_id, + out string data_name, + out any data_value); + void set_data (in short data_id, + in string data_name, + in any data_value); + }; +}; + +// CosPersistenceDS_CLI module, p 5-34 CORBAservices, +// Persistent Object Service V1.0, 3/94 + +// #include "CosPersistenceDDO.idl" +// CosPersistenceDDO.idl // #includes CosPersistencePID.idl + +module CosPersistenceDS_CLI { + interface UserEnvironment { + void set_option (in long option,in any value); + void get_option (in long option,out any value); + void release(); + }; + + interface Connection { + void set_option (in long option,in any value); + void get_option (in long option,out any value); + }; + + interface ConnectionFactory { + Connection create_object ( + in UserEnvironment user_envir); + }; + + interface Cursor { + void set_position (in long position,in any value); + ::COSS::CosPersistenceDDO::DDO fetch_object(); + }; + + interface CursorFactory { + Cursor create_object ( + in Connection connection); + }; + + interface PID_CLI : ::COSS::CosPersistencePID::PID { + attribute string datastore_id; + attribute string id; + }; + + + + interface Datastore_CLI { + void connect (in Connection connection, + in string datastore_id, + in string user_name, + in string authentication); + void disconnect (in Connection connection); + Connection get_connection ( + in string datastore_id, + in string user_name); + void add_object (in Connection connection, + in ::COSS::CosPersistenceDDO::DDO data_obj); + void delete_object ( + in Connection connection, + in ::COSS::CosPersistenceDDO::DDO data_obj); + void update_object ( + in Connection connection, + in ::COSS::CosPersistenceDDO::DDO data_obj); + void retrieve_object( + in Connection connection, + in ::COSS::CosPersistenceDDO::DDO data_obj); + Cursor select_object( + in Connection connection, + in string key); + void transact (in UserEnvironment user_envir, + in short completion_type); + void assign_PID (in PID_CLI p); + void assign_PID_relative ( + in PID_CLI source_pid, + in PID_CLI target_pid); + boolean is_identical_PID ( + in PID_CLI pid_1, + in PID_CLI pid_2); + string get_object_type (in PID_CLI p); + void register_mapping_schema (in string schema_file); + Cursor execute (in Connection connection, + in string command); + }; + +}; + + +// CosLifeCycle Module, p 6-10 CORBAservices, LifeCycle Service V1.0, 3/94 + +// #include "Naming.idl" + +module CosLifeCycle +{ + typedef ::COSS::CosNaming::Name Key; + typedef Object Factory; + typedef sequence <Factory> Factories; + typedef struct NVP { + ::COSS::CosNaming::Istring name; + any value; + } NameValuePair; + typedef sequence <NameValuePair> Criteria; + + exception NoFactory { + Key search_key; + }; + exception NotCopyable { string reason; }; + exception NotMovable { string reason; }; + exception NotRemovable { string reason; }; + exception InvalidCriteria{ + Criteria invalid_criteria; + }; + exception CannotMeetCriteria { + Criteria unmet_criteria; + }; + + + interface FactoryFinder { + Factories find_factories(in Key factory_key) + raises(NoFactory); + }; + + interface LifeCycleObject { + LifeCycleObject copy(in FactoryFinder there, + in Criteria the_criteria) + raises(NoFactory, NotCopyable, InvalidCriteria, + CannotMeetCriteria); + void move(in FactoryFinder there, + in Criteria the_criteria) + raises(NoFactory, NotMovable, InvalidCriteria, + CannotMeetCriteria); + void remove() + raises(NotRemovable); + }; + + interface GenericFactory { + boolean supports(in Key k); + Object create_object( + in Key k, + in Criteria the_criteria) + raises (NoFactory, InvalidCriteria, + CannotMeetCriteria); + }; +}; + + + +// LifeCycleService Module, p 6- 55 CORBAservices, Life Cycle +// Service V1.0, 3/94 + +// #include "LifeCycle.idl" + +module LifeCycleService { + + typedef sequence <::COSS::CosLifeCycle::NameValuePair> PolicyList; + typedef sequence <::COSS::CosLifeCycle::Key> Keys; + typedef sequence <::COSS::CosLifeCycle::NameValuePair> PropertyList; + typedef sequence <::COSS::CosNaming::NameComponent> NameComponents; + + interface LifeCycleServiceAdmin { + + attribute PolicyList policies; + + void bind_generic_factory( + in ::COSS::CosLifeCycle::GenericFactory gf, + in ::COSS::CosNaming::NameComponent name, + in Keys key_set, + in PropertyList other_properties) + raises (::COSS::CosNaming::NamingContext::AlreadyBound, ::COSS::CosNaming::NamingContext::InvalidName); + + void unbind_generic_factory( + in ::COSS::CosNaming::NameComponent name) + raises (::COSS::CosNaming::NamingContext::NotFound, ::COSS::CosNaming::NamingContext::InvalidName); + + ::COSS::CosLifeCycle::GenericFactory resolve_generic_factory( + in ::COSS::CosNaming::NameComponent name) + raises (::COSS::CosNaming::NamingContext::NotFound, ::COSS::CosNaming::NamingContext::InvalidName); + + NameComponents list_generic_factories(); + + boolean match_service (in ::COSS::CosLifeCycle::GenericFactory f); + + string get_hint(); + + void get_link_properties( + in ::COSS::CosNaming::NameComponent name, + out Keys key_set, + out PropertyList other_properties) + raises (::COSS::CosNaming::NamingContext::NotFound, ::COSS::CosNaming::NamingContext::InvalidName); + }; +}; + +// CosTransactions Module, p 10-66 +// CORBAservices, Transaction Service V1.0, 3/94 + +module CosTransactions { +// DATATYPES +enum Status { + StatusActive, + StatusMarkedRollback, + StatusPrepared, + StatusCommitted, + StatusRolledBack, + StatusUnknown, + StatusNoTransaction +}; + +enum Vote { + VoteCommit, + VoteRollback, + VoteReadOnly +}; + +// Standard exceptions +exception TransactionRequired {}; +exception TransactionRolledBack {}; +exception InvalidTransaction {}; + +// Heuristic exceptions +exception HeuristicRollback {}; +exception HeuristicCommit {}; +exception HeuristicMixed {}; +exception HeuristicHazard {}; + +// Exception from Orb operations +exception WrongTransaction {}; + +// Other transaction-specific exceptions +exception SubtransactionsUnavailable {}; +exception NotSubtransaction {}; +exception Inactive {}; +exception NotPrepared {}; +exception NoTransaction {}; +exception InvalidControl {}; +exception Unavailable {}; + +// Forward references for interfaces defined later in module +interface Control; +interface Terminator; +interface Coordinator; +interface Resource; +interface RecoveryCoordinator; +interface SubtransactionAwareResource; +interface TransactionFactory; +interface TransactionalObject; +interface Current; + +// Current transaction pseudo object (PIDL) + interface Current { + void begin() + raises(SubtransactionsUnavailable); + void commit(in boolean report_heuristics) + raises( + NoTransaction, + HeuristicMixed, + HeuristicHazard + ); + void rollback() + raises(NoTransaction); + void rollback_only() + raises(NoTransaction); + + Status get_status(); + string get_transaction_name(); + void set_timeout(in unsigned long seconds); + + Control get_control(); + Control suspend(); + void resume(in Control which) + raises(InvalidControl); + }; + + interface TransactionFactory { + Control create(in unsigned long time_out); + }; + + interface Control { + Terminator get_terminator() + raises(Unavailable); + Coordinator get_coordinator() + raises(Unavailable); + }; + + interface Terminator { + void commit(in boolean report_heuristics) + raises( + HeuristicMixed, + HeuristicHazard + ); + void rollback(); + }; + + + interface Coordinator { + + Status get_status(); + Status get_parent_status(); + Status get_top_level_status(); + + boolean is_same_transaction(in Coordinator tc); + boolean is_related_transaction(in Coordinator tc); + boolean is_ancestor_transaction(in Coordinator tc); + boolean is_descendant_transaction(in Coordinator tc); + boolean is_top_level_transaction(); + + unsigned long hash_transaction(); + unsigned long hash_top_level_tran(); + + RecoveryCoordinator register_resource(in Resource r) + raises(Inactive); + + void register_subtran_aware(in SubtransactionAwareResource r) + raises(Inactive, NotSubtransaction); + + void rollback_only() + raises(Inactive); + + string get_transaction_name(); + + Control create_subtransaction() + raises(SubtransactionsUnavailable, Inactive); + }; + + interface RecoveryCoordinator { + Status replay_completion(in Resource r) + raises(NotPrepared); + }; + +}; // end module CosTransactions + + +// CosConcurrency Control Module, p 7-8 CORBAservices, +// Concurrency Control Service V1.0, 3/94 + +// #include <CosTransactions.idl> +module CosConcurrencyControl { + + enum lock_mode { + read, + write, + upgrade, + intention_read, + intention_write + }; + + exception LockNotHeld{}; + + interface LockCoordinator + { + void drop_locks(); + }; + + interface LockSet + { + void lock(in lock_mode mode); + boolean try_lock(in lock_mode mode); + + void unlock(in lock_mode mode) + raises(LockNotHeld); + void change_mode(in lock_mode held_mode, + in lock_mode new_mode) + raises(LockNotHeld); + LockCoordinator get_coordinator( + in ::COSS::CosTransactions::Coordinator which); + }; + + interface TransactionalLockSet + { + void lock(in ::COSS::CosTransactions::Coordinator current, + in lock_mode mode); + boolean try_lock(in ::COSS::CosTransactions::Coordinator current, + in lock_mode mode); + void unlock(in ::COSS::CosTransactions::Coordinator current, + in lock_mode mode) + raises(LockNotHeld); + void change_mode(in ::COSS::CosTransactions::Coordinator current, + in lock_mode held_mode, + in lock_mode new_mode) + raises(LockNotHeld); + LockCoordinator get_coordinator( + in ::COSS::CosTransactions::Coordinator which); + }; + + interface LockSetFactory + { + LockSet create(); + LockSet create_related(in LockSet which); + TransactionalLockSet create_transactional(); + TransactionalLockSet create_transactional_related(in + TransactionalLockSet which); + }; +}; + +// CosObjectIdentity Module, p 9-19 CORBAservices, Relationship +// Service V1.0, 3/94 + + +module CosObjectIdentity { + + typedef unsigned long ObjectIdentifier; + + interface IdentifiableObject { + readonly attribute ObjectIdentifier constant_random_id; + boolean is_identical ( + in IdentifiableObject other_object); + }; + +}; + + +// CosRelationships Module, p 9-21 CORBAservices, Relationship +// Service V1.0, 3/94 + +// #include <ObjectIdentity.idl> + +module CosRelationships { + + interface RoleFactory; + interface RelationshipFactory; + interface Relationship; + interface Role; + interface RelationshipIterator; + + typedef Object RelatedObject; + typedef sequence<Role> Roles; + typedef string RoleName; + typedef sequence<RoleName> RoleNames; + + struct NamedRole {RoleName name; Role aRole;}; + typedef sequence<NamedRole> NamedRoles; + + struct RelationshipHandle { + Relationship the_relationship; + ::COSS::CosObjectIdentity::ObjectIdentifier constant_random_id; + }; + typedef sequence<RelationshipHandle> RelationshipHandles; + + interface RelationshipFactory { + struct NamedRoleType { + RoleName name; + ::CORBA::InterfaceDef named_role_type; + }; + typedef sequence<NamedRoleType> NamedRoleTypes; + readonly attribute ::CORBA::InterfaceDef relationship_type; + readonly attribute unsigned short degree; + readonly attribute NamedRoleTypes named_role_types; + exception RoleTypeError {NamedRoles culprits;}; + exception MaxCardinalityExceeded { + NamedRoles culprits;}; + exception DegreeError {unsigned short required_degree;}; + exception DuplicateRoleName {NamedRoles culprits;}; + exception UnknownRoleName {NamedRoles culprits;}; + + Relationship create (in NamedRoles named_roles) + raises (RoleTypeError, + MaxCardinalityExceeded, + DegreeError, + DuplicateRoleName, + UnknownRoleName); + }; + + interface Relationship : + ::COSS::CosObjectIdentity::IdentifiableObject { + exception CannotUnlink { + Roles offending_roles; + }; + readonly attribute NamedRoles named_roles; + void destroy () raises(CannotUnlink); + }; + + interface Role { + exception UnknownRoleName {}; + exception UnknownRelationship {}; + exception RelationshipTypeError {}; + exception CannotDestroyRelationship { + RelationshipHandles offenders; + }; + exception ParticipatingInRelationship { + RelationshipHandles the_relationships; + }; + readonly attribute RelatedObject related_object; + RelatedObject get_other_related_object ( + in RelationshipHandle rel, + in RoleName target_name) + raises (UnknownRoleName, + UnknownRelationship); + Role get_other_role (in RelationshipHandle rel, + in RoleName target_name) + raises (UnknownRoleName, UnknownRelationship); + void get_relationships ( + in unsigned long how_many, + out RelationshipHandles rels, + out RelationshipIterator iterator); + void destroy_relationships() + raises(CannotDestroyRelationship); + void destroy() raises(ParticipatingInRelationship); + boolean check_minimum_cardinality (); + void link (in RelationshipHandle rel, + in NamedRoles named_roles) + raises(RelationshipFactory::MaxCardinalityExceeded, + RelationshipTypeError); + void unlink (in RelationshipHandle rel) + raises (UnknownRelationship); + }; + + interface RoleFactory { + exception NilRelatedObject {}; + exception RelatedObjectTypeError {}; + readonly attribute ::CORBA::InterfaceDef role_type; + readonly attribute unsigned long max_cardinality; + readonly attribute unsigned long min_cardinality; +// the following isn't allowed in IDL, +// readonly attribute sequence <::CORBA::InterfaceDef> related_object_types; + typedef sequence <::CORBA::InterfaceDef> InterfaceDefSeq; + readonly attribute InterfaceDefSeq related_object_types; + Role create_role (in RelatedObject related_object) + raises (NilRelatedObject, RelatedObjectTypeError); + }; + + interface RelationshipIterator { + boolean next_one (out RelationshipHandle rel); + boolean next_n (in unsigned long how_many, + out RelationshipHandles rels); + void destroy (); + }; + +}; + +// CosCompoundExternalization Module, p 8-20 CORBAservices, +// Externalization Service V1.0, 3/94 + +// #include <Graphs.idl> +// #include <Stream.idl> + +// CosGraphs Module, p 9-39 CORBAservices, Relationship Service +// V1.0, 3/94 + +// #include <Relationships.idl> +// #include <ObjectIdentity.idl> + +module CosGraphs { + + interface TraversalFactory; + interface Traversal; + interface TraversalCriteria; + interface Node; + interface NodeFactory; + interface Role; + interface EdgeIterator; + + struct NodeHandle { + Node the_node; + ::COSS::CosObjectIdentity::ObjectIdentifier constant_random_id; + }; + typedef sequence<NodeHandle> NodeHandles; + + struct NamedRole { + Role the_role; + ::COSS::CosRelationships::RoleName the_name; + }; + typedef sequence<NamedRole> NamedRoles; + + struct EndPoint { + NodeHandle the_node; + NamedRole the_role; + }; + typedef sequence<EndPoint> EndPoints; + + struct Edge { + EndPoint from; + ::COSS::CosRelationships::RelationshipHandle the_relationship; + EndPoints relatives; + }; + typedef sequence<Edge> Edges; + + enum PropagationValue {deep, shallow, none, inhibit}; + enum Mode {depthFirst, breadthFirst, bestFirst}; + + interface TraversalFactory { + Traversal create_traversal_on ( + in NodeHandle root_node, + in TraversalCriteria the_criteria, + in Mode how); + }; + + interface Traversal { + typedef unsigned long TraversalScopedId; + struct ScopedEndPoint { + EndPoint point; + TraversalScopedId id; + }; + typedef sequence<ScopedEndPoint> ScopedEndPoints; + struct ScopedRelationship { + ::COSS::CosRelationships::RelationshipHandle + scoped_relationship; + TraversalScopedId id; + }; + struct ScopedEdge { + ScopedEndPoint from; + ScopedRelationship the_relationship; + ScopedEndPoints relatives; + }; + typedef sequence<ScopedEdge> ScopedEdges; + boolean next_one (out ScopedEdge the_edge); + boolean next_n (in short how_many, + out ScopedEdges the_edges); + void destroy (); + }; + + interface TraversalCriteria { + struct WeightedEdge { + Edge the_edge; + unsigned long weight; + sequence<NodeHandle> next_nodes; + }; + typedef sequence<WeightedEdge> WeightedEdges; + void visit_node(in NodeHandle a_node, + in Mode search_mode); + boolean next_one (out WeightedEdge the_edge); + boolean next_n (in short how_many, + out WeightedEdges the_edges); + void destroy(); + }; + + interface Node: ::COSS::CosObjectIdentity::IdentifiableObject { + typedef sequence<Role> Roles; + exception NoSuchRole {}; + exception DuplicateRoleType {}; + + readonly attribute ::COSS::CosRelationships::RelatedObject + related_object; + readonly attribute Roles roles_of_node; + Roles roles_of_type ( + in ::CORBA::InterfaceDef role_type); + void add_role (in Role a_role) + raises (DuplicateRoleType); + void remove_role (in ::CORBA::InterfaceDef of_type) + raises (NoSuchRole); + }; + + interface NodeFactory { + Node create_node (in Object related_object); + }; + + interface Role : ::COSS::CosRelationships::Role { + void get_edges ( in long how_many, + out Edges the_edges, + out EdgeIterator the_rest); + }; + + interface EdgeIterator { + boolean next_one (out Edge the_edge); + boolean next_n ( in unsigned long how_many, + out Edges the_edges); + void destroy (); + }; + +}; + + + +// CosStream Module, 8-15 CORBAservices, +// Externalization Service V1.0, 3/94 + +// #include <LifeCycle.idl> +// #include <ObjectIdentity.idl> +// #include <CompoundExternalization.idl> +module CosStream { + exception ObjectCreationError{}; + exception StreamDataFormatError{}; + interface StreamIO; + + interface Streamable: ::COSS::CosObjectIdentity::IdentifiableObject + { + readonly attribute ::COSS::CosLifeCycle::Key external_form_id; + void externalize_to_stream( + in StreamIO targetStreamIO); + void internalize_from_stream( + in StreamIO sourceStreamIO, + in ::COSS::CosLifeCycle::FactoryFinder there) + raises( ::COSS::CosLifeCycle::NoFactory, + ObjectCreationError, + StreamDataFormatError ); + }; + + interface StreamableFactory { + Streamable create_uninitialized(); + }; + + + interface StreamIO { + void write_string(in string aString); + void write_char(in char aChar); + void write_octet(in octet anOctet); + void write_unsigned_long( + in unsigned long anUnsignedLong); + void write_unsigned_short( + in unsigned short anUnsignedShort); + void write_long(in long aLong); + void write_short(in short aShort); + void write_float(in float aFloat); + void write_double(in double aDouble); + void write_boolean(in boolean aBoolean); + void write_object(in Streamable aStreamable); + // void write_graph(in ::COSS::CosCompoundExternalization::Node aNode); + string read_string() + raises(StreamDataFormatError); + char read_char() + raises(StreamDataFormatError ); + octet read_octet() + raises(StreamDataFormatError ); + unsigned long read_unsigned_long() + raises(StreamDataFormatError ); + unsigned short read_unsigned_short() + raises( StreamDataFormatError ); + long read_long() + raises(StreamDataFormatError ); + short read_short() + raises(StreamDataFormatError ); + float read_float() + raises(StreamDataFormatError ); + double read_double() + raises(StreamDataFormatError ); + boolean read_boolean() + raises(StreamDataFormatError ); + Streamable read_object( + in ::COSS::CosLifeCycle::FactoryFinder there, + in Streamable aStreamable) + raises(StreamDataFormatError ); +// void read_graph( +// in ::COSS::CosCompoundExternalization::Node starting_node, +// in ::COSS::CosLifeCycle::FactoryFinder there) +// raises(StreamDataFormatError ); + }; +}; + +module CosCompoundExternalization { + interface Node; + interface Role; + interface Relationship; + interface PropagationCriteriaFactory; + + struct RelationshipHandle { + Relationship theRelationship; + ::COSS::CosObjectIdentity::ObjectIdentifier constantRandomId; + }; + + interface Node : ::COSS::CosGraphs::Node, ::COSS::CosStream::Streamable{ + void externalize_node (in ::COSS::CosStream::StreamIO sio); + void internalize_node (in ::COSS::CosStream::StreamIO sio, + in ::COSS::CosLifeCycle::FactoryFinder there, + out ::COSS::CosGraphs::Node::Roles rolesOfNode) + raises (::COSS::CosLifeCycle::NoFactory); + }; + + interface Role : ::COSS::CosGraphs::Role { + void externalize_role (in ::COSS::CosStream::StreamIO sio); + void internalize_role (in ::COSS::CosStream::StreamIO sio); + ::COSS::CosGraphs::PropagationValue externalize_propagation ( + in RelationshipHandle rel, + in ::COSS::CosRelationships::RoleName toRoleName, + out boolean sameForAll); + }; + + interface Relationship : + ::COSS::CosRelationships::Relationship { + void externalize_relationship ( + in ::COSS::CosStream::StreamIO sio); + void internalize_relationship( + in ::COSS::CosStream::StreamIO sio, + in ::COSS::CosGraphs::NamedRoles newRoles); + ::COSS::CosGraphs::PropagationValue externalize_propagation ( + in ::COSS::CosRelationships::RoleName fromRoleName, + in ::COSS::CosRelationships::RoleName toRoleName, + out boolean sameForAll); + }; + + interface PropagationCriteriaFactory { + ::COSS::CosGraphs::TraversalCriteria create_for_externalize( ); + }; + +}; + +// CosExternalization Module, 8-12 CORBAservices, +// Externalization Service V1.0, 3/94 + + +// #include <LifeCycle.idl> +// #include <Stream.idl> +module CosExternalization { + exception InvalidFileNameError{}; + exception ContextAlreadyRegistered{}; + interface Stream: ::COSS::CosLifeCycle::LifeCycleObject{ + void externalize( + in ::COSS::CosStream::Streamable theObject); + ::COSS::CosStream::Streamable internalize( + in ::COSS::CosLifeCycle::FactoryFinder there) + raises( ::COSS::CosLifeCycle::NoFactory, + ::COSS::CosStream::StreamDataFormatError ); + void begin_context() + raises( ContextAlreadyRegistered); + void end_context(); + void flush(); + }; + interface StreamFactory { + Stream create(); + }; + interface FileStreamFactory { + Stream create( + in string theFileName) + raises( InvalidFileNameError ); + }; +}; + +// CosContainment Module, p 9- 48 CORBAservices, Relationship +// Service V1.0, 3/94 + +// #include <Graphs.idl> + +module CosContainment { + + interface Relationship : + ::COSS::CosRelationships::Relationship {}; + + interface ContainsRole : ::COSS::CosGraphs::Role {}; + + interface ContainedInRole : ::COSS::CosGraphs::Role {}; + +}; + +// CosExternalizationContainment Module, p 8-26 CORBAservices, +// Externalization Service V1.0, 3/94 + +// #include <Containment.idl> +// #include <CompoundExternalization.idl> + +module CosExternalizationContainment { + + interface Relationship : + ::COSS::CosCompoundExternalization::Relationship, + ::COSS::CosContainment::Relationship {}; + + interface ContainsRole : + ::COSS::CosCompoundExternalization::Role, + ::COSS::CosContainment::ContainsRole {}; + + interface ContainedInRole : + ::COSS::CosCompoundExternalization::Role, + ::COSS::CosContainment::ContainedInRole {}; +}; + +// CosReference Module, p 9-50 CORBAservices, +// Relationship Service V1.0, 3/94 + +// #include <Graphs.idl> + +module CosReference { + + interface Relationship : + ::COSS::CosRelationships::Relationship {}; + + interface ReferencesRole : ::COSS::CosGraphs::Role {}; + + interface ReferencedByRole : ::COSS::CosGraphs::Role {}; + +}; + +// CosExternalizationReference Module, p 8-28 CORBAservices, +// Externalization Service V1.0, 3/94 + +// #include <Reference.idl> +// #include <CompoundExternalization.idl> + +module CosExternalizationReference { + + interface Relationship : + ::COSS::CosCompoundExternalization::Relationship, + ::COSS::CosReference::Relationship {}; + + interface ReferencesRole : + ::COSS::CosCompoundExternalization::Role, + ::COSS::CosReference::ReferencesRole {}; + + interface ReferencedByRole : + ::COSS::CosCompoundExternalization::Role, + ::COSS::CosReference::ReferencedByRole {}; +}; + +// PIDL for CosTSInteroperation Module, p 10-59 +// CORBAservices, Transaction Service V1.0, 3/94 +module CosTSInteroperation { // PIDL + struct otid_t { + long formatID; /*format identifier. 0 is OSI TP */ + long bequal_length; + sequence <octet> tid; + }; + struct TransIdentity { + ::COSS::CosTransactions::Coordinator coordinator; + ::COSS::CosTransactions::Terminator terminator; + otid_t otid; + }; + struct PropagationContext { + unsigned long timeout; + TransIdentity current; + sequence <TransIdentity> parents; + any implementation_specific_data; + }; +}; + +// PIDL for CosTSPortability Module, p 10-63 +// CORBAservices, Transaction Service V1.0, 3/94 + +module CosTSPortability { // PIDL + typedef long ReqId; + + interface Sender { + void sending_request(in ReqId id, + out ::COSS::CosTSInteroperation::PropagationContext ctx); + void received_reply(in ReqId id, + in ::COSS::CosTSInteroperation::PropagationContext ctx, + in ::CORBA::Environment env); + }; + + interface Receiver { + void received_request(in ReqId id, + in ::COSS::CosTSInteroperation::PropagationContext ctx); + void sending_reply(in ReqId id, + out::COSS::CosTSInteroperation::PropagationContext ctx); + }; +}; + +// CosCompoundLifeCycle Module, p 6-30 CORBAservices, +// Life Cycle Service V1.0, 3/94 + +// #include <LifeCycle.idl> +// #include <Relationships.idl> +// #include <Graphs.idl> + +module CosCompoundLifeCycle { + interface OperationsFactory; + interface Operations; + interface Node; + interface Role; + interface Relationship; + interface PropagationCriteriaFactory; + + enum Operation {copy, move, remove}; + + struct RelationshipHandle { + Relationship the_relationship; + ::COSS::CosObjectIdentity::ObjectIdentifier constant_random_id; + }; + + interface OperationsFactory { + Operations create_compound_operations(); + }; + + interface Operations { + Node copy ( + in Node starting_node, + in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotCopyable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void move ( + in Node starting_node, + in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotMovable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void remove (in Node starting_node) + raises (::COSS::CosLifeCycle::NotRemovable); + void destroy(); + }; + + interface Node : ::COSS::CosGraphs::Node { + exception NotLifeCycleObject {}; + void copy_node ( in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria, + out Node new_node, + out ::COSS::CosGraphs::Node::Roles roles_of_new_node) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotCopyable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void move_node (in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotMovable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void remove_node () + raises (::COSS::CosLifeCycle::NotRemovable); + ::COSS::CosLifeCycle::LifeCycleObject get_life_cycle_object() + raises (NotLifeCycleObject); + }; + + interface Role : ::COSS::CosGraphs::Role { + Role copy_role (in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotCopyable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void move_role (in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotMovable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + ::COSS::CosGraphs::PropagationValue life_cycle_propagation ( + in Operation op, + in RelationshipHandle rel, + in ::COSS::CosRelationships::RoleName to_role_name, + out boolean same_for_all); + }; + + interface Relationship : + ::COSS::CosRelationships::Relationship { + Relationship copy_relationship ( + in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria, + in ::COSS::CosGraphs::NamedRoles new_roles) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotCopyable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + void move_relationship ( + in ::COSS::CosLifeCycle::FactoryFinder there, + in ::COSS::CosLifeCycle::Criteria the_criteria) + raises (::COSS::CosLifeCycle::NoFactory, + ::COSS::CosLifeCycle::NotMovable, + ::COSS::CosLifeCycle::InvalidCriteria, + ::COSS::CosLifeCycle::CannotMeetCriteria); + ::COSS::CosGraphs::PropagationValue life_cycle_propagation ( + in Operation op, + in ::COSS::CosRelationships::RoleName from_role_name, + in ::COSS::CosRelationships::RoleName to_role_name, + out boolean same_for_all); + }; + + interface PropagationCriteriaFactory { + ::COSS::CosGraphs::TraversalCriteria create(in Operation op); + }; + +}; + +// CosLifeCycleContainment Module, p 6-42 CORBAservices, +// Life Cycle Service V1.0, 3/94 + +// #include <Containment.idl> +// #include <CompoundLifeCycle.idl> + +module CosLifeCycleContainment { + + interface Relationship : + ::COSS::CosCompoundLifeCycle::Relationship, + ::COSS::CosContainment::Relationship {}; + + interface ContainsRole : + ::COSS::CosCompoundLifeCycle::Role, + ::COSS::CosContainment::ContainsRole {}; + + interface ContainedInRole : + ::COSS::CosCompoundLifeCycle::Role, + ::COSS::CosContainment::ContainedInRole {}; +}; + +// CosLifeCycleReference Module, p 6-44 CORBAservices, +// Life Cycle Service V1.0, 3/94 + +// #include <Reference.idl> +// #include <CompoundLifeCycle.idl> + +module CosLifeCycleReference { + + interface Relationship : + ::COSS::CosCompoundLifeCycle::Relationship, + ::COSS::CosReference::Relationship {}; + + interface ReferencesRole : + ::COSS::CosCompoundLifeCycle::Role, + ::COSS::CosReference::ReferencesRole {}; + + interface ReferencedByRole : + ::COSS::CosCompoundLifeCycle::Role, + ::COSS::CosReference::ReferencedByRole {}; +}; + + +}; // end module COSS diff --git a/lib/ic/test/ic_SUITE_data/attr.idl b/lib/ic/test/ic_SUITE_data/attr.idl new file mode 100644 index 0000000000..c74223eca6 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/attr.idl @@ -0,0 +1,29 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +interface I1 { + attribute long a1, a2; + attribute char a3; +}; + +interface I2 : I1 { + attribute short a4; + readonly attribute char a5; +}; + diff --git a/lib/ic/test/ic_SUITE_data/c_err1.idl b/lib/ic/test/ic_SUITE_data/c_err1.idl new file mode 100644 index 0000000000..e1bc93dae8 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/c_err1.idl @@ -0,0 +1,63 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// This file forces the bad_tk_match. This triggers when the type of +// the expression does not match the declared type of the constant +// + +const long c1 = TRUE; +const unsigned short c1b= TRUE; +const boolean c2 = +5; +const long c3 = 'c'; +const float c5 = 3; +const unsigned long c6 = -2; // Maybe not checked in compiler or suite + +const boolean c4 = 1 | 2; + + +// Now define some correct constants for use in reference checking + +const long longC = -9; +const short shortC = -9; +const unsigned long ulongC = 1; +const unsigned short ushortC = 0; + +const float floatC = 5.1; +const double doubleC = -2.111; + +const boolean boolC = TRUE; + +const char charC = 'f'; +const string stringC = "hej"; +const string<9> stringCb = "hejdu"; + +// Check the reference errors + +const long c19 = floatC; +const short c20 = doubleC; +const unsigned long c21 = charC; +const unsigned short c22 = stringC; +const float c23 = stringCb; +const double c24 = boolC; +const boolean c25 = longC; +const char c26 = shortC; +const string c27 = ushortC; +const string<9> c28 = ulongC; +const long c29 = 3+floatC; diff --git a/lib/ic/test/ic_SUITE_data/c_err2.idl b/lib/ic/test/ic_SUITE_data/c_err2.idl new file mode 100644 index 0000000000..8dac241c7f --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/c_err2.idl @@ -0,0 +1,30 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Checks bad type of operands +// + + +const long c1 = 1 + TRUE; +const boolean c3 = TRUE | FALSE | 19.8; +const long c4 = 1 << TRUE; +const long c5 = TRUE >> TRUE; + + diff --git a/lib/ic/test/ic_SUITE_data/c_err3.idl b/lib/ic/test/ic_SUITE_data/c_err3.idl new file mode 100644 index 0000000000..dde9539f6f --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/c_err3.idl @@ -0,0 +1,28 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Checks ill-formed expressions (type conflict in operands) +// + + +const long c1 = 5|TRUE; +const long c2 = 5&TRUE; +const long c3 = 5^TRUE; + diff --git a/lib/ic/test/ic_SUITE_data/c_norm.idl b/lib/ic/test/ic_SUITE_data/c_norm.idl new file mode 100644 index 0000000000..6f6ef8ff79 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/c_norm.idl @@ -0,0 +1,163 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Check normal values and expressions for constants +// + +// Integer types +const long co1 = 077; +const long ch1 = 0xf1; +const long ch2 = 0XAB; +const long c1 = 1; +const short c2 = 3; +const unsigned long c3 = 1; +const unsigned short c4 = 3; + +// Unary ops +const long c1hb = -0x1; +const long c1b = -1; +const short c2b = -3; +const long c1c = +1; +const short c2c = +3; +// ~ not supported + +// Check binary ops +const long c1d = 9+1-3; +const long c1hd = 9+1-0xf3; +const short c2d = 7+3; +const short c2e = 7*3; +const long c1e = 1 | 7; +const long c1f = 7 & 9; +const long c1g = (1 | 7) & 9; +const long c1h = 1^7; + +//floats +const float c5 = 1.9; +const double c6 = 1.9; +const float c5b = -1.9; +const double c6b = -1.9; + +// Check type operand casting +const float c5c = 1/(9+2) * 2; +const double c6c = 1.9-1; +//const double c6d = 1; // Does not work yet + +// Booleans and expressions +const boolean c7 = TRUE; +const boolean c7b = FALSE; +const boolean c7c = TRUE | FALSE; +const boolean c7d = TRUE & FALSE; +const boolean c7e = TRUE&TRUE | FALSE&TRUE; +const boolean c7f = TRUE&TRUE ^ FALSE&TRUE; + +// Character and string +const char c8 = 'c'; +const char c8b = '\n'; +const string c9 = "hej"; +const string<9> c9b = "hejdu"; + + +// +// Check that value references work +// + +const long rc1 = c1g; +const long rc1h = c1h + 9; +const short rc2 = c2; +const unsigned long rc3 = c3; +const unsigned short rc4 = c4; + + +const float rc5c = c5c; +const double rc6c = c6c; +const double rc6d = c6c+1.3; + +const boolean rc7 = c7; +const boolean rc7c = c7c | TRUE; + +const char rc8 = c8; +const char rc8b = c8b; +const string rc9 = c9; +const string<9> rc9b = c9b; + + + + +// +// Now check that all typerefs work +// + +typedef long longT; +typedef short shortT; +typedef unsigned long ulongT; +typedef unsigned short ushortT; + +typedef float floatT; +typedef double doubleT; + +typedef char charT; +typedef string stringT; + +typedef boolean booleanT; + +const longT cc1 = 1; +const shortT cc2 = 3; +const ::longT cc1b = -1; +const ::shortT cc2b = -3; + +const floatT cc5 = 1.9; +const doubleT cc6 = 1.9; +const floatT cc5b = -1.9; +const doubleT cc6b = -1.9; +const floatT cc5c = 1/(9+2) * 2; +const doubleT cc6c = 1.9-1; + +const booleanT cc7 = TRUE; +const booleanT cc7b = TRUE; +const booleanT cc7c = TRUE | FALSE; +const booleanT cc7d = TRUE & FALSE; +const booleanT cc7e = TRUE&TRUE | FALSE&TRUE; + + +const charT cc8 = 'c'; +const charT cc8b = '\n'; +const stringT cc9 = "hej"; +const stringT cc9b = "hejdu"; + + +// +// Check value casting +// +const long longC = -9; +const short shortC = -9; +const unsigned long ulongC = 1; +const unsigned short ushortC = 0; + +const float floatC = 5.1; +const double doubleC = -2.111; + +const long c20 = shortC; +const long c21 = ulongC; +const long c22 = ushortC; +const short c23 = ushortC; +const double c34 = floatC; + + + diff --git a/lib/ic/test/ic_SUITE_data/enum.idl b/lib/ic/test/ic_SUITE_data/enum.idl new file mode 100644 index 0000000000..c164e4bf74 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/enum.idl @@ -0,0 +1,32 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +enum E1 {kalle, sune}; + +enum E2 { el0, el1, el2, el3, el4, el5, el6, el7, el8, el9, el10, el11, el12, el13, +el14, el15, el16, el17, el18, el19, el20, el21, el22, el23, el24, el25, el26, el27, +el28, el29, el30, el31, el32, el33, el34, el35, el36, el37, el38, el39, el40, el41, +el42, el43, el44, el45, el46, el47, el48, el49, el50, el51, el52, el53, el54, el55, +el56, el57, el58, el59}; + + + + + diff --git a/lib/ic/test/ic_SUITE_data/forward.idl b/lib/ic/test/ic_SUITE_data/forward.idl new file mode 100644 index 0000000000..1e16265af5 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/forward.idl @@ -0,0 +1,34 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Check that forward declarations are handled correctly +// + + +interface i1; + + +interface i1 { + typedef long T; +}; + + +interface i1; + diff --git a/lib/ic/test/ic_SUITE_data/include.idl b/lib/ic/test/ic_SUITE_data/include.idl new file mode 100644 index 0000000000..24022bfa1e --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/include.idl @@ -0,0 +1,30 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Check that errors are given with the correct file name reference + +#include "include2.idl" + + +typedef T1 T7; +typedef long T7; +typedef long T111; + + + diff --git a/lib/ic/test/ic_SUITE_data/include2.idl b/lib/ic/test/ic_SUITE_data/include2.idl new file mode 100644 index 0000000000..2f8f7fd62c --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/include2.idl @@ -0,0 +1,26 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Check that errors are given with the correct file name reference + +#include "include3.idl" + + +typedef T7 T1; + diff --git a/lib/ic/test/ic_SUITE_data/include3.idl b/lib/ic/test/ic_SUITE_data/include3.idl new file mode 100644 index 0000000000..c5f89c6c63 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/include3.idl @@ -0,0 +1,25 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Check that errors are given with the correct file name reference + +typedef T7 T1; + + + diff --git a/lib/ic/test/ic_SUITE_data/inherit.idl b/lib/ic/test/ic_SUITE_data/inherit.idl new file mode 100644 index 0000000000..71b79c8748 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/inherit.idl @@ -0,0 +1,68 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +interface I1 { + typedef long T1; + typedef struct S1 {long a; boolean b;} T2; + typedef string StringT, StringT_arr[10]; + + T1 op1( in StringT a, inout char b, out StringT_arr c ); + T2 op2( in char a, inout char b, out StringT_arr c ); + + const T1 LongC = 10; + const StringT StringC = "Hola bambino"; + +}; + + +interface I2 : I1 { + T1 op3( in long a); + + const long c1 = LongC; + const string c2 = StringC; +}; + +interface I3 : I1 {}; + +interface I4 : I3, I2 {}; // Check that branced inherit works + + + +// Now use cnstants to check that inheritance works as expected + +module m1 { + interface I1 { + typedef long T1; + + const T1 c1 = 9; + }; + + interface I2 : I1 { + const T1 c2 = c1+5; // c2 = 14 + const long c3 = c2+c1+4; // c3 = 27 + }; + + interface I3 : I2, I1 { + const long c1 = 50; // Overrides I1::c1 + const T1 c4 = c1+c2+c3; // c4=91 + const T1 c5 = I1::c1+c1+c2+c3; // 100 + }; +}; + diff --git a/lib/ic/test/ic_SUITE_data/inherit_err.idl b/lib/ic/test/ic_SUITE_data/inherit_err.idl new file mode 100644 index 0000000000..4cfc3ffbff --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/inherit_err.idl @@ -0,0 +1,71 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Ops and attributes must not be redefined (shadowed) + +interface I1 { + long op1( in long a, inout char b, out boolean c ); + long op2( in char a, inout char b, out boolean c ); + attribute long a1, a2; + readonly attribute char a3; +}; + +interface I2 : I1 { + long op1( in float a, inout char b, out boolean c ); + long op2( in char a, inout char b, out boolean c ); + attribute long a1, a2; + readonly attribute char a3; +}; + +interface I3 : I1 { + long op3 (in string<19> b); +}; + + +interface I4 : I3 { + long op1( in float a, inout char b, out boolean c ); + long op2( in char a, inout char b, out boolean c ); + attribute long a1, a2; + readonly attribute char a3; + + long op3 (in string<19> b); +}; + + +interface I11 { + long op1( in float a, inout char b, out boolean c ); + long op2( in char a, inout char b, out boolean c ); + attribute long a1, a2; + readonly attribute char a3; +}; + + + +interface I5 : I1, I11 {}; + +interface I6 : I1 { + const long op1=0; + const long op2=0; + const long a1=0; + const long a2=0; + const long a3=0; +}; + + diff --git a/lib/ic/test/ic_SUITE_data/inherit_warn.idl b/lib/ic/test/ic_SUITE_data/inherit_warn.idl new file mode 100644 index 0000000000..502bfac8d4 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/inherit_warn.idl @@ -0,0 +1,64 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Checks that shadow warnings comes out as expected +// + + +interface I1 { + typedef long T1; + typedef struct S1 {long a; boolean b;} T2; + typedef string StringT, StringT_arr[10]; + + T1 op1( in StringT a, inout char b, out StringT_arr c ); + T2 op2( in char a, inout char b, out StringT_arr c ); + + const T1 LongC = 10; + const StringT StringC = "Hola bambino"; + +}; + + +interface I2 : I1 { + typedef char T1; // Shadows I1::T1 + const boolean StringC = FALSE; // shadows I1::StringC + + T1 op3( in long a); + + const long c1 = LongC; + const boolean c2 = StringC; +}; + +interface I3 : I2 {}; // More shadows + +interface I4 : I1 { + T1 op4(); + const T1 c2 = 66; +}; + +interface I5 : I4 { + typedef string T1; // Shadows I1::T1 + const char LongC = 'a'; // Shadows I1::LongC +}; + + +interface I6 : I4, I3 { +}; + diff --git a/lib/ic/test/ic_SUITE_data/mult_ids.idl b/lib/ic/test/ic_SUITE_data/mult_ids.idl new file mode 100644 index 0000000000..46deaa9f55 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/mult_ids.idl @@ -0,0 +1,92 @@ + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +// +// Check that multiply defined identifiers are detected +// + +typedef long T1; +typedef long T1; +typedef long T2; +exception T2 {}; + + +//Exceptions +exception Exc1 {}; +exception Exc1 {}; + + +// Enums +enum E1 {kalle}; +enum E1 {kalle}; +enum E2 {kalle, sune, kalle}; + + +// Structs +struct S1 {long a;}; +struct S1 {long a;}; +struct S2 {long a; short a;}; +struct S3 {long a,b; short a;}; +struct S4 {long a,a; short a;}; + + +// Constants +const long c1 = 0; +const long c1 = 0; + + +// Interfaces + +interface i1 {}; +interface i1 {}; + +interface i2 { + attribute long a1; + attribute long a1; +}; + +interface i3 { + attribute long a1, a2; + attribute long a2; +}; + +interface i4 { + attribute long a1, a1; +}; + +interface i5 { + long op1(); + long op1(); + + long op2(in long a, inout char a); +}; + + +// Unions + +union U1 switch (long) {case 1: long a;}; +union U1 switch (long) {case 1: long a;}; + +union U2 switch (long) { +case 1: long a; +default: char a; +}; + + + + + diff --git a/lib/ic/test/ic_SUITE_data/nasty.idl b/lib/ic/test/ic_SUITE_data/nasty.idl new file mode 100644 index 0000000000..15fd523c0f --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/nasty.idl @@ -0,0 +1,60 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Checks nasty name collisions +// + +typedef string T; + + +#define nasty01 version +#define nasty02 preproc +#define nasty03 pragma +#define nasty04 compile +#define nasty05 if +#define nasty06 receive +#define nasty07 foldr +#define nasty08 length +#define nasty09 ID + +interface I1 { + attribute T nasty01; + attribute T nasty02; + attribute T nasty03; + attribute T nasty04; + attribute T nasty05; + attribute T nasty06; + attribute T nasty07; + attribute T nasty08; + attribute T nasty09; +}; + +interface I2 { + T nasty01(); + T nasty02(); + T nasty03(); + T nasty04(); + T nasty05(); + T nasty06(); + T nasty07(); + T nasty08(); + T nasty09(); +}; + diff --git a/lib/ic/test/ic_SUITE_data/one.idl b/lib/ic/test/ic_SUITE_data/one.idl new file mode 100644 index 0000000000..99281d6079 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/one.idl @@ -0,0 +1,29 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Test oneway operations + +interface I1 { + long op1(in char a, inout boolean b, out string c); + oneway void op2(in char a, in boolean b, in string c); + oneway void op3(); +}; + + + diff --git a/lib/ic/test/ic_SUITE_data/one_followed.idl b/lib/ic/test/ic_SUITE_data/one_followed.idl new file mode 100644 index 0000000000..da8ee74e25 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/one_followed.idl @@ -0,0 +1,54 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1998-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Test oneway operations followed by other operations + +interface I1 { + oneway void op1(); + oneway void op2(in char a, in boolean b, in string c); + long op3(in char a, inout boolean b, out string c); +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/ic/test/ic_SUITE_data/one_out.idl b/lib/ic/test/ic_SUITE_data/one_out.idl new file mode 100644 index 0000000000..65f177ff22 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/one_out.idl @@ -0,0 +1,28 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Test oneway operations not using in out params + +interface I1 { + oneway void op1(in char a, inout boolean b, in string c); + oneway void op2(in char a, out boolean b, in string c); +}; + + + diff --git a/lib/ic/test/ic_SUITE_data/one_raises.idl b/lib/ic/test/ic_SUITE_data/one_raises.idl new file mode 100644 index 0000000000..8290877363 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/one_raises.idl @@ -0,0 +1,32 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Test oneway operations not using in out params + +exception hell {boolean burn; unsigned long for_how_long;}; +exception high_water {long mark;}; + +interface I1 { + oneway void op1(in char a) raises (hell); + oneway void op2(in char a) raises (hell); + oneway void op3() raises (hell, high_water); +}; + + + diff --git a/lib/ic/test/ic_SUITE_data/one_void.idl b/lib/ic/test/ic_SUITE_data/one_void.idl new file mode 100644 index 0000000000..e1d51c7abb --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/one_void.idl @@ -0,0 +1,30 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Test oneway operations not using in out params + +typedef long T; + +interface I1 { + oneway char op1(in char a); + oneway T op2(in char a); +}; + + + diff --git a/lib/ic/test/ic_SUITE_data/raises_reg.idl b/lib/ic/test/ic_SUITE_data/raises_reg.idl new file mode 100644 index 0000000000..d4458811dc --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/raises_reg.idl @@ -0,0 +1,52 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1998-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +#ifndef _RAISES_REG_IDL +#define _RAISES_REG_IDL + +module Raises_RegModule { + + exception Exception_1 {}; + + exception Exception_2 {}; + + interface R_R { + + void op() + raises(Raises_RegModule::Exception_1,Raises_RegModule::Exception_2); + + }; + +}; + +#endif + + + + + + + + + + + + + + + diff --git a/lib/ic/test/ic_SUITE_data/struct.idl b/lib/ic/test/ic_SUITE_data/struct.idl new file mode 100644 index 0000000000..337ee170e3 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/struct.idl @@ -0,0 +1,53 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +struct S1 { + long a; + char b; + string<9> s; +}; + +struct S2 { + long a; + struct S3 { + long a; + short b, b1; + char c; + } b; + sequence <S1> c, c2, c3, c4, c5, c6, c7; +}; + + +// Check that structs are detected down in other types + + +typedef struct s4 {long a;} T1; +union U1 switch (long) { +case 1: + struct S5 {unsigned short a;} a; +case 2: + union U2 switch (char) { + case 'a': + boolean a; + case 'b': + struct s6 {long a; boolean b;} c; + } b; +}; + diff --git a/lib/ic/test/ic_SUITE_data/syntax1.idl b/lib/ic/test/ic_SUITE_data/syntax1.idl new file mode 100644 index 0000000000..83c7de7943 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax1.idl @@ -0,0 +1,28 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Check syntax errors +// + + +typedef long T1 _; + + + diff --git a/lib/ic/test/ic_SUITE_data/syntax2.idl b/lib/ic/test/ic_SUITE_data/syntax2.idl new file mode 100644 index 0000000000..10498206c1 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax2.idl @@ -0,0 +1,27 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +struct S2 { + long a_arr[99]; + struct S3 { + long a;_arr[99] + boolean b_arr[99]; + } b; +}; + + diff --git a/lib/ic/test/ic_SUITE_data/syntax3.idl b/lib/ic/test/ic_SUITE_data/syntax3.idl new file mode 100644 index 0000000000..69ab6b9783 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax3.idl @@ -0,0 +1,20 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +typdef long T1; + diff --git a/lib/ic/test/ic_SUITE_data/syntax4.idl b/lib/ic/test/ic_SUITE_data/syntax4.idl new file mode 100644 index 0000000000..077a251729 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax4.idl @@ -0,0 +1,23 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +union U1 switch (long) { +case 1: long a; +2: short b; +}; + diff --git a/lib/ic/test/ic_SUITE_data/syntax5.idl b/lib/ic/test/ic_SUITE_data/syntax5.idl new file mode 100644 index 0000000000..10af9fc18c --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax5.idl @@ -0,0 +1,22 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +union U1 switch (enum E1 {kalle, sune}) { +case kalle: long a; +sune: short b; +}; diff --git a/lib/ic/test/ic_SUITE_data/syntax6.idl b/lib/ic/test/ic_SUITE_data/syntax6.idl new file mode 100644 index 0000000000..dc15704d94 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/syntax6.idl @@ -0,0 +1,20 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +constant long c1 = 0; diff --git a/lib/ic/test/ic_SUITE_data/type.idl b/lib/ic/test/ic_SUITE_data/type.idl new file mode 100644 index 0000000000..67e1d502bd --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/type.idl @@ -0,0 +1,190 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Check all types in IDL +// + +typedef long T01; +typedef unsigned long T02; +typedef short T03; +typedef unsigned short T04; +typedef float T05; +typedef double T06; +typedef char T07; +typedef boolean T08; +typedef octet T09; +typedef any T10; +typedef Object T11; +typedef T01 T12; + +// Template types +typedef sequence <long> T21; +typedef sequence <unsigned long> T22; +typedef sequence <short, 2> T23; +typedef sequence <unsigned short, 6> T24; +typedef sequence <float, 12> T25; +typedef sequence <double> T26; +typedef sequence <char, 1> T27; +typedef sequence <boolean> T28; +typedef sequence <octet, 9> T29; +typedef sequence <any> T30; +typedef sequence <Object,2 > T31; +typedef sequence <T01> T32; +typedef sequence <sequence <sequence <T32> > > T33; + +struct S1 { + long a; + boolean b; +}; + +struct S2 { + long a; + struct S3 { + long a; + boolean b; + } b; +}; + +union U1 switch (enum E1 {kalle1, sune1}) { +case kalle1: long a; +default: boolean b; +case sune1: octet c; +}; + +union U2 switch (enum E2 {kalle2, sune2}) { +case kalle2: long a; +default: struct S4 { long a; short b;} b; +case sune2: octet c; +}; + +// Typedefs of above types + +typedef struct S11 { + long a; + boolean b; +} T41; + +typedef struct S21 { + long a; + struct S3 { + long a; + boolean b; + } b; +} T42; + +typedef union U11 switch (enum E3 {kalle3, sune3}) { +case kalle3: long a; +default: boolean b; +case sune3: octet c; +} T43; + +typedef union U21 switch (enum E4 {kalle4, sune4}) { +case kalle4: long a; +default: struct S4 { long a; short b;} b; +case sune4: octet c; +} T44; + + + + +// Array versions + +typedef long T01_arr[99]; +typedef unsigned long T02_arr[99]; +typedef short T03_arr[99]; +typedef unsigned short T04_arr[99]; +typedef float T05_arr[99]; +typedef double T06_arr[99]; +typedef char T07_arr[99]; +typedef boolean T08_arr[99]; +typedef octet T09_arr[99]; +typedef any T10_arr[99]; +typedef Object T11_arr[99]; +typedef T01 T12_arr[99]; + +typedef sequence <long> T21_arr[99]; +typedef sequence <unsigned long> T22_arr[99]; +typedef sequence <short, 2> T23_arr[99]; +typedef sequence <unsigned short, 6> T24_arr[99]; +typedef sequence <float, 12> T25_arr[99]; +typedef sequence <double> T26_arr[99]; +typedef sequence <char, 1> T27_arr[99]; +typedef sequence <boolean> T28_arr[99]; +typedef sequence <octet, 9> T29_arr[99]; +typedef sequence <any> T30_arr[99]; +typedef sequence <Object,2 > T31_arr[99]; +typedef sequence <T01> T32_arr[99]; +typedef sequence <sequence <sequence <T32> > > T33_arr[99]; + +struct S12 { + long a; + boolean b_arr[99]; +}; + +struct S22 { + long a_arr[99]; + struct S3 { + long a_arr[99]; + boolean b_arr[99]; + } b; +}; + +union U12 switch (enum E12 {kalle12, sune12}) { +case kalle12: long a_arr[99]; +default: boolean b; +case sune12: octet c; +}; + +union U22 switch (enum E22 {kalle22, sune22}) { +case kalle22: long a; +default: struct S4 { long a; short b;} b_arr[99]; +case sune22: octet c; +}; + +// Typedefs of above types + +typedef struct S13 { + long a_arr[99]; + boolean b; +} T41_arr[99]; + +typedef struct S23 { + long a; + struct S3 { + long a; + boolean b_arr[99]; + char c; + } b; +} T42_arr[99]; + +typedef union U13 switch (enum E13 {kalle13, sune13}) { +case kalle13: long a; +default: boolean b_arr[99]; +case sune13: octet c; +} T43_arr[99]; + +typedef union U23 switch (enum E23 {kalle23, sune23}) { +case kalle23: long a_arr[99]; +default: struct S4 { long a; short b;} b_arr[99]; +case sune23: octet c_arr[99]; +} T44_arr[99]; + + + diff --git a/lib/ic/test/ic_SUITE_data/typeid.idl b/lib/ic/test/ic_SUITE_data/typeid.idl new file mode 100644 index 0000000000..6e99f4a50d --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/typeid.idl @@ -0,0 +1,28 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +interface I1 {}; + +module M1 { interface I1 {};}; + +module M2 { module M1 { interface I1 {};};}; + +module M3 { module M2 { module M1 { interface I1 {};};};}; + + diff --git a/lib/ic/test/ic_SUITE_data/u_case_mult.idl b/lib/ic/test/ic_SUITE_data/u_case_mult.idl new file mode 100644 index 0000000000..3c30e144d8 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/u_case_mult.idl @@ -0,0 +1,54 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// Check that case labels are not duplicated + +union U1 switch (long) { +case 1 : long a; +case 1 : short b; +}; + +union U2 switch (char) { +case 'c' : long a; +case 'c' : short b; +}; + +union U2b switch (char) { +case 'c' : +case 'c' : long a; +case 'e': long b; +case 'c': long c; +}; + +union U3 switch (enum E1 {kalle, kula}) { +case kula : long a; +case kula : short b; +}; + +union U4 switch (boolean) { +case TRUE : long a; +case TRUE : short b; +}; + +union U5 switch (boolean) { +case TRUE : long a; +default: short p; +default: short pp; +}; + diff --git a/lib/ic/test/ic_SUITE_data/u_default.idl b/lib/ic/test/ic_SUITE_data/u_default.idl new file mode 100644 index 0000000000..e5d94a5e54 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/u_default.idl @@ -0,0 +1,51 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Checking that default labels are correct in TK +// + +interface i1 { + union U1 switch (long) { + default: long a; + case 1: case 2: long b; + }; + + union U2 switch (long) { + case 0: default: long a; + case 1: case 2: long b; + }; + + union U3 switch (long) { + case -1: long aa; + case 0: default: long a; + case 1: case 2: long b; + }; + + union U4 switch (long) { + case -1: long aa; + case 0: long a; + case 1: case 2: long b; + }; + + U1 op0(); + U2 op1(); + U3 op2(); + U4 op3(); +}; diff --git a/lib/ic/test/ic_SUITE_data/u_mult.idl b/lib/ic/test/ic_SUITE_data/u_mult.idl new file mode 100644 index 0000000000..b916861eec --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/u_mult.idl @@ -0,0 +1,61 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +// Check multiply defined declarators + +enum E2 {kal, kula, E1}; // legal, but used below + +// Now check that declarator a is multiply defined in all unions below +union U0 switch (long) { +case 0: long a; +case 1: short a; +}; +union U00 switch (char) { +case 'c' : long a; +case 'f' : char c; +case 'b' : short a; +}; +union U000 switch (boolean) { +case TRUE: long a; +case FALSE: short a; +}; +union U0000 switch (E2) { +case kal: long a; +case kula: short a; +}; + + + + +// Check that enum name duplication is found. + +union U1 switch (enum E1 {kalle, kula, E1}) { +case E1 : long a; // legal +case kalle : short E1; // illegal +}; + + +// This is legal, but ended up here anyway + +union U2 switch(::E2) { +case kal : long a; +case kula : short b; +default : boolean E1; +}; diff --git a/lib/ic/test/ic_SUITE_data/u_norm.idl b/lib/ic/test/ic_SUITE_data/u_norm.idl new file mode 100644 index 0000000000..e23796b8ca --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/u_norm.idl @@ -0,0 +1,63 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +union U1 switch (long) { +case 1: long a; +case 2: case 3: short b; +}; + + +union U2 switch (unsigned short) { +case 10: boolean a; +case 188: char b; +default: string c; +}; + + +union U3 switch (enum E1 {kalle, kula, boll}) { +case kalle: long a; +case kula: U2 b; +}; + +enum E2 {Cissi, Anders}; + +union U4 switch (::E2) { +case Cissi: U1 a; +default: case Anders: unsigned long b; +}; + +union U5 switch(char) { +case 'e': long a; +case 'b': case 'f': char b; +default: struct S {long a; boolean b;} c; +}; + + +// Now check that references can be used as case values + +const long c1 = 9; +const long c2 = 10; + +union U6 switch (long) { +case c1: boolean a; +case ::c2: boolean b; +}; + + diff --git a/lib/ic/test/ic_SUITE_data/u_type.idl b/lib/ic/test/ic_SUITE_data/u_type.idl new file mode 100644 index 0000000000..44e3326305 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/u_type.idl @@ -0,0 +1,82 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + + +// +// Check that case values match declared discriminator type +// + + +const long longC = 0; +const short shortC = 0; +const char charC = 'c'; +const string stringC = "Yacht"; + +enum E1 {kalle, kula}; + +union U1 switch (long) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case kalle : long f; +}; + +union U2 switch (unsigned long) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case kalle : long f; +}; + +union U3 switch (short) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case kalle : long f; +}; + +union U4 switch (unsigned short) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case kalle : long f; +}; + +union U5 switch (char) { +case TRUE : long b; +case stringC : long d; +case shortC : long e; +case kalle : long f; +}; + + +union U6 switch (E1) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case shortC : long e; +}; + +union U7 switch (enum E2 {ja, nej, kanske}) { +case 'c' : long a; +case TRUE : long b; +case stringC : long d; +case shortC : long e; +}; + diff --git a/lib/ic/test/ic_SUITE_data/undef_id.idl b/lib/ic/test/ic_SUITE_data/undef_id.idl new file mode 100644 index 0000000000..01a35c4ef8 --- /dev/null +++ b/lib/ic/test/ic_SUITE_data/undef_id.idl @@ -0,0 +1,63 @@ + + +// %CopyrightBegin% +// +// Copyright Ericsson AB 1997-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% + +// +// Check that undefined ids are detected +// + +typedef T7 T1; + +const char c1 = ::c0; +const T01 c2 = 'h'; +const T7 c3 = 9; + +interface i1 { + T17 op(); + long op2( in T7 a); + attribute T7 a1, a2; + readonly attribute T17 a3; +}; + +union U1 switch (long) { +case 1: long a; +case ::g : short b; +}; + +union U2 switch (enum E1 {kalle, kula}) { +case kula1: long a; +case kalle : short b; +}; + +union U3 switch (long) { +case kula2: long a; +case ::E3::kalle : short b; +case ::E4::kalle : short c; +}; + +enum E2 {kalle2, kula2}; + +union U4 switch (E2) { +case kula1: long a; +case kula1: long b; +case c3: short c; +}; + + + + |