/*
 * @(#) 1.9 src/somos/core/somosutl/somosutl.xh, somos, som3.0 10/28/96 16:09:43 [12/22/96 21:48:27]
 *
 * ComponentName: core/somosutl.h
 *
 * 25H7912  (C)  Copyright International Business Machines Corp. 1994, 1995,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.
 *
 * Description:  SOMOS Server utilities
 */

#ifndef SOMOS_UTILS_H
#define SOMOS_UTILS_H

/*
 * Description
 * -----------
 * somosutl.c - This file defines the public interfaces to the somos
 *              utilites library.
 */


/*****************************************************************************/
/*  Includes                                                                 */
/*****************************************************************************/

#ifdef __cplusplus
#include <som.xh>
#include <somos.xh>
#else
#include <som.h>
#include <somos.h>
#endif /* __cplusplus */

/*****************************************************************************/
/*  Constants                                                                */
/*****************************************************************************/
/* The following constants are the available exit codes */
#define SOMOS_USAGE_ERROR               100
#define SOMOS_FIND_IMPLDEF_FAILED       101
#define SOMOS_IMPL_IS_READY_FAILED      102
#define SOMOS_CONFIG_FILE_ERROR         103
#define SOMOS_LOG_OPEN_FAILED           104
#define SOMOS_PERSIST_INIT_FAILED       105
#define SOMOS_SECURITY_INIT_FAILED      106
#define SOMOS_SOMD_INIT_FAILED          107
#define SOMOS_REQUEST_LOOP_ERROR        108
#define SOMOS_SERVER_FAILED             109
#define SOMOS_SOMOA_NEW_FAILED          110

/*****************************************************************************/
/*  Typedefs                                                                 */
/*****************************************************************************/
typedef void SOMLINK somosExitCallbackProc(void *client_data);

/*****************************************************************************/
/* Prototypes                                                                */
/*****************************************************************************/
SOMEXTERN int SOMLINK somos_init_persist_dbs(char *impl_alias, Environment *ev);
SOMEXTERN void SOMLINK somos_uninit_persist_dbs(char *impl_alias, Environment *ev);
SOMEXTERN int SOMLINK somos_getopt(int argc, char **argv, char *opts);
SOMEXTERN void SOMLINK somos_exit(int exit_code);
SOMEXTERN void SOMLINK somos_setup(void);
SOMEXTERN void SOMLINK somos_init_services(boolean initialize_mode);
SOMEXTERN void SOMLINK somos_init_services_afterimpl(boolean initialize_mode);
SOMEXTERN void SOMLINK somos_register_exit_callback(somOS_service_id_e somos_service_id, 
						    somosExitCallbackProc *proc,
						    void *client_data); 
SOMEXTERN void SOMLINK somos_init_logging(void);

/* Ensure the proper linkage convention is used for OS2 */
#if defined(__OS2__) && defined(__IBMC__)
#pragma linkage(somos_init_persist_dbs, system)
#pragma linkage(somos_uninit_persist_dbs, system)
#pragma linkage(somos_getopt, system)
#pragma linkage(somos_exit, system)
#pragma linkage(somos_setup, system)
#pragma linkage(somos_init_services, system)
#pragma linkage(somos_init_services_afterimpl, system)
#pragma linkage(somos_register_exit_callback, system)
#pragma linkage(somos_init_logging, system)
#endif

#endif /* SOMOS_UTILS_H */


