/*  DO NOT EDIT THIS FILE.

    It has been auto-edited by fixincludes from:

	"/usr/include/lc_core.h"

    This had to be done to correct non-standard usages in the
    original, manufacturer supplied header file.  */

/*
 * (c) Copyright 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
 * ALL RIGHTS RESERVED 
 */
/*
 * OSF/1 1.2
 */

/* @(#) $Revision: 72.4 $ */

/* 1.6  com/inc/sys/lc_core.h, libccnv, bos320, 9132320m 8/11/91 14:14:46
 *
 * COMPONENT_NAME: (LIBCLOC) Locale Related Data Structures and API
 *
 *
 * (C) COPYRIGHT International Business Machines Corp. 1985, 1989
 * 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.
 */
#ifndef _LC_CORE_INCLUDED
#define _LC_CORE_INCLUDED

#ifndef _SYS_STDSYMS_INCLUDED
#  include <sys/stdsyms.h>
#endif /* _SYS_STDSYMS_INCLUDED */

#include <sys/types.h>
#include <nl_types.h>
#include <regex.h>
#include <stdarg.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Define wchar_t  if not already defined */
#  ifndef _WCHAR_T
#     define _WCHAR_T
#ifndef __cplusplus
      typedef unsigned int wchar_t;
#endif
#  endif

#  ifndef _WINT_T
#     define _WINT_T
   typedef unsigned int wint_t;
#  endif

#  ifndef _WCTYPE_T
#     define _WCTYPE_T
      typedef unsigned int wctype_t;
#  endif

/*
 * In OSF/1, method elements in the structures point to functions
 */


/*
** Valid type ids for NLS objects
*/
typedef enum __lc_type_id_t {
    _LC_CAR=1,
    _LC_LOCALE=2,
    _LC_CHARMAP=3,
    _LC_CTYPE=4,
    _LC_COLLATE=5,
    _LC_NUMERIC=6,
    _LC_MONETARY=7,
    _LC_TIME=8,
    _LC_RESP=9 } __lc_type_id_t;


typedef struct {

    __lc_type_id_t
	type_id;
    unsigned short
	magic;
    unsigned long
	version;
    
    size_t  size;

} _LC_object_t;

/*
** Object magic (Looks like "OSF1")
*/
#define _LC_MAGIC     0x05F1

/*
** Version.  Anytime the data structures in localedef or lc_core change
**	     in an incompatible way, this number should change
*/
#define _LC_VERSION   0x1


#if defined(__STDC__) || defined(__cplusplus)
typedef struct {

    _LC_object_t  hdr;

    /* locale info method */
    char     *(*nl_langinfo) (nl_item,_LC_charmap_t*); 
    
    /* Process code conversion methods */
    size_t   (*mbtowc) (wchar_t*,const char*,size_t,_LC_charmap_t*);
    size_t   (*mbstowcs) (wchar_t*,const char*,size_t,_LC_charmap_t*);
    int      (*wctomb) (char*,wchar_t,_LC_charmap_t*);
    size_t   (*wcstombs) (char*,const wchar_t*,size_t,_LC_charmap_t*);
    
    /* Character encoding length method */
    int      (*mblen) (const char*,size_t,_LC_charmap_t*);
    
    /* Character display width methods */
    size_t   (*wcswidth) (const wchar_t*,size_t,_LC_charmap_t*);
    size_t   (*wcwidth) (const wchar_t,_LC_charmap_t*);
    
    /* private PC/CP converters */
    int      (*__mbtopc) (wchar_t*,char*,size_t,int*,_LC_charmap_t*);
    int      (*__mbstopcs) (wchar_t*,size_t,char*,size_t,int,char**,int*,_LC_charmap_t*);
    int      (*__pctomb) (char*,wchar_t*,size_t,int*,_LC_charmap_t*);
    int      (*__pcstombs) (char*,size_t,wchar_t*,size_t,char**,int*,_LC_charmap_t*);
    
    /* implementation initialization */
    _LC_charmap_t *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_charmap_t;


typedef struct {
 
    _LC_object_t  hdr; 
    
    /* case convertersion methods */
    wchar_t  (*towupper) (wchar_t,_LC_ctype_t*);
    wchar_t  (*towlower) (wchar_t,_LC_ctype_t*);
    
    /* classification methods */
    unsigned int    (*wctype) (char*,_LC_ctype_t*);
    int      (*iswctype) (wchar_t,wctype_t,_LC_ctype_t*);
    
    /* implementation initialization */
    _LC_ctype_t   *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_ctype_t;

typedef struct {

    _LC_object_t  hdr;

    /* character collation methods */
    int      (*strcoll) (const char*,const char*,_LC_collate_t*);
    size_t   (*strxfrm) (char*,const char*,size_t,_LC_collate_t*);
    
    /* process code collation methods */
    int      (*wcscoll) (const wchar_t*,const wchar_t*,_LC_collate_t*);
    size_t   (*wcsxfrm) (wchar_t*,const wchar_t*,size_t,_LC_collate_t*);
    
    /* filename matching methods */
    int      (*fnmatch) (const char*,const char*,const char*,int,_LC_collate_t*);
    
    /* regular expression methods */

    int      (*regcomp) (regex_t*,const char*,int,_LC_collate_t*);
    size_t   (*regerror) (int,const regex_t*,char*,size_t,_LC_collate_t*);
    int      (*regexec) (const regex_t*,const char*,size_t,regmatch_t*,int,_LC_collate_t*);
    void     (*regfree) (regex_t*,_LC_collate_t*);

    /* implementation initialization */
    _LC_collate_t *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_collate_t;


/* struct tm; */
typedef struct {

    _LC_object_t  hdr;
    
    /* time info method */
    char     *(*nl_langinfo) (nl_item,_LC_time_t*);
    
    /* time character string formatting methods */
    size_t   (*strftime) (char*,size_t,const char*,const struct tm*,_LC_time_t*);
    char     *(*strptime) (const char*,const char*,struct tm*,_LC_time_t*);
    
    /* time process code string formatting methods */
    size_t   (*wcsftime) (wchar_t*,size_t,const char*,const struct tm*,_LC_time_t*);
    
    /* implementation initialization */
    _LC_time_t    *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_time_t;


typedef struct {

    _LC_object_t  hdr;

    /* monetary info method */
    char     *(*nl_langinfo) (nl_item,_LC_monetary_t*);
    
    /* character string monetary formatting method */
    size_t   (*strfmon) (char*,size_t,const char*,va_list,_LC_monetary_t*);
    
    /* implementation initialization */
    _LC_monetary_t        *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_monetary_t;


typedef struct {

    _LC_object_t  hdr;

    /* langinfo method */
    char     *(*nl_langinfo) (nl_item,_LC_numeric_t*);
    
    /* implementation initialization */
    _LC_numeric_t *(*init) (_LC_locale_t*);
    void     *data;
} _LC_core_numeric_t;


typedef struct {

    _LC_object_t  hdr;
    
    /* langinfo method */
    char        *(*nl_langinfo) (nl_item,_LC_resp_t*);
    
    /* response matching method */
    int		(*rpmatch) (const char*,_LC_resp_t*);
    
    /* implementation initialization */
    _LC_resp_t    *(*init) (_LC_locale_t*);
    void        *data;
} _LC_core_resp_t;

typedef struct {

    _LC_object_t hdr;

    /* langinfo method */
    char         *(*nl_langinfo) (nl_item,_LC_locale_t*);
    struct lconv * (*localeconv) (_LC_locale_t*);
    
    /* Initialization */
    _LC_locale_t  *(*init) (_LC_locale_t*);
    void         *data;
} _LC_core_locale_t;
#else /* NOT defined(__STDC__) || defined(__cplusplus) */
typedef struct {

    _LC_object_t  hdr;

    /* locale info method */
    char     *(*nl_langinfo) ();
    
    /* Process code conversion methods */
    size_t   (*mbtowc) ();
    size_t   (*mbstowcs) ();
    int      (*wctomb) ();
    size_t   (*wcstombs) ();
    
    /* Character encoding length method */
    int      (*mblen) ();
    
    /* Character display width methods */
    size_t   (*wcswidth) ();
    size_t   (*wcwidth) ();
    
    /* private PC/CP converters */
    int      (*__mbtopc) ();
    int      (*__mbstopcs) ();
    int      (*__pctomb) ();
    int      (*__pcstombs) ();
    
    /* implementation initialization */
    _LC_charmap_t *(*init) ();
    void     *data;
} _LC_core_charmap_t;


typedef struct {
 
    _LC_object_t  hdr; 
    
    /* case convertersion methods */
    wchar_t  (*towupper) ();
    wchar_t  (*towlower) ();
    
    /* classification methods */
    unsigned int    (*wctype) ();
    int      (*iswctype) ();
    
    /* implementation initialization */
    _LC_ctype_t   *(*init) ();
    void     *data;
} _LC_core_ctype_t;

typedef struct {

    _LC_object_t  hdr;

    /* character collation methods */
    int      (*strcoll) ();
    size_t   (*strxfrm) ();
    
    /* process code collation methods */
    int      (*wcscoll) ();
    size_t   (*wcsxfrm) ();
    
    /* filename matching methods */
    int      (*fnmatch) ();
    
    /* regular expression methods */

    int      (*regcomp) ();
    size_t   (*regerror) ();
    int      (*regexec) ();
    void     (*regfree) ();

    /* implementation initialization */
    _LC_collate_t *(*init) ();
    void     *data;
} _LC_core_collate_t;


/* struct tm; */
typedef struct {

    _LC_object_t  hdr;
    
    /* time info method */
    char     *(*nl_langinfo) ();
    
    /* time character string formatting methods */
    size_t   (*strftime) ();
    char     *(*strptime) ();
    
    /* time process code string formatting methods */
    size_t   (*wcsftime) ();
    
    /* implementation initialization */
    _LC_time_t    *(*init) ();
    void     *data;
} _LC_core_time_t;


typedef struct {

    _LC_object_t  hdr;

    /* monetary info method */
    char     *(*nl_langinfo) ();
    
    /* character string monetary formatting method */
    size_t   (*strfmon) ();
    
    /* implementation initialization */
    _LC_monetary_t        *(*init) ();
    void     *data;
} _LC_core_monetary_t;


typedef struct {

    _LC_object_t  hdr;

    /* langinfo method */
    char     *(*nl_langinfo) ();
    
    /* implementation initialization */
    _LC_numeric_t *(*init) ();
    void     *data;
} _LC_core_numeric_t;


typedef struct {

    _LC_object_t  hdr;
    
    /* langinfo method */
    char        *(*nl_langinfo) ();

    /* response matching method */
    int         (*rpmatch) ();

    /* implementation initialization */
    _LC_resp_t    *(*init) ();
    void        *data;
} _LC_core_resp_t;

typedef struct {

    _LC_object_t hdr;

    /* langinfo method */
    char         *(*nl_langinfo) ();
    struct lconv * (*localeconv) ();

    /* Initialization */
    _LC_locale_t  *(*init) ();
    void         *data;
} _LC_core_locale_t;
#endif  /* defined(__STDC__) || defined(__cplusplus) */

#ifdef __cplusplus
}
#endif

#endif /* _LC_CORE_INCLUDED */
