1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
24 * Advanced Software Technology Library
27 * a union of standard headers that works
28 * with local extensions enabled
29 * and local omission compensation
36 #include <ast_common.h>
42 #define _BLD_vmalloc 1
47 #define _SKIP_SFSTDIO_H
54 #define FILE struct _sfio_s
55 #ifndef __FILE_typedef
56 #define __FILE_typedef 1
66 #include <ast_getopt.h> /* <stdlib.h> does this */
67 #include <ast_fcntl.h>
68 #include <ast_limits.h>
69 #include <ast_botch.h>
71 #ifdef _SKIP_SFSTDIO_H
72 #undef _SKIP_SFSTDIO_H
87 char* int_curr_symbol
;
88 char* currency_symbol
;
89 char* mon_decimal_point
;
90 char* mon_thousands_sep
;
106 #if _BLD_ast && defined(__EXPORT__)
107 #define extern __EXPORT__
110 #if !_UWIN /* for ast54 compatibility */
113 #define getenv _ast_getenv
116 #define setenviron _ast_setenviron
118 extern char* getenv(const char*);
123 #define localeconv _ast_localeconv
126 #define setlocale _ast_setlocale
129 #define strerror _ast_strerror
131 extern struct lconv
* localeconv(void);
132 extern char* setenviron(const char*);
133 extern char* setlocale(int, const char*);
134 extern char* strerror(int);
136 #define AST_MESSAGE_SET 3 /* see <mc.h> mcindex() */
139 * maintain this order when adding categories
143 #define AST_LC_COLLATE 1
144 #define AST_LC_CTYPE 2
145 #define AST_LC_MESSAGES 3
146 #define AST_LC_MONETARY 4
147 #define AST_LC_NUMERIC 5
148 #define AST_LC_TIME 6
149 #define AST_LC_IDENTIFICATION 7
150 #define AST_LC_ADDRESS 8
151 #define AST_LC_NAME 9
152 #define AST_LC_TELEPHONE 10
153 #define AST_LC_XLITERATE 11
154 #define AST_LC_MEASUREMENT 12
155 #define AST_LC_PAPER 13
156 #define AST_LC_COUNT 14
157 #define AST_LC_LANG 255
159 #define AST_LC_internal 1
160 #define AST_LC_setenv (1L<<27)
161 #define AST_LC_find (1L<<28)
162 #define AST_LC_debug (1L<<29)
163 #define AST_LC_setlocale (1L<<30)
164 #define AST_LC_translate (1L<<31)
167 #define LC_ALL (-AST_LC_ALL)
170 #define LC_COLLATE (-AST_LC_COLLATE)
173 #define LC_CTYPE (-AST_LC_CTYPE)
176 #define LC_MESSAGES (-AST_LC_MESSAGES)
179 #define LC_MONETARY (-AST_LC_MONETARY)
182 #define LC_NUMERIC (-AST_LC_NUMERIC)
185 #define LC_TIME (-AST_LC_TIME)
188 #define LC_ADDRESS (-AST_LC_ADDRESS)
190 #ifndef LC_IDENTIFICATION
191 #define LC_IDENTIFICATION (-AST_LC_IDENTIFICATION)
194 #define LC_NAME (-AST_LC_NAME)
197 #define LC_TELEPHONE (-AST_LC_TELEPHONE)
200 #define LC_XLITERATE (-AST_LC_XLITERATE)
202 #ifndef LC_MEASUREMENT
203 #define LC_MEASUREMENT (-AST_LC_MEASUREMENT)
206 #define LC_PAPER (-AST_LC_PAPER)
209 #define LC_LANG (-AST_LC_LANG)
216 #define strcoll _ast_info.collate
218 #define strcoll strcmp
238 int (*collate
)(const char*, const char*);
244 int (*mb_len
)(const char*, size_t);
245 int (*mb_towc
)(wchar_t*, const char*, size_t);
246 size_t (*mb_xfrm
)(char*, const char*, size_t);
247 int (*mb_width
)(wchar_t);
248 int (*mb_conv
)(char*, wchar_t);
258 #if _BLD_ast && defined(__EXPORT__)
259 #define extern extern __EXPORT__
261 #if !_BLD_ast && defined(__IMPORT__)
262 #define extern extern __IMPORT__
265 extern _Ast_info_t _ast_info
;
269 /* largefile hackery -- ast uses the large versions by default */
273 #define off_t off64_t
275 #if !defined(ftruncate) && _lib_ftruncate64
276 #define ftruncate ftruncate64
277 extern int ftruncate64(int, off64_t
);
279 #if !defined(lseek) && _lib_lseek64
280 #define lseek lseek64
281 extern off64_t
lseek64(int, off64_t
, int);
283 #if !defined(truncate) && _lib_truncate64
284 #define truncate truncate64
285 extern int truncate64(const char*, off64_t
);
288 /* direct macro access for bsd crossover */
290 #if !defined(__cplusplus)
292 #if !defined(memcpy) && !defined(_lib_memcpy) && defined(_lib_bcopy)
293 #define memcpy(t,f,n) (bcopy(f,t,n),(t))
296 #if !defined(memzero) && !defined(_lib_memzero)
297 #if defined(_lib_memset) || !defined(_lib_bzero)
298 #define memzero(b,n) memset(b,0,n)
300 #define memzero(b,n) (bzero(b,n),(b))
307 extern int remove(const char*);
311 extern int rename(const char*, const char*);
314 #if !defined(strchr) && !defined(_lib_strchr) && defined(_lib_index)
315 #define strchr(s,c) index(s,c)
318 #if !defined(strrchr) && !defined(_lib_strrchr) && defined(_lib_rindex)
319 #define strrchr(s,c) rindex(s,c)
322 /* and now introducing prototypes botched by the standard(s) */
324 #if _BLD_ast && defined(__EXPORT__)
325 #define extern __EXPORT__
329 #define getpgrp() _ast_getpgrp()
330 extern int _ast_getpgrp(void);
335 * and finally, standard interfaces hijacked by ast
336 * _AST_STD_I delays headers that require <ast_map.h>
343 #if _AST_GETOPT_H < 0
345 #include <ast_getopt.h>