]> 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 5057 2006-02-02 20:38:29Z 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 const char *cupsFileFind(const char *filename, const char *path,
78 int executable, char *buffer,
79 int bufsize);
80 extern int cupsFileFlush(cups_file_t *fp);
81 extern int cupsFileGetChar(cups_file_t *fp);
82 extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
83 char **value, int *linenum);
84 extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
85 extern int cupsFileLock(cups_file_t *fp, int block);
86 extern int cupsFileNumber(cups_file_t *fp);
87 extern cups_file_t *cupsFileOpen(const char *filename, const char *mode);
88 extern cups_file_t *cupsFileOpenFd(int fd, const char *mode);
89 extern int cupsFilePeekChar(cups_file_t *fp);
90 extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...);
91 extern int cupsFilePutChar(cups_file_t *fp, int c);
92 extern int cupsFilePuts(cups_file_t *fp, const char *s);
93 extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
94 extern off_t cupsFileRewind(cups_file_t *fp);
95 extern off_t cupsFileSeek(cups_file_t *fp, off_t pos);
96 extern off_t cupsFileTell(cups_file_t *fp);
97 extern int cupsFileUnlock(cups_file_t *fp);
98 extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
99
100
101 # ifdef _cplusplus
102 }
103 # endif /* _cplusplus */
104 #endif /* !_CUPS_FILE_H_ */
105
106 /*
107 * End of "$Id: file.h 5057 2006-02-02 20:38:29Z mike $".
108 */