]>
git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/file.h
4 * File definitions for the Common UNIX Printing System (CUPS).
6 * Since stdio files max out at 256 files on many systems, we have to
7 * write similar functions without this limit. At the same time, using
8 * our own file functions allows us to provide transparent support of
9 * gzip'd print files, PPD files, etc.
11 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
13 * These coded instructions, statements, and computer programs are the
14 * property of Easy Software Products and are protected by Federal
15 * copyright law. Distribution and use rights are outlined in the file
16 * "LICENSE.txt" which should have been included with this file. If this
17 * file is missing or damaged please contact Easy Software Products
20 * Attn: CUPS Licensing Information
21 * Easy Software Products
22 * 44141 Airport View Drive, Suite 204
23 * Hollywood, Maryland 20636 USA
25 * Voice: (301) 373-9600
26 * EMail: cups-info@cups.org
27 * WWW: http://www.cups.org
31 # define _CUPS_FILE_H_
34 * Include necessary headers...
39 # endif /* HAVE_LIBZ */
48 # endif /* _cplusplus */
52 * CUPS file definitions...
55 # define CUPS_FILE_NONE 0 /* No compression */
56 # define CUPS_FILE_GZIP 1 /* GZIP compression */
60 * CUPS file structure...
65 int fd
; /* File descriptor */
66 char mode
, /* Mode ('r' or 'w') */
67 compressed
, /* Compression used? */
68 buf
[2048], /* Buffer */
69 *ptr
, /* Pointer into buffer */
70 *end
; /* End of buffer data */
71 int pos
; /* File position for start of buffer */
74 z_stream stream
; /* Decompression stream */
75 int eof
; /* End of file? */
76 unsigned char cbuf
[1024]; /* Decompression buffer */
77 # endif /* HAVE_LIBZ */
85 extern int cupsFileClose(cups_file_t
*fp
);
86 #define cupsFileCompression(fp) (fp)->compressed
87 extern int cupsFileFlush(cups_file_t
*fp
);
88 extern int cupsFileGetChar(cups_file_t
*fp
);
89 extern char *cupsFileGets(cups_file_t
*fp
, char *buf
, int buflen
);
90 #define cupsFileNumber(fp) (fp)->fd
91 extern cups_file_t
*cupsFileOpen(const char *filename
, const char *mode
);
92 extern int cupsFilePrintf(cups_file_t
*fp
, const char *format
, ...);
93 extern int cupsFilePutChar(cups_file_t
*fp
, int c
);
94 extern int cupsFilePuts(cups_file_t
*fp
, const char *s
);
95 extern int cupsFileRead(cups_file_t
*fp
, char *buf
, int bytes
);
96 extern int cupsFileSeek(cups_file_t
*fp
, int pos
);
97 #define cupsFileTell(fp) (fp)->pos
98 extern int cupsFileWrite(cups_file_t
*fp
, const char *buf
, int bytes
);
103 # endif /* _cplusplus */
104 #endif /* !_CUPS_FILE_H_ */