]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/file.h
2 * "$Id: file.h 5057 2006-02-02 20:38:29Z mike $"
4 * Public 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_
35 * Include necessary headers...
38 # include <sys/types.h>
41 /* Windows does not support the ssize_t type, so map it to off_t... */
42 typedef off_t ssize_t
; /* @private@ */
52 # endif /* _cplusplus */
56 * CUPS file definitions...
59 # define CUPS_FILE_NONE 0 /* No compression */
60 # define CUPS_FILE_GZIP 1 /* GZIP compression */
64 * Types and structures...
67 typedef struct _cups_file_s cups_file_t
;/**** CUPS file type ****/
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
,
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
);
103 # endif /* _cplusplus */
104 #endif /* !_CUPS_FILE_H_ */
107 * End of "$Id: file.h 5057 2006-02-02 20:38:29Z mike $".