VirtualBox

source: vbox/trunk/src/libs/libxslt-1.1.22/libxslt/trio.h@ 20364

最後變更 在這個檔案從20364是 7299,由 vboxsync 提交於 17 年 前

Added vboxconfig.h for linux builds.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Date Revision Author Id
檔案大小: 7.1 KB
 
1/*************************************************************************
2 *
3 * $Id: trio.h 7299 2008-03-05 11:02:10Z vboxsync $
4 *
5 * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
15 *
16 *************************************************************************
17 *
18 * http://ctrio.sourceforge.net/
19 *
20 ************************************************************************/
21
22#ifndef TRIO_TRIO_H
23#define TRIO_TRIO_H
24
25#if !defined(WITHOUT_TRIO)
26
27/*
28 * Use autoconf defines if present. Packages using trio must define
29 * HAVE_CONFIG_H as a compiler option themselves.
30 */
31#if defined(HAVE_CONFIG_H)
32# if defined(VBOX)
33# include "vboxconfig.h"
34# else
35# include <config.h>
36# endif
37#endif
38
39#include "triodef.h"
40
41#include <stdio.h>
42#include <stdlib.h>
43#if defined(TRIO_COMPILER_ANCIENT)
44# include <varargs.h>
45#else
46# include <stdarg.h>
47#endif
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53/*
54 * Error codes.
55 *
56 * Remember to add a textual description to trio_strerror.
57 */
58enum {
59 TRIO_EOF = 1,
60 TRIO_EINVAL = 2,
61 TRIO_ETOOMANY = 3,
62 TRIO_EDBLREF = 4,
63 TRIO_EGAP = 5,
64 TRIO_ENOMEM = 6,
65 TRIO_ERANGE = 7,
66 TRIO_ERRNO = 8,
67 TRIO_ECUSTOM = 9
68};
69
70/* Error macros */
71#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)
72#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)
73#define TRIO_ERROR_NAME(x) trio_strerror(x)
74
75typedef int (*trio_outstream_t) TRIO_PROTO((trio_pointer_t, int));
76typedef int (*trio_instream_t) TRIO_PROTO((trio_pointer_t));
77
78TRIO_CONST char *trio_strerror TRIO_PROTO((int));
79
80/*************************************************************************
81 * Print Functions
82 */
83
84int trio_printf TRIO_PROTO((TRIO_CONST char *format, ...));
85int trio_vprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));
86int trio_printfv TRIO_PROTO((TRIO_CONST char *format, void **args));
87
88int trio_fprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));
89int trio_vfprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));
90int trio_fprintfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));
91
92int trio_dprintf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));
93int trio_vdprintf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));
94int trio_dprintfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));
95
96int trio_cprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
97 TRIO_CONST char *format, ...));
98int trio_vcprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
99 TRIO_CONST char *format, va_list args));
100int trio_cprintfv TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,
101 TRIO_CONST char *format, void **args));
102
103int trio_sprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, ...));
104int trio_vsprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, va_list args));
105int trio_sprintfv TRIO_PROTO((char *buffer, TRIO_CONST char *format, void **args));
106
107int trio_snprintf TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));
108int trio_vsnprintf TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
109 va_list args));
110int trio_snprintfv TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
111 void **args));
112
113int trio_snprintfcat TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));
114int trio_vsnprintfcat TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,
115 va_list args));
116
117char *trio_aprintf TRIO_PROTO((TRIO_CONST char *format, ...));
118char *trio_vaprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));
119
120int trio_asprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, ...));
121int trio_vasprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, va_list args));
122
123/*************************************************************************
124 * Scan Functions
125 */
126int trio_scanf TRIO_PROTO((TRIO_CONST char *format, ...));
127int trio_vscanf TRIO_PROTO((TRIO_CONST char *format, va_list args));
128int trio_scanfv TRIO_PROTO((TRIO_CONST char *format, void **args));
129
130int trio_fscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));
131int trio_vfscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));
132int trio_fscanfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));
133
134int trio_dscanf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));
135int trio_vdscanf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));
136int trio_dscanfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));
137
138int trio_cscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
139 TRIO_CONST char *format, ...));
140int trio_vcscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
141 TRIO_CONST char *format, va_list args));
142int trio_cscanfv TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,
143 TRIO_CONST char *format, void **args));
144
145int trio_sscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, ...));
146int trio_vsscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, va_list args));
147int trio_sscanfv TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, void **args));
148
149/*************************************************************************
150 * Locale Functions
151 */
152void trio_locale_set_decimal_point TRIO_PROTO((char *decimalPoint));
153void trio_locale_set_thousand_separator TRIO_PROTO((char *thousandSeparator));
154void trio_locale_set_grouping TRIO_PROTO((char *grouping));
155
156/*************************************************************************
157 * Renaming
158 */
159#ifdef TRIO_REPLACE_STDIO
160/* Replace the <stdio.h> functions */
161#ifndef HAVE_PRINTF
162# define printf trio_printf
163#endif
164#ifndef HAVE_VPRINTF
165# define vprintf trio_vprintf
166#endif
167#ifndef HAVE_FPRINTF
168# define fprintf trio_fprintf
169#endif
170#ifndef HAVE_VFPRINTF
171# define vfprintf trio_vfprintf
172#endif
173#ifndef HAVE_SPRINTF
174# define sprintf trio_sprintf
175#endif
176#ifndef HAVE_VSPRINTF
177# define vsprintf trio_vsprintf
178#endif
179#ifndef HAVE_SNPRINTF
180# define snprintf trio_snprintf
181#endif
182#ifndef HAVE_VSNPRINTF
183# define vsnprintf trio_vsnprintf
184#endif
185#ifndef HAVE_SCANF
186# define scanf trio_scanf
187#endif
188#ifndef HAVE_VSCANF
189# define vscanf trio_vscanf
190#endif
191#ifndef HAVE_FSCANF
192# define fscanf trio_fscanf
193#endif
194#ifndef HAVE_VFSCANF
195# define vfscanf trio_vfscanf
196#endif
197#ifndef HAVE_SSCANF
198# define sscanf trio_sscanf
199#endif
200#ifndef HAVE_VSSCANF
201# define vsscanf trio_vsscanf
202#endif
203/* These aren't stdio functions, but we make them look similar */
204#define dprintf trio_dprintf
205#define vdprintf trio_vdprintf
206#define aprintf trio_aprintf
207#define vaprintf trio_vaprintf
208#define asprintf trio_asprintf
209#define vasprintf trio_vasprintf
210#define dscanf trio_dscanf
211#define vdscanf trio_vdscanf
212#endif
213
214#ifdef __cplusplus
215} /* extern "C" */
216#endif
217
218#endif /* WITHOUT_TRIO */
219
220#endif /* TRIO_TRIO_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette