]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/cups.h
Fix more compiler warnings (Issue #5423)
[thirdparty/cups.git] / cups / cups.h
index b2419f1b5a3cd685eba755178901e17613f78078..e1d3d6870df1c72355e2fb792e6117b05931d4c0 100644 (file)
@@ -4,13 +4,7 @@
  * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products.
  *
- * 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
- * missing or damaged, see the license at "http://www.cups.org/".
- *
- * This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 #ifndef _CUPS_CUPS_H_
  */
 
 #  include <sys/types.h>
-#  if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
+#  if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
 #    define __CUPS_SSIZE_T_DEFINED
 #    include <stddef.h>
 /* Windows does not support the ssize_t type, so map it to long... */
 typedef long ssize_t;                  /* @private@ */
-#  endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
+#  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
 
 #  include "file.h"
 #  include "ipp.h"
@@ -47,10 +41,10 @@ extern "C" {
  * Constants...
  */
 
-#  define CUPS_VERSION                 2.0204
+#  define CUPS_VERSION                 2.0300
 #  define CUPS_VERSION_MAJOR           2
-#  define CUPS_VERSION_MINOR           2
-#  define CUPS_VERSION_PATCH           4
+#  define CUPS_VERSION_MINOR           3
+#  define CUPS_VERSION_PATCH           0
 
 #  define CUPS_BC_FD                   3
                                        /* Back-channel file descriptor for
@@ -92,6 +86,8 @@ extern "C" {
                                        /* A connection is being established */
 #  define CUPS_DEST_FLAGS_CANCELED     0x40
                                        /* Operation was canceled */
+#  define CUPS_DEST_FLAGS_DEVICE        0x80
+                                        /* For @link cupsConnectDest@: Connect to device */
 
 /* Flags for cupsGetDestMediaByName/Size */
 #  define CUPS_MEDIA_FLAGS_DEFAULT     0x00
@@ -225,20 +221,19 @@ enum cups_ptype_e                 /* Printer type/capability bit
   CUPS_PRINTER_FAX = 0x40000,          /* Fax queue */
   CUPS_PRINTER_REJECTING = 0x80000,    /* Printer is rejecting jobs */
   CUPS_PRINTER_DELETE = 0x100000,      /* Delete printer
-                                        * @since CUPS 1.2/macOS 10.5@ */
+                                        * @deprecated@ @exclude all@ */
   CUPS_PRINTER_NOT_SHARED = 0x200000,  /* Printer is not shared
                                         * @since CUPS 1.2/macOS 10.5@ */
   CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
                                         * @since CUPS 1.2/macOS 10.5@ */
   CUPS_PRINTER_COMMANDS = 0x800000,    /* Printer supports maintenance commands
                                         * @since CUPS 1.2/macOS 10.5@ */
-  CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered
-                                        * and added @private@ */
+  CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was discovered @since CUPS 1.2/macOS 10.5@ */
   CUPS_PRINTER_SCANNER = 0x2000000,    /* Scanner-only device
-                                        * @since CUPS 1.4/macOS 10.6@ */
+                                        * @since CUPS 1.4/macOS 10.6@ @private@ */
   CUPS_PRINTER_MFP = 0x4000000,                /* Printer with scanning capabilities
-                                        * @since CUPS 1.4/macOS 10.6@ */
-  CUPS_PRINTER_3D = 0x8000000,         /* Printer with 3D capabilities @private@ */
+                                        * @since CUPS 1.4/macOS 10.6@ @private@ */
+  CUPS_PRINTER_3D = 0x8000000,         /* Printer with 3D capabilities @exclude all@ @private@ */
   CUPS_PRINTER_OPTIONS = 0x6fffc       /* ~(CLASS | REMOTE | IMPLICIT |
                                         * DEFAULT | FAX | REJECTING | DELETE |
                                         * NOT_SHARED | AUTHENTICATED |
@@ -309,11 +304,12 @@ typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
 #  ifdef __BLOCKS__
 typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest);
                                        /* Destination enumeration block
-                                        * @since CUPS 1.6/macOS 10.8@ */
+                                        * @since CUPS 1.6/macOS 10.8@
+                                         * @exclude all@ */
 #  endif /* __BLOCKS__ */
 
 typedef const char *(*cups_password_cb_t)(const char *prompt);
-                                       /* Password callback */
+                                       /* Password callback @exclude all@ */
 
 typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
                                           const char *method,
@@ -332,55 +328,55 @@ typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
  * Functions...
  */
 
-extern int             cupsCancelJob(const char *name, int job_id);
+extern int             cupsCancelJob(const char *name, int job_id) _CUPS_PUBLIC;
 extern ipp_t           *cupsDoFileRequest(http_t *http, ipp_t *request,
                                           const char *resource,
-                                          const char *filename);
+                                          const char *filename) _CUPS_PUBLIC;
 extern ipp_t           *cupsDoRequest(http_t *http, ipp_t *request,
-                                      const char *resource);
+                                      const char *resource) _CUPS_PUBLIC;
 extern http_encryption_t cupsEncryption(void);
