/*
 *    @(#) 2.17.1.23 src/somd/somdext.h, somd, som3.0 7/15/96 17:16:13 [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.
 */

/*
 *  somdext.h - prototypes for external functions provided by DSOM 
 *              (other external definitions are made in IDL files).
 */

#ifndef somdext_h
#define somdext_h

#if defined(_WIN32) && !defined(SOM_DLL_somd)
#define SOMDEXT_IMPORT SOMDLLIMPORT
#else
#define SOMDEXT_IMPORT
#endif

/* DSOM runtime functions */

#if defined(__IBMC__)  && defined(_OS2) /* D21976 */
#pragma linkage(SOMD_Init, system)
#pragma linkage(SOMD_Uninit, system)
#pragma linkage(SOMInitsomd, system)
#pragma linkage(ORBfree, system)
#pragma linkage(SOMD_NoORBfree, system)
#pragma linkage(SOMD_YesORBfree, system)
#pragma linkage(SOMD_QueryORBfree, system)
#pragma linkage(SOMD_FreeType, system)
#pragma linkage(somdExceptionFree, system)
#pragma linkage(SOMD_FlushInterfaceCache, system)
#pragma linkage(somdGetDefaultObjectKey, system)
#pragma linkage(somdCreateDynProxyClass, system)
#pragma linkage(somdExtractUUID, system)
#pragma linkage(somdCreate, system)
#pragma linkage(somdStartProcess, system)
#pragma linkage(somdDaemonReady, system)
#pragma linkage(somdDaemonRequired, system)
#endif

SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_Init(Environment *);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_Uninit(Environment *);

#ifdef SOM_STRICT_IDL
SOMEXTERN SOMDEXT_IMPORT SOMObject SOMLINK somdCreate(Environment * ev,
                                       Identifier className, boolean init);
#else
SOMEXTERN SOMDEXT_IMPORT SOMObject *SOMLINK somdCreate(Environment * ev,
                                       Identifier className, boolean init);
#endif                                 /* SOM_STRICT_IDL */

SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMInitsomd(void);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK ORBfree(void *);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_NoORBfree(void);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_YesORBfree(void);
SOMEXTERN SOMDEXT_IMPORT unsigned char SOMLINK SOMD_QueryORBfree(void);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_FreeType(Environment * ev,
                                       void *ptr, TypeCode tc);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK somdExceptionFree(Environment * ev);
SOMEXTERN SOMDEXT_IMPORT void SOMLINK SOMD_FlushInterfaceCache(
                                       Environment * ev,
                                       string name);
SOMEXTERN SOMDEXT_IMPORT SOMClass *SOMLINK somdCreateDynProxyClass(
                                       Environment * ev,
                                       string targetClassName, 
                                       long classMajorVersion,
                                       long classMinorVersion);
SOMEXTERN SOMDEXT_IMPORT ReferenceData SOMLINK somdGetDefaultObjectKey(
                                       Environment * ev,
                                       string ImplId);
SOMEXTERN SOMDEXT_IMPORT ImplId SOMLINK somdExtractUUID(Environment * ev,
                                       ReferenceData * id);
SOMEXTERN SOMDEXT_IMPORT int SOMLINK somdStartProcess(Environment *ev,
			       char *path,
			       char *name,
			       char *implid,
			       unsigned long winSvrObj, string title);
SOMEXTERN SOMDEXT_IMPORT boolean SOMLINK somdDaemonReady(Environment *ev,
                                       long timeout);
SOMEXTERN SOMDEXT_IMPORT boolean SOMLINK somdDaemonRequired(Environment *ev);

/* DSOM global variables */
/* SOMD_TraceLevel is no longer supported */
SOMEXTERN SOMDEXT_IMPORT long SOMDLINK SOMD_TraceLevel;
/* SOMD_DebugFlag corresponds to SOMDDEBUG setting */
SOMEXTERN SOMDEXT_IMPORT long SOMDLINK SOMD_DebugFlag;

#endif                                 /* somdext_h */
