summaryrefslogtreecommitdiff
path: root/include/X11/fonts/bufio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/X11/fonts/bufio.h')
-rw-r--r--include/X11/fonts/bufio.h96
1 files changed, 33 insertions, 63 deletions
diff --git a/include/X11/fonts/bufio.h b/include/X11/fonts/bufio.h
index 493f3ce..402685f 100644
--- a/include/X11/fonts/bufio.h
+++ b/include/X11/fonts/bufio.h
@@ -27,6 +27,12 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/lib/font/include/bufio.h,v 1.7 2001/12/14 19:56:53 dawes Exp $ */
+
+#ifndef ___BUFIO_H___
+#define ___BUFIO_H___ 1
+
+#include <X11/Xfuncproto.h>
#ifdef TEST
@@ -39,80 +45,41 @@ from The Open Group.
#define BUFFILEEOF -1
typedef unsigned char BufChar;
+typedef struct _buffile *BufFilePtr;
typedef struct _buffile {
BufChar *bufp;
int left;
+ int eof;
BufChar buffer[BUFFILESIZE];
- int (*io)(/* BufFilePtr f */);
- int (*skip)(/* BufFilePtr f, int count */);
- int (*close)(/* BufFilePtr f */);
+ int (*input)( BufFilePtr /* f */);
+ int (*output)( int /* c */, BufFilePtr /* f */);
+ int (*skip)( BufFilePtr /* f */, int /* count */);
+ int (*close)( BufFilePtr /* f */, int /* doClose */);
char *private;
-} BufFileRec, *BufFilePtr;
+} BufFileRec;
-extern BufFilePtr BufFileCreate (
-#if NeedFunctionPrototypes
+extern BufFilePtr BufFileCreate (
char*,
- int (*)(),
- int (*)(),
- int (*)()
-#endif
-);
-extern BufFilePtr BufFileOpenRead (
-#if NeedFunctionPrototypes
- int
-#endif
-);
-
-extern BufFilePtr BufFileOpenWrite (
-#if NeedFunctionPrototypes
- int
-#endif
-);
-
-extern BufFilePtr BufFilePushCompressed (
-#if NeedFunctionPrototypes
- BufFilePtr
-#endif
-);
+ int (*)(BufFilePtr),
+ int (*)(int, BufFilePtr),
+ int (*)(BufFilePtr, int),
+ int (*)(BufFilePtr, int));
+extern BufFilePtr BufFileOpenRead ( int );
+extern BufFilePtr BufFileOpenWrite ( int );
+extern BufFilePtr BufFilePushCompressed ( BufFilePtr );
#ifdef X_GZIP_FONT_COMPRESSION
-extern BufFilePtr BufFilePushZIP (
-#if NeedFunctionPrototypes
- BufFilePtr
-#endif
-);
-#endif
-extern int BufFileClose (
-#if NeedFunctionPrototypes
- BufFilePtr,
- int
+extern BufFilePtr BufFilePushZIP ( BufFilePtr );
#endif
-);
-extern int BufFileFlush (
-#if NeedFunctionPrototypes
- BufFilePtr
-#endif
-);
+extern int BufFileClose ( BufFilePtr, int );
+extern int BufFileFlush ( BufFilePtr, int );
+extern int BufFileRead ( BufFilePtr, char*, int );
+extern int BufFileWrite ( BufFilePtr, char*, int );
+extern void BufFileFree ( BufFilePtr );
-extern int BufFileRead (
-#if NeedFunctionPrototypes
- BufFilePtr,
- char*,
- int
-#endif
-);
-
-extern int BufFileWrite (
-#if NeedFunctionPrototypes
- BufFilePtr,
- char*,
- int
-#endif
-);
-
-#define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : (*(f)->io) (f))
-#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = (c) : (*(f)->io) (c,f))
-#define BufFileSkip(f,c) ((*(f)->skip) (f, c))
+#define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : ((f)->eof = (*(f)->input) (f)))
+#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = ((unsigned char)(c)) : (*(f)->output) ((unsigned char)(c),f))
+#define BufFileSkip(f,c) ((f)->eof = (*(f)->skip) (f, c))
#ifndef TRUE
#define TRUE 1
@@ -120,3 +87,6 @@ extern int BufFileWrite (
#ifndef FALSE
#define FALSE 0
#endif
+
+#endif /* ___BUFIO_H___ */
+