diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-02-25 23:37:25 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-02-25 23:37:25 +0000 |
commit | b9faaae17cfc7cd8dfd6e82cf607c05b2f4def68 (patch) | |
tree | 11ae14d6d1fc0cd6d834e8c819b74167dbe2a413 /cups/file-private.h | |
parent | ede613e028030f6b2b5871b5e40682806ee1acd0 (diff) | |
download | cups-b9faaae17cfc7cd8dfd6e82cf607c05b2f4def68.tar.gz |
Merge changes from CUPS 1.4svn-r8394.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1253 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/file-private.h')
-rw-r--r-- | cups/file-private.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/cups/file-private.h b/cups/file-private.h new file mode 100644 index 000000000..978428d39 --- /dev/null +++ b/cups/file-private.h @@ -0,0 +1,98 @@ +/* + * "$Id$" + * + * Private file definitions for the Common UNIX Printing System (CUPS). + * + * Since stdio files max out at 256 files on many systems, we have to + * write similar functions without this limit. At the same time, using + * our own file functions allows us to provide transparent support of + * gzip'd print files, PPD files, etc. + * + * Copyright 2007-2009 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". + */ + +#ifndef _CUPS_FILE_PRIVATE_H_ +# define _CUPS_FILE_PRIVATE_H_ + +/* + * Include necessary headers... + */ + +# include <stdio.h> +# include <stdlib.h> +# include <stdarg.h> +# include <errno.h> +# include <fcntl.h> +# include "http-private.h" +# include "globals.h" +# include "debug.h" + +# ifdef HAVE_LIBZ +# include <zlib.h> +# endif /* HAVE_LIBZ */ +# ifdef WIN32 +# include <io.h> +# include <sys/locking.h> +# endif /* WIN32 */ + + +/* + * Some operating systems support large files via open flag O_LARGEFILE... + */ + +# ifndef O_LARGEFILE +# define O_LARGEFILE 0 +# endif /* !O_LARGEFILE */ + + +/* + * Some operating systems don't define O_BINARY, which is used by Microsoft + * and IBM to flag binary files... + */ + +# ifndef O_BINARY +# define O_BINARY 0 +# endif /* !O_BINARY */ + + +/* + * Types and structures... + */ + +struct _cups_file_s /**** CUPS file structure... ****/ + +{ + int fd; /* File descriptor */ + char mode, /* Mode ('r' or 'w') */ + compressed, /* Compression used? */ + is_stdio, /* stdin/out/err? */ + eof, /* End of file? */ + buf[4096], /* Buffer */ + *ptr, /* Pointer into buffer */ + *end; /* End of buffer data */ + off_t pos, /* Position in file */ + bufpos; /* File position for start of buffer */ + +#ifdef HAVE_LIBZ + z_stream stream; /* (De)compression stream */ + Bytef cbuf[4096]; /* (De)compression buffer */ + uLong crc; /* (De)compression CRC */ +#endif /* HAVE_LIBZ */ + + char *printf_buffer; /* cupsFilePrintf buffer */ + size_t printf_size; /* Size of cupsFilePrintf buffer */ +}; + + +#endif /* !_CUPS_FILE_PRIVATE_H_ */ + +/* + * End of "$Id$". + */ |