]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
bc44d920 | 2 | * "$Id: file.h 6649 2007-07-11 21:46: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 | * | |
bc44d920 | 11 | * Copyright 2007 by Apple Inc. |
b86bc4cf | 12 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 13 | * |
14 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 15 | * property of Apple Inc. and are protected by Federal copyright |
16 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
17 | * which should have been included with this file. If this file is | |
18 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 19 | */ |
20 | ||
21 | #ifndef _CUPS_FILE_H_ | |
22 | # define _CUPS_FILE_H_ | |
23 | ||
24 | ||
25 | /* | |
26 | * Include necessary headers... | |
27 | */ | |
28 | ||
29 | # include <sys/types.h> | |
b86bc4cf | 30 | # if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED) |
31 | # define __CUPS_SSIZE_T_DEFINED | |
ef416fc2 | 32 | /* Windows does not support the ssize_t type, so map it to off_t... */ |
33 | typedef off_t ssize_t; /* @private@ */ | |
b86bc4cf | 34 | # endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */ |
ef416fc2 | 35 | |
36 | ||
37 | /* | |
38 | * C++ magic... | |
39 | */ | |
40 | ||
d09495fa | 41 | # ifdef __cplusplus |
ef416fc2 | 42 | extern "C" { |
d09495fa | 43 | # endif /* __cplusplus */ |
ef416fc2 | 44 | |
45 | ||
46 | /* | |
47 | * CUPS file definitions... | |
48 | */ | |
49 | ||
50 | # define CUPS_FILE_NONE 0 /* No compression */ | |
51 | # define CUPS_FILE_GZIP 1 /* GZIP compression */ | |
52 | ||
53 | ||
54 | /* | |
55 | * Types and structures... | |
56 | */ | |
57 | ||
58 | typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/ | |
59 | ||
60 | ||
61 | /* | |
62 | * Prototypes... | |
63 | */ | |
64 | ||
65 | extern int cupsFileClose(cups_file_t *fp); | |
66 | extern int cupsFileCompression(cups_file_t *fp); | |
67 | extern int cupsFileEOF(cups_file_t *fp); | |
fa73b229 | 68 | extern const char *cupsFileFind(const char *filename, const char *path, |
4400e98d | 69 | int executable, char *buffer, |
70 | int bufsize); | |
ef416fc2 | 71 | extern int cupsFileFlush(cups_file_t *fp); |
72 | extern int cupsFileGetChar(cups_file_t *fp); | |
73 | extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, | |
74 | char **value, int *linenum); | |
80ca4592 | 75 | extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, |
76 | size_t buflen); | |
ef416fc2 | 77 | extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen); |
78 | extern int cupsFileLock(cups_file_t *fp, int block); | |
79 | extern int cupsFileNumber(cups_file_t *fp); | |
80 | extern cups_file_t *cupsFileOpen(const char *filename, const char *mode); | |
81 | extern cups_file_t *cupsFileOpenFd(int fd, const char *mode); | |
82 | extern int cupsFilePeekChar(cups_file_t *fp); | |
83 | extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...); | |
84 | extern int cupsFilePutChar(cups_file_t *fp, int c); | |
85 | extern int cupsFilePuts(cups_file_t *fp, const char *s); | |
86 | extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes); | |
87 | extern off_t cupsFileRewind(cups_file_t *fp); | |
88 | extern off_t cupsFileSeek(cups_file_t *fp, off_t pos); | |
80ca4592 | 89 | extern cups_file_t *cupsFileStderr(void); |
90 | extern cups_file_t *cupsFileStdin(void); | |
91 | extern cups_file_t *cupsFileStdout(void); | |
ef416fc2 | 92 | extern off_t cupsFileTell(cups_file_t *fp); |
93 | extern int cupsFileUnlock(cups_file_t *fp); | |
94 | extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes); | |
95 | ||
96 | ||
d09495fa | 97 | # ifdef __cplusplus |
ef416fc2 | 98 | } |
d09495fa | 99 | # endif /* __cplusplus */ |
ef416fc2 | 100 | #endif /* !_CUPS_FILE_H_ */ |
101 | ||
102 | /* | |
bc44d920 | 103 | * End of "$Id: file.h 6649 2007-07-11 21:46:42Z mike $". |
ef416fc2 | 104 | */ |