xref: /titanic_41/usr/src/lib/libast/sparcv9/include/ast/mc.h (revision cde2885fdf538266ee2a3b08dee2d5075ce8fa2b)
1 
2 /* : : generated by proto : : */
3 /***********************************************************************
4 *                                                                      *
5 *               This software is part of the ast package               *
6 *          Copyright (c) 1985-2008 AT&T Intellectual Property          *
7 *                      and is licensed under the                       *
8 *                  Common Public License, Version 1.0                  *
9 *                    by AT&T Intellectual Property                     *
10 *                                                                      *
11 *                A copy of the License is available at                 *
12 *            http://www.opensource.org/licenses/cpl1.0.txt             *
13 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
14 *                                                                      *
15 *              Information and Software Systems Research               *
16 *                            AT&T Research                             *
17 *                           Florham Park NJ                            *
18 *                                                                      *
19 *                 Glenn Fowler <gsf@research.att.com>                  *
20 *                  David Korn <dgk@research.att.com>                   *
21 *                   Phong Vo <kpv@research.att.com>                    *
22 *                                                                      *
23 ***********************************************************************/
24 
25 
26 /*
27  * machine independent binary message catalog interface
28  *
29  * file layout
30  * all numbers are sfputu() format
31  *
32  *	4 char magic (^M^S^G0)
33  *	<method locale YYYY-MM-DD>\0
34  *	(<optional strings>\0)*
35  *	\0
36  *	string table size
37  *	#msgs total
38  *	#max set number
39  *	#set-id 1
40  *	#msgs in set 1
41  *	 ...
42  *	#set-id #sets
43  *	#msgs in set #sets
44  *	end of sets (0)
45  *	msg(1,1) size
46  *	 ...
47  *	msg(#sets,#msgs) size
48  *	string table
49  */
50 
51 #ifndef _MC_H
52 #if !defined(__PROTO__)
53 #include <prototyped.h>
54 #endif
55 #if !defined(__LINKAGE__)
56 #define __LINKAGE__		/* 2004-08-11 transition */
57 #endif
58 
59 #define _MC_H
60 
61 #include <ast.h>
62 
63 #define MC_MAGIC	"\015\023\007\000"
64 #define MC_MAGIC_SIZE	4
65 
66 #define MC_SET_MAX	1023
67 #define MC_NUM_MAX	32767
68 
69 #define MC_NLS		(1<<10)
70 
71 #define MC_MESSAGE_SET(s)	mcindex(s,NiL,NiL,NiL)
72 
73 typedef struct
74 {
75 	char**		msg;
76 	int		num;
77 	int		gen;
78 } Mcset_t;
79 
80 typedef struct
81 {
82 	Mcset_t*	set;
83 	int		num;
84 	int		gen;
85 	char*		translation;
86 #ifdef _MC_PRIVATE_
87 	_MC_PRIVATE_
88 #endif
89 } Mc_t;
90 
91 #if _BLD_ast && defined(__EXPORT__)
92 #undef __MANGLE__
93 #define __MANGLE__ __LINKAGE__		__EXPORT__
94 #endif
95 
96 extern __MANGLE__ char*		mcfind __PROTO__((char*, const char*, const char*, int, int));
97 extern __MANGLE__ Mc_t*		mcopen __PROTO__((Sfio_t*));
98 extern __MANGLE__ char*		mcget __PROTO__((Mc_t*, int, int, const char*));
99 extern __MANGLE__ int		mcput __PROTO__((Mc_t*, int, int, const char*));
100 extern __MANGLE__ int		mcdump __PROTO__((Mc_t*, Sfio_t*));
101 extern __MANGLE__ int		mcindex __PROTO__((const char*, char**, int*, int*));
102 extern __MANGLE__ int		mcclose __PROTO__((Mc_t*));
103 
104 #undef __MANGLE__
105 #define __MANGLE__ __LINKAGE__
106 
107 #endif
108