#ident "@(#)osi.h	1.6 91/09/14"

/*
 *   ----------------------------------------------------------------- 
 *          Copyright (C) 1986,1991  Sun Microsystems, Inc
 *                      All rights reserved. 
 *            Notice of copyright on this source code 
 *            product does not indicate publication. 
 *   
 *                    RESTRICTED RIGHTS LEGEND: 
 *   Use, duplication, or disclosure by the Government is subject 
 *   to restrictions as set forth in subparagraph (c)(1)(ii) of 
 *   the Rights in Technical Data and Computer Software clause at 
 *   DFARS 52.227-7013 and in similar clauses in the FAR and NASA 
 *   FAR Supplement. 
 *   ----------------------------------------------------------------- 
 */


#ifndef OSI_H
#define OSI_H

/*
 *	Used as a query to determine whether the server has bootstrapped
 *	itself to the point where it is initialized and running.
 *
 *	If the server is "up", the message routines *may* use popups and/or
 *	other graphical methods of informing the user of INFO and WARNING
 *	messages.  (ERROR messages never use server resources for display)
 *
 *	up == 0 -> messages go to stderr,
 *	   == 1 -> messages go to syslog/other
 */

EXTERN_FUNCTION(void osi_server_is_running, (int up));

#define MESSAGE_MASK_FLAGS	0x000F
#define MESSAGE_INFO		0x0001	/* Informational message      */
#define MESSAGE_WARNING		0x0002	/* Warning - something not ok */
#define MESSAGE_ERROR		0x0003	/* Error - server is unstable */

EXTERN_FUNCTION(void osi_server_message,
			(unsigned int flags, const char *fmt, DOTDOTDOT));

#define SHUTDOWN_MASK		0x000F
#define SHUTDOWN_NORMAL		0x0001
#define SHUTDOWN_FATAL		0x0002
#define SHUTDOWN_ABORT		0x0003
#define SHUTDOWN		SHUTDOWN_FATAL

EXTERN_FUNCTION(void osi_server_shutdown,
			(unsigned int flags, const char *reason,
					     const char *fromwhere));

EXTERN_FUNCTION(void _osi_server_debug, (char *fmt, DOTDOTDOT));

/* For debugging output */
#ifdef DEBUG
#    define Printf	(void) printf
#else
#    define Printf	#error "Do Not Use Printf() in non-DEBUG code"
#endif

#endif	/* OSI_H */

