/*
 *    @(#) 2.24 src/somd/somd.h, somd, som3.0 4/17/96 16:16:11 [12/22/96 21:11:51]
 */
/*
 *   COMPONENT_NAME: somd
 *
 *   ORIGINS: 27
 *
 *
 *    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
 *   All Rights Reserved
 *   Licensed Materials - Property of IBM
 *   US Government Users Restricted Rights - Use, duplication or
 *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */

/*
 *  somd.h - global include file for DSOM definitions
 */

/*
 *   04/17/96  mbc  D21197 Avoid name collisions with WIN32.
 */

#ifndef somd_h
#define somd_h

/*  --- base SOM and DSOM types ---  */

#define CORBA_FUNCTION_NAMES
#include <som.h>

#include <somtcnst.h>
#include <somir.h>
#include <somdtype.h>

/*  --- DSOM error codes ---  */

#include <somderr.h>

/*  --- DSOM externals function prototypes ---  */

#include <somdext.h>

/* For DSOM users, CORBA's exception_free should be mapped to 
 * somdExceptionFree rather than somExceptionFree, as in somcorba.h.
 */
#ifdef exception_free
#undef exception_free
#endif
#define exception_free somdExceptionFree

#ifndef OBJECT_NIL
#define OBJECT_NIL NULL
#endif

/*  --- DSOM global variables ---
 *
 *  Several global variables point to DSOM objects that are always or often
 *  used by DSOM applications.
 *
 *  SOMD_ObjectMgr, SOMD_ORBObject, and SOMD_ImplRepObject are initialized
 *  by SOMD_Init().  (The use of SOMD_ObjectMgr is discouraged in this release,
 *  and may be removed in a future release.)
 *
 *  SOMD_ImplDefObject is initially NULL.   DSOM servers *MUST* set this to
 *  an ImplementationDef object which describes the server implementation.
 *  DSOM clients *MUST* leave this variable NULL.
 *
 *  SOMD_SOMOAObject is initially NULL.  DSOM servers 
 *  can use this variable to refer to the instantiated SOMOA object.
 *  It is not used by client processes.
 *
 *  The external references to these global variables are defined in the
 *  .h files for their respective classes.
 */

#include <somdom.h>                    /* SOMD_ObjectMgr (incl. SOMDServer) */
#include <orb.h>                       /* SOMD_ORBObject */
#include <implrep.h>                   /* SOMD_ImplRepObject */
#include <impldef.h>                   /* SOMD_ImplDefObject */
#include <somoa.h>                     /* SOMD_SOMOAObject */

/*  --- DSOM interfaces ---
 *
 *  Interfaces for other commonly used DSOM classes.
 */

#include <somdobj.h>                   /* SOMDObject */
#include <somdcprx.h>                  /* SOMDClientProxy */
#include <cntxt.h>                     /* Context */
#include <nvlist.h>                    /* NVList */
#include <request.h>                   /* Request */

/* ----------------------- WIN32 includes --------------- */
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif                                 /* WIN32 */

#include <stexcep.h>                   /* standard exceptions */
#include <principl.h>                  /* Principal object */

/* This define gives applications compiled with DSOM 3.0 the
 * new, improved semantics for somFree when invoked on a proxy --
 * both the remote object and the proxy are destroyed.  It also
 * gives string_to_object the 3.0 semantics, returning a local
 * SOMObject (rather than a SOMDObject) when invoked in a server in
 * which the object resides.  
 */
#define SOMD_Init(ev) \
    { SOMD_Init(ev); \
   if (SOMD_ObjectMgr != NULL) __set_somd21somFree(SOMD_ObjectMgr, ev, TRUE); \
   if (SOMD_ORBObject != NULL) __set_stringToObject30(SOMD_ORBObject, ev, TRUE); }


/* To prevent name collisions for the method "get_response", the
 * _get_response C macro is defined to invoke the Request::get_response method.
 */
#ifdef  _get_response
#undef _get_response
#endif
#define _get_response(s,e,f)    Request_get_response(s,e,f)

#endif                                 /* somd_h */
