#ifndef GCIRTL_HF
#define GCIRTL_HF TRUE
/*=========================================================================
 * Copyright (C) VMware Inc. 1986-2011.  All Rights Reserved.
 *
 * Name - gcirtl.hf
 *
 * Description - Functional interface to the GemStone C interface (GCI).
 *               This header file should be used by applications that
 *               specify at runtime what version of the gci to use.
 *               To specify it at build time use gci.hf.
 *  This file allows GCI calls to be made to a dynamically loaded
 *  GCI library. The GCI call can be done only after GciRtlLoad
 *  has been called successfully. Any GCI call done when a library
 *  has not been loaded will fail.
 *
 * $Id: gcirtl.hf,v 1.9 2008-01-09 22:51:04 stever Exp $
 *
 *========================================================================
 */

#if defined(GCI_HF) || defined(GCIDLL_HF)
#error Include gcirtl.hf or gci.hf not both.
#endif

#ifdef GCIUA_HF
#error Include gcirtl.hf or gciua.hf, not both.
#endif

#include "gcirtlm.hf"

extern "C" {

/********************** Public Functions **********************/

/* GciRtlLoad will attempt to load a dynamic GCI library at the time
 * it is called.
 * If 'useRpc' is TRUE then the GCI loaded will be a rpc version.
 * If 'useRpc' is FALSE then the GCI loaded will be a linked version.
 * If 'path' is not NULL then it must point to a ';' seperated list
 * of directories to search for the library to load. The directories
 * in path will be searched before the defaults ones.
 * If 'path' is NULL then only the default path will be searched.
 * Returns TRUE if successful.
 * Returns FALSE if it fails and if 'errBuf' is not NULL will load
 * it with a null terminated error message.
 * Note: this call will fail if a GCI library is already loaded.
 */
  EXTERN_GCI_DEC(BoolType)
GciRtlLoad(BoolType useRpc, const char *path,
	   char errBuf[], size_t errBufSize);

/* GciRtlUnload will cause the library loaded by GciRtlLoad to
 * be unloaded. Once it is unloaded GciRtlLoad can be called again
 * to load a different GCI library.
 */
  EXTERN_GCI_DEC(void)
GciRtlUnload(void);

/* GciRtlIsLoaded returns TRUE if a GCI is loaded and FALSE if not.
 */
  EXTERN_GCI_DEC(BoolType)
GciRtlIsLoaded(void);

} /* extern "C" */

/********************** Private Interface **********************/

/* rtlPrivGciRtlFuncs is the function jump table. It is used to make
 * calls to a dynamically loaded GCI library.
 * It should only be accessed through the public interface.
 */
/* export this because we use a DLL on NT */
#if defined (FLG_MSWIN32)
EXTERN_GCI_VAR(const GciRtlJumpSType) *GCI_FUNC_TABLE_PTR;
#else
extern const GciRtlJumpSType *GCI_FUNC_TABLE_PTR;
#endif

#include "gcistring.hf"

#endif /* GCIRTL_HF */
