Edinburgh Speech Tools  2.1-release
stdio16.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "system.h"
#include "charset.h"
#include "string16.h"
#include "stdio16.h"
#include <errno.h>
Include dependency graph for stdio16.c:

Go to the source code of this file.

Macros

#define WIN_IMP
 
#define ERR(m)   fprintf(stderr,m)
 
#define ERR1(m, x)   fprintf(stderr,m,x)
 
#define ERR2(m, x, y)   fprintf(stderr,m,x,y)
 
#define BufferSize   4096
 
#define FILE16_read   0x01
 
#define FILE16_write   0x02
 
#define FILE16_close_underlying   0x04
 
#define put(x)   {nchars++; if(count == sizeof(buf)) {if(ConvertASCII(buf, count, file) == -1) return -1; count = 0;} buf[count++] = x;}
 

Typedefs

typedef int ReadProc(FILE16 *file, unsigned char *buf, int max_count)
 
typedef int WriteProc(FILE16 *file, const unsigned char *buf, int count)
 
typedef int SeekProc(FILE16 *file, long offset, int ptrname)
 
typedef int FlushProc(FILE16 *file)
 
typedef int CloseProc(FILE16 *file)
 

Functions

void init_stdio16 (void)
 
int Readu (FILE16 *file, unsigned char *buf, int max_count)
 
int Writeu (FILE16 *file, unsigned char *buf, int count)
 
int Fclose (FILE16 *file)
 
int Fseek (FILE16 *file, long offset, int ptrname)
 
int Fflush (FILE16 *file)
 
FILE * GetFILE (FILE16 *file)
 
void SetCloseUnderlying (FILE16 *file, int cu)
 
void SetFileEncoding (FILE16 *file, CharacterEncoding encoding)
 
CharacterEncoding GetFileEncoding (FILE16 *file)
 
int Fprintf (FILE16 *file, const char *format,...)
 
int Printf (const char *format,...)
 
int Sprintf (void *buf, CharacterEncoding enc, const char *format,...)
 
int Vprintf (const char *format, va_list args)
 
int Vsprintf (void *buf, CharacterEncoding enc, const char *format, va_list args)
 
int Vfprintf (FILE16 *file, const char *format, va_list args)
 
FILE16 * MakeFILE16FromFILE (FILE *f, const char *type)
 
FILE16 * MakeFILE16FromString (void *buf, long size, const char *type)
 

Variables

FILE16 * Stdin
 
FILE16 * Stdout
 
FILE16 * Stderr
 

Macro Definition Documentation

#define WIN_IMP

Definition at line 48 of file stdio16.c.

#define ERR (   m)    fprintf(stderr,m)

Definition at line 50 of file stdio16.c.

#define ERR1 (   m,
 
)    fprintf(stderr,m,x)

Definition at line 51 of file stdio16.c.

#define ERR2 (   m,
  x,
 
)    fprintf(stderr,m,x,y)

Definition at line 52 of file stdio16.c.

#define BufferSize   4096

Definition at line 68 of file stdio16.c.

#define FILE16_read   0x01

Definition at line 89 of file stdio16.c.

#define FILE16_write   0x02

Definition at line 90 of file stdio16.c.

#define FILE16_close_underlying   0x04

Definition at line 91 of file stdio16.c.

#define put (   x)    {nchars++; if(count == sizeof(buf)) {if(ConvertASCII(buf, count, file) == -1) return -1; count = 0;} buf[count++] = x;}

Definition at line 415 of file stdio16.c.

Typedef Documentation

typedef int ReadProc(FILE16 *file, unsigned char *buf, int max_count)

Definition at line 70 of file stdio16.c.

typedef int WriteProc(FILE16 *file, const unsigned char *buf, int count)

Definition at line 71 of file stdio16.c.

typedef int SeekProc(FILE16 *file, long offset, int ptrname)

Definition at line 72 of file stdio16.c.

typedef int FlushProc(FILE16 *file)

Definition at line 73 of file stdio16.c.

typedef int CloseProc(FILE16 *file)

Definition at line 74 of file stdio16.c.

Function Documentation

void init_stdio16 ( void  )

Definition at line 125 of file stdio16.c.

int Readu ( FILE16 *  file,
unsigned char *  buf,
int  max_count 
)

Definition at line 309 of file stdio16.c.

int Writeu ( FILE16 *  file,
unsigned char *  buf,
int  count 
)

Definition at line 314 of file stdio16.c.

int Fclose ( FILE16 *  file)

Definition at line 319 of file stdio16.c.

int Fseek ( FILE16 *  file,
long  offset,
int  ptrname 
)

Definition at line 329 of file stdio16.c.

int Fflush ( FILE16 *  file)

Definition at line 334 of file stdio16.c.

FILE* GetFILE ( FILE16 *  file)

Definition at line 339 of file stdio16.c.

void SetCloseUnderlying ( FILE16 *  file,
int  cu 
)

Definition at line 347 of file stdio16.c.

void SetFileEncoding ( FILE16 *  file,
CharacterEncoding  encoding 
)

Definition at line 355 of file stdio16.c.

CharacterEncoding GetFileEncoding ( FILE16 *  file)

Definition at line 360 of file stdio16.c.

int Fprintf ( FILE16 *  file,
const char *  format,
  ... 
)

Definition at line 365 of file stdio16.c.

int Printf ( const char *  format,
  ... 
)

Definition at line 375 of file stdio16.c.

int Sprintf ( void *  buf,
CharacterEncoding  enc,
const char *  format,
  ... 
)

Definition at line 385 of file stdio16.c.

int Vprintf ( const char *  format,
va_list  args 
)

Definition at line 395 of file stdio16.c.

int Vsprintf ( void *  buf,
CharacterEncoding  enc,
const char *  format,
va_list  args 
)

Definition at line 400 of file stdio16.c.

int Vfprintf ( FILE16 *  file,
const char *  format,
va_list  args 
)

Definition at line 417 of file stdio16.c.

FILE16* MakeFILE16FromFILE ( FILE *  f,
const char *  type 
)

Definition at line 670 of file stdio16.c.

FILE16* MakeFILE16FromString ( void *  buf,
long  size,
const char *  type 
)

Definition at line 727 of file stdio16.c.

Variable Documentation

FILE16* Stdin

Definition at line 123 of file stdio16.c.

FILE16 * Stdout

Definition at line 123 of file stdio16.c.

FILE16 * Stderr

Definition at line 123 of file stdio16.c.