#ifdef AIX_PROD
/* @(#)41       1.1.1.5  src/dce/utils/svc/dce_msg.h, dce.utils.svc.src, os2dce21.dss, 960602a.1 3/29/96 17:12:50  */
/*
 *   COMPONENT_NAME: dce.utils.svc.src
 *
 *   FUNCTIONS: defined
 *
 *   ORIGINS: 72
 *
 */
#endif /* AIX_PROD */
/*
 * @OSF_COPYRIGHT@
 * COPYRIGHT NOTICE
 * Copyright (c) 1990, 1991, 1992, 1993, 1994 Open Software Foundation, Inc.
 * ALL RIGHTS RESERVED (DCE).  See the file named COPYRIGHT.DCE for
 * the full copyright text.
 * DCE Messaging header file.
 */

/*
 * HISTORY
 * $Log: dce_msg.h,v $
 * Revision 1.1.4.4  1994/09/30  19:44:51  rsalz
 *      Implement DCE RFC 24.2 (OT CR 11929).
 *      [1994/09/27  04:45:17  rsalz]
 *
 * Revision 1.1.4.3  1994/09/13  15:27:06  rsalz
 *      Make dce_msg__inq_comp thread-safe (OT CR 12067).
 *      [1994/09/13  05:00:32  rsalz]
 *
 * Revision 1.1.4.2  1994/06/09  16:05:52  devsrc
 *      cr10892 - fix copyright
 *      [1994/06/09  15:50:28  devsrc]
 *
 * Revision 1.1.4.1  1994/05/26  18:51:35  bowe
 *      Add prototype for dce_msg__inq_comp() [CR 10483,10478]
 *      [1994/05/26  18:12:33  bowe]
 *
 * Revision 1.1.2.3  1993/11/04  18:53:38  rsalz
 *      Use error_status_t, not unsigned32, for status codes
 *      [1993/11/04  18:52:43  rsalz]
 *
 * Revision 1.1.2.2  1993/08/16  18:07:58  rsalz
 *      Initial release
 *      [1993/08/16  18:02:30  rsalz]
 *
 * $EndLog$
 */

#if     !defined(_DCE_MSG_H)
#define _DCE_MSG_H

#if defined AIX_PROD  || defined IBMOS2         /* feature 13461 */
#define DCE_LC_ALL   1
#endif                                          /* feature 13461 */

/*
**  An in-core message table maps status code values to text strings.
*/
typedef struct dce_msg_table_s_t {
    unsigned32                  message;
    char                        *text;
} dce_msg_table_t;


/*
**  Get message from catalog, or from in-core tables.  Return pointer to
**  allocated space that must be free'd.
*/
#ifdef IBMOS2  /* CMVC 14384 */
#ifndef DCEAPI
#include <dce/dcedef.h>
#endif
extern unsigned char* DCEAPI dce_msg_get_msg(
#else
extern unsigned char *dce_msg_get_msg(
#endif /* CMVC 14384 */
    unsigned32                  /* message */,
    error_status_t*             /* status */
);

#if defined AIX_PROD  || defined IBMOS2         /* feature 13461 */
/*
**  This function will synchronize the DCE XPG4 environment with the caller's
**  XPG4 or OS/2 country environment
*/
#ifdef IBMOS2
extern char * DCEAPI dce_setlocale(int, const char *);
#else
extern char * dce_setlocale(int, const char *);
#endif
#endif                                          /* feature 13461 */

/*
**  Get a message; abort on error.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern unsigned char* DCEAPI dce_msg_get(
#else
extern unsigned char *dce_msg_get(
#endif /* CMVC 14384 */
    unsigned32                  /* message */
);


/*
**  Add a program-specific message table to the in-core table list.
*/
#ifdef IBMOS2  /* CMVC 14384 */
extern void DCEAPI dce_msg_define_msg_table(
#else
extern void dce_msg_define_msg_table(
#endif /* CMVC 14384 */
    dce_msg_table_t*            /* table */,
    unsigned32                  /* count */,
    error_status_t*             /* status */
);


/*
**  Translate all messages in a table.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern void DCEAPI dce_msg_translate_table(
#else
extern void dce_msg_translate_table(
#endif /* CMVC 14384 */
    dce_msg_table_t*            /* table */,
    unsigned32                  /* count */,
    error_status_t*             /* status */
);

/*
**  Get message from in-core tables.  Return static pointer.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern unsigned char* DCEAPI dce_msg_get_default_msg(
#else
extern unsigned char *dce_msg_get_default_msg(
#endif /* CMVC 14384 */
    unsigned32                  /* message */,
    error_status_t*             /* status */
);


/*
**  One-shot routine to get a message from a DCE message catalog.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern unsigned char* DCEAPI dce_msg_get_cat_msg(
#else
extern unsigned char *dce_msg_get_cat_msg(
#endif /* CMVC 14384 */
    unsigned32                  /* message */,
    error_status_t*             /* status */
);


/*
**  DCE provides a layer over XPG4 message catalogs.
*/
#ifdef __BORLANDC__                                     /* CMVC 19640 */
typedef void *dce_msg_cat_handle_t;                     /* CMVC 19640 */
#else                                                   /* CMVC 19640 */
typedef struct dce_msg_cat_handle_s_t *dce_msg_cat_handle_t;
#endif                                                  /* CMVC 19640 */


/*
**  Given a "typical" message code, return a handle to the open
**  message catalog.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern dce_msg_cat_handle_t DCEAPI dce_msg_cat_open(
#else
extern dce_msg_cat_handle_t dce_msg_cat_open(
#endif  /* CMVC 14384 */
    unsigned32                  /* typical_message */,
    error_status_t*             /* status */
);


/*
**  Get a message from an open DCE message catalog.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern unsigned char* DCEAPI dce_msg_cat_get_msg(
#else
extern unsigned char *dce_msg_cat_get_msg(
#endif /* CMVC 14384 */
    dce_msg_cat_handle_t        /* handle */,
    unsigned32                  /* message */,
    error_status_t*             /* status */
);


/*
**  Close an open DCE message catalog.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern void DCEAPI dce_msg_cat_close(
#else
extern void dce_msg_cat_close(
#endif /* CMVC 14384 */
    dce_msg_cat_handle_t        /* handle */,
    error_status_t*             /* status */
);


typedef char    dce_msg_inqbuf_t[4];


/*
**  Internal routine to get the DCE component from a Message ID.
*/
#ifdef IBMOS2 /* CMVC 14384 */
extern void DCEAPI dce_msg__inq_comp(
#else
extern void dce_msg__inq_comp(
#endif /* CMVC 14384 */
    unsigned32                  /* message */,
    dce_msg_inqbuf_t            /* buffer */
);


/*
**  Internal routine to get the DCE technology from a Message ID.
*/
#ifdef IBMOS2  /* CMVC 14384 */
extern void DCEAPI dce_msg__inq_tech(
#else
extern void dce_msg__inq_tech(
#endif /* CVMC 14384 */
    unsigned32                  /* message */,
    dce_msg_inqbuf_t            /* buffer */
);
#endif  /* !defined(_DCE_MSG_H) */
