]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/file.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / file.h
1 /*
2 * "$Id: file.h 4857 2005-11-30 19:25:17Z mike $"
3 *
4 * Public file definitions for the Common UNIX Printing System (CUPS).
5 *
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.
10 *
11 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
12 *
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
18 * at:
19 *
20 * Attn: CUPS Licensing Information
21 * Easy Software Products
22 * 44141 Airport View Drive, Suite 204
23 * Hollywood, Maryland 20636 USA
24 *
25 * Voice: (301) 373-9600
26 * EMail: cups-info@cups.org
27 * WWW: http://www.cups.org
28 */
29
30 #ifndef _CUPS_FILE_H_
31 # define _CUPS_FILE_H_
32
33
34 /*
35 * Include necessary headers...
36 */
37
38 # include <sys/types.h>
39
40 # ifdef WIN32
41 /* Windows does not support the ssize_t type, so map it to off_t... */
42 typedef off_t ssize_t; /* @private@ */
43 # endif /* WIN32 */
44
45
46 /*
47 * C++ magic...
48 */
49
50 # ifdef _cplusplus
51 extern "C" {
52 # endif /* _cplusplus */
53
54
55 /*
56 * CUPS file definitions...
57 */
58
59 # define CUPS_FILE_NONE 0 /* No compression */
60 # define CUPS_FILE_GZIP 1 /* GZIP compression */
61
62
63 /*
64 * Types and structures...
65 */
66
67 typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
68
69
70 /*
71 * Prototypes...
72 */
73
74 extern int cupsFileClose(cups_file_t *fp);
75 extern int cupsFileCompression(cups_file_t *fp);
76 extern int cupsFileEOF(cups_file_t *fp);
77 extern int cupsFileFlush(cups_file_t *fp);
78 extern int cupsFileGetChar(cups_file_t *fp);
79 extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
80 char **value, int *linenum);
81 extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
82 extern int cupsFileLock(cups_file_t *fp, int block);
83 extern int cupsFileNumber(cups_file_t *fp);
84 extern cups_file_t *cupsFileOpen(const char *filename, const char *mode);
85 extern cups_file_t *cupsFileOpenFd(int fd, const char *mode);
86 extern int cupsFilePeekChar(cups_file_t *fp);
87 extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...);
88 extern int cupsFilePutChar(cups_file_t *fp, int c);
89 extern int cupsFilePuts(cups_file_t *fp, const char *s);
90 extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
91 extern off_t cupsFileRewind(cups_file_t *fp);
92 extern off_t cupsFileSeek(cups_file_t *fp, off_t pos);
93 extern off_t cupsFileTell(cups_file_t *fp);
94 extern int cupsFileUnlock(cups_file_t *fp);
95 extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
96
97
98 # ifdef _cplusplus
99 }
100 # endif /* _cplusplus */
101 #endif /* !_CUPS_FILE_H_ */
102
103 /*
104 * End of "$Id: file.h 4857 2005-11-30 19:25:17Z mike $".
105 */