1da2e3ebchin
2da2e3ebchin/* : : generated by proto : : */
3da2e3ebchin/***********************************************************************
4da2e3ebchin*                                                                      *
5da2e3ebchin*               This software is part of the ast package               *
63e14f97Roger A. Faulkner*          Copyright (c) 1985-2010 AT&T Intellectual Property          *
7da2e3ebchin*                      and is licensed under the                       *
8da2e3ebchin*                  Common Public License, Version 1.0                  *
97c2fbfbApril Chin*                    by AT&T Intellectual Property                     *
10da2e3ebchin*                                                                      *
11da2e3ebchin*                A copy of the License is available at                 *
12da2e3ebchin*            http://www.opensource.org/licenses/cpl1.0.txt             *
13da2e3ebchin*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
14da2e3ebchin*                                                                      *
15da2e3ebchin*              Information and Software Systems Research               *
16da2e3ebchin*                            AT&T Research                             *
17da2e3ebchin*                           Florham Park NJ                            *
18da2e3ebchin*                                                                      *
19da2e3ebchin*                 Glenn Fowler <gsf@research.att.com>                  *
20da2e3ebchin*                  David Korn <dgk@research.att.com>                   *
21da2e3ebchin*                   Phong Vo <kpv@research.att.com>                    *
22da2e3ebchin*                                                                      *
23da2e3ebchin***********************************************************************/
24da2e3ebchin
25da2e3ebchin/*
26da2e3ebchin * Advanced Software Technology Library
27da2e3ebchin * AT&T Research
28da2e3ebchin *
29da2e3ebchin * a union of standard headers that works
30da2e3ebchin * with local extensions enabled
31da2e3ebchin * and local omission compensation
32da2e3ebchin */
33da2e3ebchin
34da2e3ebchin#ifndef _AST_STD_H
35da2e3ebchin#if !defined(__PROTO__)
36da2e3ebchin#include <prototyped.h>
37da2e3ebchin#endif
38da2e3ebchin#if !defined(__LINKAGE__)
39da2e3ebchin#define __LINKAGE__		/* 2004-08-11 transition */
40da2e3ebchin#endif
41da2e3ebchin
42da2e3ebchin#define _AST_STD_H		1
43da2e3ebchin#define _AST_STD_I		1
44da2e3ebchin
45da2e3ebchin#include <ast_common.h>
46da2e3ebchin
47da2e3ebchin#if _BLD_ast
48da2e3ebchin#define _BLD_cdt	1
49da2e3ebchin#define _BLD_sfio	1
50da2e3ebchin#if !_UWIN
51da2e3ebchin#define _BLD_vmalloc	1
52da2e3ebchin#endif
53da2e3ebchin#endif
54da2e3ebchin
55da2e3ebchin#ifdef	_SFSTDIO_H
56da2e3ebchin#define _SKIP_SFSTDIO_H
57da2e3ebchin#else
58da2e3ebchin#define _SFSTDIO_H
59da2e3ebchin#ifndef FILE
60da2e3ebchin#ifndef _SFIO_H
61da2e3ebchinstruct _sfio_s;
62da2e3ebchin#endif
63da2e3ebchin#define FILE		struct _sfio_s
64da2e3ebchin#ifndef	__FILE_typedef
65da2e3ebchin#define __FILE_typedef	1
66da2e3ebchin#endif
67da2e3ebchin#ifndef _FILEDEFED
68da2e3ebchin#define _FILEDEFED	1
69da2e3ebchin#endif
70da2e3ebchin#endif
71da2e3ebchin#endif
72da2e3ebchin
73da2e3ebchin#include <ast_lib.h>
74da2e3ebchin#include <ast_sys.h>
75da2e3ebchin#include <ast_getopt.h>	/* <stdlib.h> does this */
76da2e3ebchin#include <ast_fcntl.h>
77da2e3ebchin#include <ast_limits.h>
78da2e3ebchin#include <ast_botch.h>
79da2e3ebchin
80da2e3ebchin#ifdef	_SKIP_SFSTDIO_H
81da2e3ebchin#undef	_SKIP_SFSTDIO_H
82da2e3ebchin#else
83da2e3ebchin#undef	_SFSTDIO_H
84da2e3ebchin#undef	FILE
85da2e3ebchin#endif
86da2e3ebchin
87da2e3ebchin/* locale stuff */
88da2e3ebchin
89da2e3ebchin#if !_hdr_locale
90da2e3ebchin
91da2e3ebchinstruct lconv
92da2e3ebchin{
93da2e3ebchin	char*	decimal_point;
94da2e3ebchin	char*	thousands_sep;
95da2e3ebchin	char*	grouping;
96da2e3ebchin	char*	int_curr_symbol;
97da2e3ebchin	char*	currency_symbol;
98da2e3ebchin	char*	mon_decimal_point;
99da2e3ebchin	char*	mon_thousands_sep;
100da2e3ebchin	char*	mon_grouping;
101da2e3ebchin	char*	positive_sign;
102da2e3ebchin	char*	negative_sign;
103da2e3ebchin	char	int_frac_digits;
104da2e3ebchin	char	frac_digits;
105da2e3ebchin	char	p_cs_precedes;
106da2e3ebchin	char	p_sep_by_space;
107da2e3ebchin	char	n_cs_precedes;
108da2e3ebchin	char	n_sep_by_space;
109da2e3ebchin	char	p_sign_posn;
110da2e3ebchin	char	n_sign_posn;
111da2e3ebchin};
112da2e3ebchin
113da2e3ebchin#endif
114da2e3ebchin
115da2e3ebchin#if _BLD_ast && defined(__EXPORT__)
116da2e3ebchin#undef __MANGLE__
117da2e3ebchin#define __MANGLE__ __LINKAGE__		__EXPORT__
118da2e3ebchin#endif
119da2e3ebchin
12034f9b3eRoland Mainz#if !_UWIN /* for ast54 compatibility */
12134f9b3eRoland Mainz
1227c2fbfbApril Chin#undef	getenv
1237c2fbfbApril Chin#define getenv		_ast_getenv
1247c2fbfbApril Chin
12534f9b3eRoland Mainz#undef	setenviron
12634f9b3eRoland Mainz#define setenviron	_ast_setenviron
12734f9b3eRoland Mainz
12834f9b3eRoland Mainzextern __MANGLE__ char*		getenv __PROTO__((const char*));
12934f9b3eRoland Mainz
13034f9b3eRoland Mainz#endif
13134f9b3eRoland Mainz
132da2e3ebchin#undef	localeconv
133da2e3ebchin#define localeconv	_ast_localeconv
134da2e3ebchin
135da2e3ebchin#undef	setlocale
136da2e3ebchin#define setlocale	_ast_setlocale
137da2e3ebchin
138da2e3ebchin#undef	strerror
139da2e3ebchin#define strerror	_ast_strerror
140da2e3ebchin
141da2e3ebchinextern __MANGLE__ struct lconv*	localeconv __PROTO__((void));
1427c2fbfbApril Chinextern __MANGLE__ char*		setenviron __PROTO__((const char*));
143da2e3ebchinextern __MANGLE__ char*		setlocale __PROTO__((int, const char*));
144da2e3ebchinextern __MANGLE__ char*		strerror __PROTO__((int));
145da2e3ebchin
146da2e3ebchin#define AST_MESSAGE_SET		3	/* see <mc.h> mcindex()		*/
147da2e3ebchin
148da2e3ebchin/*
149da2e3ebchin * maintain this order when adding categories
150da2e3ebchin */
151da2e3ebchin
152da2e3ebchin#define AST_LC_ALL		0
153da2e3ebchin#define AST_LC_COLLATE		1
154da2e3ebchin#define AST_LC_CTYPE		2
155da2e3ebchin#define AST_LC_MESSAGES		3
156da2e3ebchin#define AST_LC_MONETARY		4
157da2e3ebchin#define AST_LC_NUMERIC		5
158da2e3ebchin#define AST_LC_TIME		6
159da2e3ebchin#define AST_LC_IDENTIFICATION	7
160da2e3ebchin#define AST_LC_ADDRESS		8
161da2e3ebchin#define AST_LC_NAME		9
162da2e3ebchin#define AST_LC_TELEPHONE	10
163da2e3ebchin#define AST_LC_XLITERATE	11
164da2e3ebchin#define AST_LC_MEASUREMENT	12
165da2e3ebchin#define AST_LC_PAPER		13
166da2e3ebchin#define AST_LC_COUNT		14
16734f9b3eRoland Mainz#define AST_LC_LANG		255
168da2e3ebchin
1693e14f97Roger A. Faulkner#define AST_LC_internal		1
1703e14f97Roger A. Faulkner#define AST_LC_setenv		(1L<<27)
171da2e3ebchin#define AST_LC_find		(1L<<28)
172da2e3ebchin#define AST_LC_debug		(1L<<29)
173da2e3ebchin#define AST_LC_setlocale	(1L<<30)
174da2e3ebchin#define AST_LC_translate	(1L<<31)
175da2e3ebchin
176da2e3ebchin#ifndef LC_ALL
177da2e3ebchin#define LC_ALL			(-AST_LC_ALL)
178da2e3ebchin#endif
179da2e3ebchin#ifndef LC_COLLATE
180da2e3ebchin#define LC_COLLATE		(-AST_LC_COLLATE)
181da2e3ebchin#endif
182da2e3ebchin#ifndef LC_CTYPE
183da2e3ebchin#define LC_CTYPE		(-AST_LC_CTYPE)
184da2e3ebchin#endif
185da2e3ebchin#ifndef LC_MESSAGES
186da2e3ebchin#define LC_MESSAGES		(-AST_LC_MESSAGES)
187da2e3ebchin#endif
188da2e3ebchin#ifndef LC_MONETARY
189da2e3ebchin#define LC_MONETARY		(-AST_LC_MONETARY)
190da2e3ebchin#endif
191da2e3ebchin#ifndef LC_NUMERIC
192da2e3ebchin#define LC_NUMERIC		(-AST_LC_NUMERIC)
193da2e3ebchin#endif
194da2e3ebchin#ifndef LC_TIME
195da2e3ebchin#define LC_TIME			(-AST_LC_TIME)
196da2e3ebchin#endif
197da2e3ebchin#ifndef LC_ADDRESS
198da2e3ebchin#define LC_ADDRESS		(-AST_LC_ADDRESS)
199da2e3ebchin#endif
200da2e3ebchin#ifndef LC_IDENTIFICATION
201da2e3ebchin#define LC_IDENTIFICATION	(-AST_LC_IDENTIFICATION)
202da2e3ebchin#endif
203da2e3ebchin#ifndef LC_NAME
204da2e3ebchin#define LC_NAME			(-AST_LC_NAME)
205da2e3ebchin#endif
206da2e3ebchin#ifndef LC_TELEPHONE
207da2e3ebchin#define LC_TELEPHONE		(-AST_LC_TELEPHONE)
208da2e3ebchin#endif
209da2e3ebchin#ifndef LC_XLITERATE
210da2e3ebchin#define LC_XLITERATE		(-AST_LC_XLITERATE)
211da2e3ebchin#endif
212da2e3ebchin#ifndef LC_MEASUREMENT
213da2e3ebchin#define LC_MEASUREMENT		(-AST_LC_MEASUREMENT)
214da2e3ebchin#endif
215da2e3ebchin#ifndef LC_PAPER
216da2e3ebchin#define LC_PAPER		(-AST_LC_PAPER)
217da2e3ebchin#endif
21834f9b3eRoland Mainz#ifndef LC_LANG
21934f9b3eRoland Mainz#define LC_LANG			(-AST_LC_LANG)
22034f9b3eRoland Mainz#endif
221da2e3ebchin
222da2e3ebchin#undef __MANGLE__
223da2e3ebchin#define __MANGLE__ __LINKAGE__
224da2e3ebchin
225da2e3ebchin#undef	strcoll
226da2e3ebchin#if _std_strcoll
227da2e3ebchin#define strcoll		_ast_info.collate
228da2e3ebchin#else
229da2e3ebchin#define strcoll		strcmp
230da2e3ebchin#endif
231da2e3ebchin
232da2e3ebchintypedef struct
233da2e3ebchin{
234da2e3ebchin
235da2e3ebchin	char*		id;
236da2e3ebchin
237da2e3ebchin	struct
238da2e3ebchin	{
239da2e3ebchin	uint32_t	serial;
240da2e3ebchin	uint32_t	set;
241da2e3ebchin	}		locale;
242da2e3ebchin
243da2e3ebchin	long		tmp_long;
244da2e3ebchin	size_t		tmp_size;
245da2e3ebchin	short		tmp_short;
246da2e3ebchin	char		tmp_char;
247da2e3ebchin	wchar_t		tmp_wchar;
248da2e3ebchin
249da2e3ebchin	int		(*collate) __PROTO__((const char*, const char*));
250da2e3ebchin
251da2e3ebchin	int		tmp_int;
252da2e3ebchin	__V_*		tmp_pointer;
253da2e3ebchin
254da2e3ebchin	int		mb_cur_max;
255da2e3ebchin	int		(*mb_len) __PROTO__((const char*, size_t));
256da2e3ebchin	int		(*mb_towc) __PROTO__((wchar_t*, const char*, size_t));
257da2e3ebchin	size_t		(*mb_xfrm) __PROTO__((char*, const char*, size_t));
258da2e3ebchin	int		(*mb_width) __PROTO__((wchar_t));
259da2e3ebchin	int		(*mb_conv) __PROTO__((char*, wchar_t));
260da2e3ebchin
261da2e3ebchin	uint32_t	env_serial;
26234f9b3eRoland Mainz	uint32_t	mb_sync;
2633e14f97Roger A. Faulkner	uint32_t	version;
264da2e3ebchin
2653e14f97Roger A. Faulkner	char		pad[936];
266da2e3ebchin
267da2e3ebchin} _Ast_info_t;
268da2e3ebchin
269da2e3ebchin#if _BLD_ast && defined(__EXPORT__)
270da2e3ebchin#undef __MANGLE__
271da2e3ebchin#define __MANGLE__ __LINKAGE__ __EXPORT__
272da2e3ebchin#endif
273da2e3ebchin#if !_BLD_ast && defined(__IMPORT__)
274da2e3ebchin#undef __MANGLE__
275da2e3ebchin#define __MANGLE__ __LINKAGE__ __IMPORT__
276da2e3ebchin#endif
277da2e3ebchin
278da2e3ebchinextern __MANGLE__ _Ast_info_t	_ast_info;
279da2e3ebchin
280da2e3ebchin#undef __MANGLE__
281da2e3ebchin#define __MANGLE__ __LINKAGE__
282da2e3ebchin
283da2e3ebchin/* largefile hackery -- ast uses the large versions by default */
284da2e3ebchin
285da2e3ebchin#if _typ_off64_t
286da2e3ebchin#undef	off_t
287da2e3ebchin#define off_t		off64_t
288da2e3ebchin#endif
289da2e3ebchin#if !defined(ftruncate) && _lib_ftruncate64
290da2e3ebchin#define ftruncate	ftruncate64
291da2e3ebchinextern __MANGLE__ int		ftruncate64 __PROTO__((int, off64_t));
292da2e3ebchin#endif
293da2e3ebchin#if !defined(lseek) && _lib_lseek64
294da2e3ebchin#define lseek		lseek64
295da2e3ebchinextern __MANGLE__ off64_t		lseek64 __PROTO__((int, off64_t, int));
296da2e3ebchin#endif
297da2e3ebchin#if !defined(truncate) && _lib_truncate64
298da2e3ebchin#define truncate	truncate64
299da2e3ebchinextern __MANGLE__ int		truncate64 __PROTO__((const char*, off64_t));
300da2e3ebchin#endif
301da2e3ebchin
302da2e3ebchin/* direct macro access for bsd crossover */
303da2e3ebchin
304da2e3ebchin#if !defined(__cplusplus)
305da2e3ebchin
306da2e3ebchin#if !defined(memcpy) && !defined(_lib_memcpy) && defined(_lib_bcopy)
307da2e3ebchin#define memcpy(t,f,n)	(bcopy(f,t,n),(t))
308da2e3ebchin#endif
309da2e3ebchin
310da2e3ebchin#if !defined(memzero) && !defined(_lib_memzero)
311da2e3ebchin#if defined(_lib_memset) || !defined(_lib_bzero)
312da2e3ebchin#define memzero(b,n)	memset(b,0,n)
313da2e3ebchin#else
314da2e3ebchin#define memzero(b,n)	(bzero(b,n),(b))
315da2e3ebchin#endif
316da2e3ebchin#endif
317da2e3ebchin
318da2e3ebchin#endif
319da2e3ebchin
320da2e3ebchin#if !defined(remove)
321da2e3ebchinextern __MANGLE__ int		remove __PROTO__((const char*));
322da2e3ebchin#endif
323da2e3ebchin
324da2e3ebchin#if !defined(rename)
325da2e3ebchinextern __MANGLE__ int		rename __PROTO__((const char*, const char*));
326da2e3ebchin#endif
327da2e3ebchin
328da2e3ebchin#if !defined(strchr) && !defined(_lib_strchr) && defined(_lib_index)
329da2e3ebchin#define strchr(s,c)	index(s,c)
330da2e3ebchin#endif
331da2e3ebchin
332da2e3ebchin#if !defined(strrchr) && !defined(_lib_strrchr) && defined(_lib_rindex)
333da2e3ebchin#define strrchr(s,c)	rindex(s,c)
334da2e3ebchin#endif
335da2e3ebchin
336da2e3ebchin/* and now introducing prototypes botched by the standard(s) */
337da2e3ebchin
338da2e3ebchin#if _BLD_ast && defined(__EXPORT__)
339da2e3ebchin#undef __MANGLE__
340da2e3ebchin#define __MANGLE__ __LINKAGE__		__EXPORT__
341da2e3ebchin#endif
342da2e3ebchin
343da2e3ebchin#undef	getpgrp
344da2e3ebchin#define	getpgrp()	_ast_getpgrp()
345da2e3ebchinextern __MANGLE__ int		_ast_getpgrp __PROTO__((void));
346da2e3ebchin
347da2e3ebchin#undef __MANGLE__
348da2e3ebchin#define __MANGLE__ __LINKAGE__
349da2e3ebchin
350da2e3ebchin/*
351da2e3ebchin * and finally, standard interfaces hijacked by ast
3523e14f97Roger A. Faulkner * _AST_STD_I delays headers that require <ast_map.h>
353da2e3ebchin */
354da2e3ebchin
355da2e3ebchin#include <ast_map.h>
356da2e3ebchin
357da2e3ebchin#undef	_AST_STD_I
358da2e3ebchin
3597c2fbfbApril Chin#if _AST_GETOPT_H < 0
3607c2fbfbApril Chin#undef	_AST_GETOPT_H
3617c2fbfbApril Chin#include <ast_getopt.h>
3627c2fbfbApril Chin#endif
3637c2fbfbApril Chin
3647c2fbfbApril Chin#if _GETOPT_H < 0
3657c2fbfbApril Chin#undef	_GETOPT_H
3667c2fbfbApril Chin#include <getopt.h>
3677c2fbfbApril Chin#endif
3687c2fbfbApril Chin
369da2e3ebchin#if _REGEX_H < 0
370da2e3ebchin#undef	_REGEX_H
371da2e3ebchin#include <regex.h>
372da2e3ebchin#endif
373da2e3ebchin
374da2e3ebchin#endif
375