]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/file.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / file.h
CommitLineData
ef416fc2 1/*
f7deaa1a 2 * "$Id: file.h 6187 2007-01-10 16:20:42Z mike $"
ef416fc2 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 *
b86bc4cf 11 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 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>
b86bc4cf 39# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
40# define __CUPS_SSIZE_T_DEFINED
ef416fc2 41/* Windows does not support the ssize_t type, so map it to off_t... */
42typedef off_t ssize_t; /* @private@ */
b86bc4cf 43# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
ef416fc2 44
45
46/*
47 * C++ magic...
48 */
49
d09495fa 50# ifdef __cplusplus
ef416fc2 51extern "C" {
d09495fa 52# endif /* __cplusplus */
ef416fc2 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
67typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
68
69
70/*
71 * Prototypes...
72 */
73
74extern int cupsFileClose(cups_file_t *fp);
75extern int cupsFileCompression(cups_file_t *fp);
76extern int cupsFileEOF(cups_file_t *fp);
fa73b229 77extern const char *cupsFileFind(const char *filename, const char *path,
4400e98d 78 int executable, char *buffer,
79 int bufsize);
ef416fc2 80extern int cupsFileFlush(cups_file_t *fp);
81extern int cupsFileGetChar(cups_file_t *fp);
82extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
83 char **value, int *linenum);
80ca4592 84extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
85 size_t buflen);
ef416fc2 86extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen);
87extern int cupsFileLock(cups_file_t *fp, int block);
88extern int cupsFileNumber(cups_file_t *fp);
89extern cups_file_t *cupsFileOpen(const char *filename, const char *mode);
90extern cups_file_t *cupsFileOpenFd(int fd, const char *mode);
91extern int cupsFilePeekChar(cups_file_t *fp);
92extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...);
93extern int cupsFilePutChar(cups_file_t *fp, int c);
94extern int cupsFilePuts(cups_file_t *fp, const char *s);
95extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes);
96extern off_t cupsFileRewind(cups_file_t *fp);
97extern off_t cupsFileSeek(cups_file_t *fp, off_t pos);
80ca4592 98extern cups_file_t *cupsFileStderr(void);
99extern cups_file_t *cupsFileStdin(void);
100extern cups_file_t *cupsFileStdout(void);
ef416fc2 101extern off_t cupsFileTell(cups_file_t *fp);
102extern int cupsFileUnlock(cups_file_t *fp);
103extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
104
105
d09495fa 106# ifdef __cplusplus
ef416fc2 107}
d09495fa 108# endif /* __cplusplus */
ef416fc2 109#endif /* !_CUPS_FILE_H_ */
110
111/*
f7deaa1a 112 * End of "$Id: file.h 6187 2007-01-10 16:20:42Z mike $".
ef416fc2 113 */