]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/cups.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / cups.h
index 6263b82e662cd5f080cfa042250739fb71793adb..befa0a39582ad53968949c6ac55413be1d61e0a8 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: cups.h 4973 2006-01-25 02:36:02Z mike $"
+ * "$Id: cups.h 6658 2007-07-13 01:13:26Z mike $"
  *
  *   API definitions for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products.
+ *   Copyright 2007 by Apple Inc.
+ *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   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/".
  *
  *   This file is subject to the Apple OS-Developed Software exception.
  */
  * Include necessary headers...
  */
 
+#  include <sys/types.h>
+#  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+#    define __CUPS_SSIZE_T_DEFINED
+/* Windows does not support the ssize_t type, so map it to off_t... */
+typedef off_t ssize_t;                 /* @private@ */
+#  endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
+
 #  include "ipp.h"
 #  include "ppd.h"
 #  include "language.h"
@@ -61,10 +59,10 @@ extern "C" {
  * Constants...
  */
 
-#  define CUPS_VERSION         1.0190
+#  define CUPS_VERSION         1.0300
 #  define CUPS_VERSION_MAJOR   1
-#  define CUPS_VERSION_MINOR   2
-#  define CUPS_VERSION_PATCH   -10
+#  define CUPS_VERSION_MINOR   3
+#  define CUPS_VERSION_PATCH   0
 #  define CUPS_DATE_ANY                -1
 
 
@@ -99,10 +97,13 @@ enum cups_ptype_e                   /* Not a typedef'd enum so we can OR */
   CUPS_PRINTER_DELETE = 0x100000,      /* Delete printer @since CUPS 1.2@ */
   CUPS_PRINTER_NOT_SHARED = 0x200000,  /* Printer is not shared @since CUPS 1.2@ */
   CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication @since CUPS 1.2@ */
-  CUPS_PRINTER_OPTIONS = 0x66fffc      /* ~(CLASS | REMOTE | IMPLICIT) */
+  CUPS_PRINTER_COMMANDS = 0x800000,    /* Printer supports maintenance commands @since CUPS 1.2@ */
+  CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered and added @since CUPS 1.3@ */
+  CUPS_PRINTER_OPTIONS = 0x6fffc       /* ~(CLASS | REMOTE | IMPLICIT | DEFAULT | FAX | REJECTING | DELETE | NOT_SHARED | AUTHENTICATED | COMMANDS | DISCOVERED) */
 };
 
 typedef const char *(*cups_password_cb_t)(const char *);
+                                       /**** Password callback ****/
 
 typedef struct cups_option_s           /**** Printer Options ****/
 {
@@ -122,16 +123,16 @@ typedef struct cups_dest_s                /**** Destination ****/
 typedef struct cups_job_s              /**** Job ****/
 {
   int          id;                     /* The job ID */
-  char         *dest,                  /* Printer or class name */
-               *title,                 /* Title/job name */
-               *user,                  /* User the submitted the job */
-               *format;                /* Document format */
+  char         *dest;                  /* Printer or class name */
+  char         *title;                 /* Title/job name */
+  char         *user;                  /* User the submitted the job */
+  char         *format;                /* Document format */
   ipp_jstate_t state;                  /* Job state */
-  int          size,                   /* Size in kilobytes */
-               priority;               /* Priority (1-100) */
-  time_t       completed_time,         /* Time the job was completed */
-               creation_time,          /* Time the job was created */
-               processing_time;        /* Time the job was processed */
+  int          size;                   /* Size in kilobytes */
+  int          priority;               /* Priority (1-100) */
+  time_t       completed_time;         /* Time the job was completed */
+  time_t       creation_time;          /* Time the job was created */
+  time_t       processing_time;        /* Time the job was processed */
 } cups_job_t;
 
 
@@ -140,9 +141,11 @@ typedef struct cups_job_s          /**** Job ****/
  */
 
 extern int             cupsCancelJob(const char *printer, int job);
-#define                        cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
 extern ipp_t           *cupsDoFileRequest(http_t *http, ipp_t *request,
-                                          const char *resource, const char *filename);
+                                          const char *resource,
+                                          const char *filename);
+extern ipp_t           *cupsDoRequest(http_t *http, ipp_t *request,
+                                      const char *resource);
 extern http_encryption_t cupsEncryption(void);
 extern void            cupsFreeJobs(int num_jobs, cups_job_t *jobs);
 extern int             cupsGetClasses(char ***classes) _CUPS_DEPRECATED;
@@ -176,10 +179,10 @@ extern void               cupsEncodeOptions(ipp_t *ipp, int num_options,
 extern void            cupsFreeOptions(int num_options, cups_option_t *options);
 extern const char      *cupsGetOption(const char *name, int num_options,
                                       cups_option_t *options);
-extern int             cupsParseOptions(const char *arg, int num_options,
-                                        cups_option_t **options);
 extern int             cupsMarkOptions(ppd_file_t *ppd, int num_options,
                                        cups_option_t *options);
+extern int             cupsParseOptions(const char *arg, int num_options,
+                                        cups_option_t **options);
 
 extern const char      *cupsGetPassword(const char *prompt);
 extern const char      *cupsServer(void);
@@ -218,8 +221,9 @@ extern int          cupsSetDests2(http_t *http, int num_dests,
                                      cups_dest_t *dests);
 
 /**** New in CUPS 1.2 ****/
-extern int             cupsBackchannelRead(char *buffer, int bytes, double timeout);
-extern int             cupsBackchannelWrite(const char *buffer, int bytes,
+extern ssize_t         cupsBackChannelRead(char *buffer, size_t bytes,
+                                           double timeout);
+extern ssize_t         cupsBackChannelWrite(const char *buffer, size_t bytes,
                                             double timeout);
 extern void            cupsEncodeOptions2(ipp_t *ipp, int num_options,
                                           cups_option_t *options,
@@ -227,8 +231,23 @@ extern void                cupsEncodeOptions2(ipp_t *ipp, int num_options,
 extern const char      *cupsLastErrorString(void);
 extern char            *cupsNotifySubject(cups_lang_t *lang, ipp_t *event);
 extern char            *cupsNotifyText(cups_lang_t *lang, ipp_t *event);
+extern int             cupsRemoveOption(const char *name, int num_options,
+                                        cups_option_t **options);
 extern cups_file_t     *cupsTempFile2(char *filename, int len);
 
+/**** New in CUPS 1.3 ****/
+extern ipp_t           *cupsDoIORequest(http_t *http, ipp_t *request,
+                                        const char *resource, int infile,
+                                        int outfile);
+extern char            *cupsGetServerPPD(http_t *http, const char *name);
+extern int             cupsRemoveDest(const char *name,
+                                      const char *instance,
+                                      int num_dests, cups_dest_t **dests);
+extern void            cupsSetDefaultDest(const char *name,
+                                          const char *instance,
+                                          int num_dests,
+                                          cups_dest_t *dests);
+
 
 #  ifdef __cplusplus
 }
@@ -237,5 +256,5 @@ extern cups_file_t  *cupsTempFile2(char *filename, int len);
 #endif /* !_CUPS_CUPS_H_ */
 
 /*
- * End of "$Id: cups.h 4973 2006-01-25 02:36:02Z mike $".
+ * End of "$Id: cups.h 6658 2007-07-13 01:13:26Z mike $".
  */