/vp_plugins/sptsd/cups/file.h

http://cupsfilter.googlecode.com/ · C Header · 111 lines · 54 code · 19 blank · 38 comment · 2 complexity · eff32833d1c4fc3eb79e44074c5b4b11 MD5 · raw file

  1. /*
  2. * "$Id: file.h 8397 2009-03-01 14:54:08Z mike $"
  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. *
  11. * Copyright 2007-2008 by Apple Inc.
  12. * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  13. *
  14. * These coded instructions, statements, and computer programs are the
  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/".
  19. */
  20. #ifndef _CUPS_FILE_H_
  21. # define _CUPS_FILE_H_
  22. /*
  23. * Include necessary headers...
  24. */
  25. # include "versioning.h"
  26. # include <sys/types.h>
  27. # if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
  28. # define __CUPS_SSIZE_T_DEFINED
  29. /* Windows does not support the ssize_t type, so map it to off_t... */
  30. typedef off_t ssize_t; /* @private@ */
  31. # endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
  32. /*
  33. * C++ magic...
  34. */
  35. # ifdef __cplusplus
  36. extern "C" {
  37. # endif /* __cplusplus */
  38. /*
  39. * CUPS file definitions...
  40. */
  41. # define CUPS_FILE_NONE 0 /* No compression */
  42. # define CUPS_FILE_GZIP 1 /* GZIP compression */
  43. /*
  44. * Types and structures...
  45. */
  46. typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
  47. /*
  48. * Prototypes...
  49. */
  50. extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
  51. extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
  52. extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
  53. extern const char *cupsFileFind(const char *filename, const char *path,
  54. int executable, char *buffer,
  55. int bufsize) _CUPS_API_1_2;
  56. extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
  57. extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
  58. extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen,
  59. char **value, int *linenum) _CUPS_API_1_2;
  60. extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
  61. size_t buflen) _CUPS_API_1_2;
  62. extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
  63. extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
  64. extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
  65. extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
  66. extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
  67. extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
  68. extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...)
  69. #ifdef __GNUC__
  70. __attribute__ ((__format__ (__printf__, 2, 3)))
  71. #endif /* __GNUC__ */
  72. _CUPS_API_1_2;
  73. extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
  74. extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive,
  75. const char *value) _CUPS_API_1_4;
  76. extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
  77. extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
  78. extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
  79. extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
  80. extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2;
  81. extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2;
  82. extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2;
  83. extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
  84. extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
  85. extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;
  86. # ifdef __cplusplus
  87. }
  88. # endif /* __cplusplus */
  89. #endif /* !_CUPS_FILE_H_ */
  90. /*
  91. * End of "$Id: file.h 8397 2009-03-01 14:54:08Z mike $".
  92. */