Edinburgh Speech Tools 2.4-release
stdio16.h
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
29typedef struct _FILE16 FILE16;
30
31extern STD_API FILE16 *Stdin, *Stdout, *Stderr;
32
33STD_API FILE16 *MakeFILE16FromFILE(FILE *f, const char *type);
34STD_API FILE16 *MakeFILE16FromString(void *buf, long size, const char *type);
35#ifdef WIN32
36#ifdef SOCKETS_IMPLEMENTED
37STD_API FILE16 *MakeFILE16FromWinsock(int sock, const char *type);
38#endif
39#endif
40#ifdef HAVE_LIBZ
41STD_API FILE16 *MakeFILE16FromGzip(gzFile file, const char *type);
42#endif
43
44STD_API int Readu(FILE16 *file, unsigned char *buf, int max_count);
45STD_API int Writeu(FILE16 *file, unsigned char *buf, int count);
46STD_API int Fclose(FILE16 *file);
47STD_API int Fflush(FILE16 *file);
48STD_API int Fseek(FILE16 *file, long offset, int ptrname);
49
50STD_API FILE *GetFILE(FILE16 *file);
51STD_API void SetCloseUnderlying(FILE16 *file, int cu);
52STD_API void SetFileEncoding(FILE16 *file, CharacterEncoding encoding);
53STD_API CharacterEncoding GetFileEncoding(FILE16 *file);
54
55STD_API int Fprintf(FILE16 *file, const char *format, ...);
56STD_API int Vfprintf(FILE16 *file, const char *format, va_list args);
57
58STD_API int Printf(const char *format, ...);
59STD_API int Vprintf(const char *format, va_list args);
60
61STD_API int Sprintf(void *buf, CharacterEncoding enc, const char *format, ...);
62STD_API int Vsprintf(void *buf, CharacterEncoding enc, const char *format,
63 va_list args);
64
65STD_API void init_stdio16(void);
66
67#endif /* STDIO16_H */