1142661Sphantom/*	$NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $	*/
2142661Sphantom
3103899Smike/*-
4142661Sphantom * Copyright (c) 1996 The NetBSD Foundation, Inc.
5142661Sphantom * All rights reserved.
6103899Smike *
7142661Sphantom * This code is derived from software contributed to The NetBSD Foundation
8142661Sphantom * by J.T. Conklin.
9103899Smike *
10142661Sphantom * Redistribution and use in source and binary forms, with or without
11142661Sphantom * modification, are permitted provided that the following conditions
12142661Sphantom * are met:
13142661Sphantom * 1. Redistributions of source code must retain the above copyright
14142661Sphantom *    notice, this list of conditions and the following disclaimer.
15142661Sphantom * 2. Redistributions in binary form must reproduce the above copyright
16142661Sphantom *    notice, this list of conditions and the following disclaimer in the
17142661Sphantom *    documentation and/or other materials provided with the distribution.
18103899Smike *
19142661Sphantom * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20142661Sphantom * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21142661Sphantom * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22142661Sphantom * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23142661Sphantom * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24142661Sphantom * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25142661Sphantom * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26142661Sphantom * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27142661Sphantom * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28142661Sphantom * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29142661Sphantom * POSSIBILITY OF SUCH DAMAGE.
30103899Smike *
31103899Smike * $FreeBSD$
32103899Smike */
337495Sjkh
347495Sjkh#ifndef _NL_TYPES_H_
357495Sjkh#define _NL_TYPES_H_
36103899Smike
377495Sjkh#include <sys/cdefs.h>
38142661Sphantom#include <sys/types.h>
397495Sjkh
40142661Sphantom#ifdef _NLS_PRIVATE
41142661Sphantom/*
42142661Sphantom * MESSAGE CATALOG FILE FORMAT.
43142661Sphantom *
44142661Sphantom * The NetBSD/FreeBSD message catalog format is similar to the format used by
45142661Sphantom * Svr4 systems.  The differences are:
46142661Sphantom *   * fixed byte order (big endian)
47142661Sphantom *   * fixed data field sizes
48142661Sphantom *
49142661Sphantom * A message catalog contains four data types: a catalog header, one
50142661Sphantom * or more set headers, one or more message headers, and one or more
51142661Sphantom * text strings.
52142661Sphantom */
53142661Sphantom
54142661Sphantom#define _NLS_MAGIC	0xff88ff89
55142661Sphantom
56142661Sphantomstruct _nls_cat_hdr {
57142661Sphantom	int32_t __magic;
58142661Sphantom	int32_t __nsets;
59142661Sphantom	int32_t __mem;
60142661Sphantom	int32_t __msg_hdr_offset;
61142661Sphantom	int32_t __msg_txt_offset;
62142661Sphantom} ;
63142661Sphantom
64142661Sphantomstruct _nls_set_hdr {
65142661Sphantom	int32_t __setno;	/* set number: 0 < x <= NL_SETMAX */
66142661Sphantom	int32_t __nmsgs;	/* number of messages in the set  */
67142661Sphantom	int32_t __index;	/* index of first msg_hdr in msg_hdr table */
68142661Sphantom} ;
69142661Sphantom
70142661Sphantomstruct _nls_msg_hdr {
71142661Sphantom	int32_t __msgno;	/* msg number: 0 < x <= NL_MSGMAX */
72142661Sphantom	int32_t __msglen;
73142661Sphantom	int32_t __offset;
74142661Sphantom} ;
75142661Sphantom
76142661Sphantom#endif	/* _NLS_PRIVATE */
77142661Sphantom
7835545Sache#define	NL_SETD		0
7935545Sache#define	NL_CAT_LOCALE	1
807495Sjkh
81142661Sphantomtypedef struct __nl_cat_d {
82142661Sphantom	void	*__data;
83142661Sphantom	int	__size;
84142661Sphantom} *nl_catd;
85103899Smike
86103521Smike#ifndef _NL_ITEM_DECLARED
87103521Smiketypedef	__nl_item	nl_item;
88103521Smike#define	_NL_ITEM_DECLARED
89103521Smike#endif
90103521Smike
9146673Sjkh__BEGIN_DECLS
92142661Sphantomnl_catd  catopen(const char *, int);
93154867Sstefanfchar    *catgets(nl_catd, int, int, const char *) __format_arg(4);
94103899Smikeint	 catclose(nl_catd);
9546673Sjkh__END_DECLS
967495Sjkh
97142661Sphantom#endif	/* _NL_TYPES_H_ */
98