-extern void            cupsFreeJobs(int num_jobs, cups_job_t *jobs);
-extern int             cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
-extern const char      *cupsGetDefault(void);
+extern void            cupsFreeJobs(int num_jobs, cups_job_t *jobs) _CUPS_PUBLIC;
+extern int             cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
+extern const char      *cupsGetDefault(void) _CUPS_PUBLIC;
 extern int             cupsGetJobs(cups_job_t **jobs, const char *name,
-                                   int myjobs, int whichjobs);
-extern int             cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
-extern ipp_status_t    cupsLastError(void);
+                                   int myjobs, int whichjobs) _CUPS_PUBLIC;
+extern int             cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
+extern ipp_status_t    cupsLastError(void) _CUPS_PUBLIC;
 extern int             cupsPrintFile(const char *name, const char *filename,
                                      const char *title, int num_options,
-                                     cups_option_t *options);
+                                     cups_option_t *options) _CUPS_PUBLIC;
 extern int             cupsPrintFiles(const char *name, int num_files,
                                       const char **files, const char *title,
-                                      int num_options, cups_option_t *options);
+                                      int num_options, cups_option_t *options) _CUPS_PUBLIC;
 extern char            *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
-extern int             cupsTempFd(char *filename, int len);
+extern int             cupsTempFd(char *filename, int len) _CUPS_PUBLIC;
 
 extern int             cupsAddDest(const char *name, const char *instance,
-                                   int num_dests, cups_dest_t **dests);
-extern void            cupsFreeDests(int num_dests, cups_dest_t *dests);
+                                   int num_dests, cups_dest_t **dests) _CUPS_PUBLIC;
+extern void            cupsFreeDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
 extern cups_dest_t     *cupsGetDest(const char *name, const char *instance,
-                                    int num_dests, cups_dest_t *dests);
-extern int             cupsGetDests(cups_dest_t **dests);
-extern void            cupsSetDests(int num_dests, cups_dest_t *dests);
+                                    int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
+extern int             cupsGetDests(cups_dest_t **dests) _CUPS_PUBLIC;
+extern void            cupsSetDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
 
 extern int             cupsAddOption(const char *name, const char *value,
-                                     int num_options, cups_option_t **options);
+                                     int num_options, cups_option_t **options) _CUPS_PUBLIC;
 extern void            cupsEncodeOptions(ipp_t *ipp, int num_options,
-                                         cups_option_t *options);
+                                         cups_option_t *options) _CUPS_PUBLIC;
 extern void            cupsFreeOptions(int num_options,
-                                       cups_option_t *options);
+                                       cups_option_t *options) _CUPS_PUBLIC;
 extern const char      *cupsGetOption(const char *name, int num_options,
-                                      cups_option_t *options);
+                                      cups_option_t *options) _CUPS_PUBLIC;
 extern int             cupsParseOptions(const char *arg, int num_options,
-                                        cups_option_t **options);
+                                        cups_option_t **options) _CUPS_PUBLIC;
 
-extern const char      *cupsGetPassword(const char *prompt);
-extern const char      *cupsServer(void);
-extern void            cupsSetEncryption(http_encryption_t e);
-extern void            cupsSetPasswordCB(cups_password_cb_t cb);
-extern void            cupsSetServer(const char *server);
-extern void            cupsSetUser(const char *user);
-extern const char      *cupsUser(void);
+extern const char      *cupsGetPassword(const char *prompt) _CUPS_PUBLIC;
+extern const char      *cupsServer(void) _CUPS_PUBLIC;
+extern void            cupsSetEncryption(http_encryption_t e) _CUPS_PUBLIC;
+extern void            cupsSetPasswordCB(cups_password_cb_t cb) _CUPS_PUBLIC;
+extern void            cupsSetServer(const char *server) _CUPS_PUBLIC;
+extern void            cupsSetUser(const char *user) _CUPS_PUBLIC;
+extern const char      *cupsUser(void) _CUPS_PUBLIC;
 
 /**** New in CUPS 1.1.20 ****/
 extern int             cupsDoAuthentication(http_t *http, const char *method,
@@ -388,7 +384,7 @@ extern int          cupsDoAuthentication(http_t *http, const char *method,
                                             _CUPS_API_1_1_20;
 extern http_status_t   cupsGetFile(http_t *http, const char *resource,
                                    const char *filename) _CUPS_API_1_1_20;
-extern http_status_t   cupsGetFd(http_t *http, const char *resource, int fd);
+extern http_status_t   cupsGetFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
 extern http_status_t   cupsPutFile(http_t *http, const char *resource,
                                    const char *filename) _CUPS_API_1_1_20;
 extern http_status_t   cupsPutFd(http_t *http, const char *resource, int fd)
@@ -600,6 +596,17 @@ extern int         cupsSetServerCredentials(const char *path, const char *common_name,
 /* New in CUPS 2.2/macOS 10.12 */
 extern ssize_t         cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
 
+/* New in CUPS 2.2.4 */
+extern int             cupsAddIntegerOption(const char *name, int value, int num_options, cups_option_t **options) _CUPS_API_2_2_4;
+extern int             cupsGetIntegerOption(const char *name, int num_options, cups_option_t *options) _CUPS_API_2_2_4;
+
+/* New in CUPS 2.2.7 */
+extern const char      *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_2_7;
+
+/* New in CUPS 2.3 */
+extern int             cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options) _CUPS_API_2_3;
+extern ipp_attribute_t *cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, const char *name, const char *value) _CUPS_API_2_3;
+
 #  ifdef __cplusplus
 }
 #  endif /* __cplusplus */