Edinburgh Speech Tools  2.1-release
stdio16.h
Go to the documentation of this file.
1 /*************************************************************************/
2 /* */
3 /* Copyright (c) 1997-98 Richard Tobin, Language Technology Group, HCRC, */
4 /* University of Edinburgh. */
5 /* */
6 /* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, */
7 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
8 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
9 /* IN NO EVENT SHALL THE AUTHOR OR THE UNIVERSITY OF EDINBURGH BE LIABLE */
10 /* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF */
11 /* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION */
12 /* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
13 /* */
14 /*************************************************************************/
15 #ifndef STDIO16_H
16 #define STDIO16_H
17 
18 #ifndef FOR_LT
19 #define STD_API
20 #endif
21 
22 #include <stdarg.h>
23 #include <stdio.h>
24 #ifdef HAVE_LIBZ
25 #include "zlib.h"
26 #endif
27 #include "charset.h"
28 
29 typedef struct _FILE16 FILE16;
30 
31 extern STD_API FILE16 *Stdin, *Stdout, *Stderr;
32 
33 STD_API FILE16 *MakeFILE16FromFILE(FILE *f, const char *type);
34 STD_API FILE16 *MakeFILE16FromString(void *buf, long size, const char *type);
35 #ifdef WIN32
36 #ifdef SOCKETS_IMPLEMENTED
37 STD_API FILE16 *MakeFILE16FromWinsock(int sock, const char *type);
38 #endif
39 #endif
40 #ifdef HAVE_LIBZ
41 STD_API FILE16 *MakeFILE16FromGzip(gzFile file, const char *type);
42 #endif
43 
44 STD_API int Readu(FILE16 *file, unsigned char *buf, int max_count);
45 STD_API int Writeu(FILE16 *file, unsigned char *buf, int count);
46 STD_API int Fclose(FILE16 *file);
47 STD_API int Fflush(FILE16 *file);
48 STD_API int Fseek(FILE16 *file, long offset, int ptrname);
49 
50 STD_API FILE *GetFILE(FILE16 *file);
51 STD_API void SetCloseUnderlying(FILE16 *file, int cu);
54 
55 STD_API int Fprintf(FILE16 *file, const char *format, ...);
56 STD_API int Vfprintf(FILE16 *file, const char *format, va_list args);
57 
58 STD_API int Printf(const char *format, ...);
59 STD_API int Vprintf(const char *format, va_list args);
60 
61 STD_API int Sprintf(void *buf, CharacterEncoding enc, const char *format, ...);
62 STD_API int Vsprintf(void *buf, CharacterEncoding enc, const char *format,
63  va_list args);
64 
65 STD_API void init_stdio16(void);
66 
67 #endif /* STDIO16_H */
STD_API void SetFileEncoding(FILE16 *file, CharacterEncoding encoding)
Definition: stdio16.c:355
STD_API FILE16 * Stderr
Definition: stdio16.c:123
STD_API CharacterEncoding GetFileEncoding(FILE16 *file)
Definition: stdio16.c:360
STD_API FILE16 * MakeFILE16FromFILE(FILE *f, const char *type)
Definition: stdio16.c:670
STD_API void SetCloseUnderlying(FILE16 *file, int cu)
Definition: stdio16.c:347
STD_API int Vsprintf(void *buf, CharacterEncoding enc, const char *format, va_list args)
Definition: stdio16.c:400
#define STD_API
Definition: stdio16.h:19
CharacterEncoding encoding
Definition: rxp.c:23
STD_API FILE16 * Stdout
Definition: stdio16.c:123
STD_API int Readu(FILE16 *file, unsigned char *buf, int max_count)
Definition: stdio16.c:309
f
Definition: EST_item_aux.cc:48
STD_API FILE * GetFILE(FILE16 *file)
Definition: stdio16.c:339
STD_API int Vprintf(const char *format, va_list args)
Definition: stdio16.c:395
STD_API int Printf(const char *format,...)
Definition: stdio16.c:375
STD_API void init_stdio16(void)
Definition: stdio16.c:125
STD_API int Fseek(FILE16 *file, long offset, int ptrname)
Definition: stdio16.c:329
STD_API int Writeu(FILE16 *file, unsigned char *buf, int count)
Definition: stdio16.c:314
STD_API int Vfprintf(FILE16 *file, const char *format, va_list args)
Definition: stdio16.c:417
enum character_encoding CharacterEncoding
Definition: charset.h:61
STD_API FILE16 * Stdin
Definition: stdio16.c:123
STD_API int Fflush(FILE16 *file)
Definition: stdio16.c:334
STD_API int Fclose(FILE16 *file)
Definition: stdio16.c:319
STD_API int Fprintf(FILE16 *file, const char *format,...)
Definition: stdio16.c:365
STD_API int Sprintf(void *buf, CharacterEncoding enc, const char *format,...)
Definition: stdio16.c:385
STD_API FILE16 * MakeFILE16FromString(void *buf, long size, const char *type)
Definition: stdio16.c:727