/*
 * $Header: /smsa/bsd:include/nls_support.h:bsd.riscix1_2  1.1  $
 * $Source: /smsa/bsd:include/nls_support.h: $
 *
 * Copyright (c) 1990 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __nls_support_h
#define __nls_support_h

#define _NLS_ROOTPATH		"/usr/share/nls"

struct _collate
{
    unsigned int character:8;
    unsigned int type:2;
    unsigned int collation:16;
    union
    {
	struct _collate *char2;
	unsigned int coll2;
    } _expansion;
};

#define character2		_expansion.char2
#define collation2		_expansion.coll2

#define _COLT_NULL		(0)
#define _COLT_SINGLE		(1)
#define _COLT_EXPAND		(2)
#define _COLT_IGNORE		(3)

struct _get_collate
{
    const unsigned char *nextc;
    unsigned int collate;
    unsigned int collate2;
};

/*
 * macros for extracting collating sequence
 */
#define _COLLATE_PRIMARY(x)	((x) >> 8)
#define _COLLATE_SECONDARY(x)	((x) & 0xff)

/*
 * sizes of various locale structures
 */
#define _NLS_CTYPE_LEN		(257 * sizeof(char))
#define _NLS_CSHIFT_LEN		(257 * sizeof(char))
#define _NLS_CCOLLATE_LEN	(256 * sizeof(struct _collate *))

/*
 * struct lconv data collected
 * together in _ANSI_FMT_MISC
 */
#define _FMT_INTFRACDIGITS	(0)
#define _FMT_FRACDIGITS		(1)
#define _FMT_PCSPRECEDES	(2)
#define _FMT_PSEPBYSPACE	(3)
#define _FMT_NCSPRECEDES	(4)
#define _FMT_NSEPBYSPACE	(5)
#define _FMT_PSIGNPOSN		(6)
#define _FMT_NSIGNPOSN		(7)

#define _N_FMT_MISC		(8)

/*
 * function declarations
 */
extern int _getcollate(struct _get_collate * /*gcptr*/);

#endif /* !defined __nls_support_h */

/* EOF nls_support.h */
