]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
d09495fa | 2 | * "$Id: file.h 5769 2006-07-20 17:17:14Z 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 | * | |
d09495fa | 11 | * Copyright 1997-2006 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> | |
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 | ||
d09495fa | 50 | # ifdef __cplusplus |
ef416fc2 | 51 | extern "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 | ||
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); | |
fa73b229 | 77 | extern const char *cupsFileFind(const char *filename, const char *path, |
4400e98d | 78 | int executable, char *buffer, |
79 | int bufsize); | |
ef416fc2 | 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); | |
80ca4592 | 84 | extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, |
85 | size_t buflen); | |
ef416fc2 | 86 | extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen); |
87 | extern int cupsFileLock(cups_file_t *fp, int block); | |
88 | extern int cupsFileNumber(cups_file_t *fp); | |
89 | extern cups_file_t *cupsFileOpen(const char *filename, const char *mode); | |
90 | extern cups_file_t *cupsFileOpenFd(int fd, const char *mode); | |
91 | extern int cupsFilePeekChar(cups_file_t *fp); | |
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 ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes); | |
96 | extern off_t cupsFileRewind(cups_file_t *fp); | |
97 | extern off_t cupsFileSeek(cups_file_t *fp, off_t pos); | |
80ca4592 | 98 | extern cups_file_t *cupsFileStderr(void); |
99 | extern cups_file_t *cupsFileStdin(void); | |
100 | extern cups_file_t *cupsFileStdout(void); | |
ef416fc2 | 101 | extern off_t cupsFileTell(cups_file_t *fp); |
102 | extern int cupsFileUnlock(cups_file_t *fp); | |
103 | extern 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 | /* | |
d09495fa | 112 | * End of "$Id: file.h 5769 2006-07-20 17:17:14Z mike $". |
ef416fc2 | 113 | */ |