]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Remove support for _IPP_PRIVATE_STRUCTURES developer cheat.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 20 Mar 2018 03:08:59 +0000 (23:08 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 20 Mar 2018 03:08:59 +0000 (23:08 -0400)
CHANGES.md
cups/ipp-private.h
cups/ipp.h
test/ippserver.c
test/ipptool.c

index c0f923cef49442c69965c1ae13d4ea054d875a93..9df159f3c4e71f4a4bc7a79366352cd66096cd11 100644 (file)
@@ -32,8 +32,10 @@ Changes in CUPS v2.3rc1
   correctly.
 - Added public `cupsEncodeOption` API for encoding a single option as an IPP
   attribute.
-- Removed support for `-D_PPD_DEPRECATED=""` hack - the PPD API should not be
-  used.
+- Removed support for the `-D_PPD_DEPRECATED=""` developer cheat - the PPD API
+  should no longer be used.
+- Removed support for `-D_IPP_PRIVATE_STRUCTURES=1` developer cheat - the IPP
+  accessor functions should be used instead.
 
 
 Changes in CUPS v2.3b3
index 6a4708ed100927c0827e8988939acd22d522d13d..66ed11b6d9b6747f911fa040c0b46a9a3b7e3040 100644 (file)
@@ -39,7 +39,105 @@ extern "C" {
  * Structures...
  */
 
-typedef struct                         /**** Attribute mapping data ****/
+typedef union _ipp_request_u           /**** Request Header ****/
+{
+  struct                               /* Any Header */
+  {
+    ipp_uchar_t        version[2];             /* Protocol version number */
+    int                op_status;              /* Operation ID or status code*/
+    int                request_id;             /* Request ID */
+  }            any;
+
+  struct                               /* Operation Header */
+  {
+    ipp_uchar_t        version[2];             /* Protocol version number */
+    ipp_op_t   operation_id;           /* Operation ID */
+    int                request_id;             /* Request ID */
+  }            op;
+
+  struct                               /* Status Header */
+  {
+    ipp_uchar_t        version[2];             /* Protocol version number */
+    ipp_status_t status_code;          /* Status code */
+    int                request_id;             /* Request ID */
+  }            status;
+
+  /**** New in CUPS 1.1.19 ****/
+  struct                               /* Event Header @since CUPS 1.1.19/macOS 10.3@ */
+  {
+    ipp_uchar_t        version[2];             /* Protocol version number */
+    ipp_status_t status_code;          /* Status code */
+    int                request_id;             /* Request ID */
+  }            event;
+} _ipp_request_t;
+
+typedef union _ipp_value_u             /**** Attribute Value ****/
+{
+  int          integer;                /* Integer/enumerated value */
+
+  char         boolean;                /* Boolean value */
+
+  ipp_uchar_t  date[11];               /* Date/time value */
+
+  struct
+  {
+    int                xres,                   /* Horizontal resolution */
+               yres;                   /* Vertical resolution */
+    ipp_res_t  units;                  /* Resolution units */
+  }            resolution;             /* Resolution value */
+
+  struct
+  {
+    int                lower,                  /* Lower value */
+               upper;                  /* Upper value */
+  }            range;                  /* Range of integers value */
+
+  struct
+  {
+    char       *language;              /* Language code */
+    char       *text;                  /* String */
+  }            string;                 /* String with language value */
+
+  struct
+  {
+    int                length;                 /* Length of attribute */
+    void       *data;                  /* Data in attribute */
+  }            unknown;                /* Unknown attribute type */
+
+/**** New in CUPS 1.1.19 ****/
+  ipp_t                *collection;            /* Collection value @since CUPS 1.1.19/macOS 10.3@ */
+} _ipp_value_t;
+
+struct _ipp_attribute_s                        /**** IPP attribute ****/
+{
+  ipp_attribute_t *next;               /* Next attribute in list */
+  ipp_tag_t    group_tag,              /* Job/Printer/Operation group tag */
+               value_tag;              /* What type of value is it? */
+  char         *name;                  /* Name of attribute */
+  int          num_values;             /* Number of values */
+  _ipp_value_t values[1];              /* Values */
+};
+
+struct _ipp_s                          /**** IPP Request/Response/Notification ****/
+{
+  ipp_state_t          state;          /* State of request */
+  _ipp_request_t       request;        /* Request header */
+  ipp_attribute_t      *attrs;         /* Attributes */
+  ipp_attribute_t      *last;          /* Last attribute in list */
+  ipp_attribute_t      *current;       /* Current attribute (for read/write) */
+  ipp_tag_t            curtag;         /* Current attribute group tag */
+
+/**** New in CUPS 1.2 ****/
+  ipp_attribute_t      *prev;          /* Previous attribute (for read) @since CUPS 1.2/macOS 10.5@ */
+
+/**** New in CUPS 1.4.4 ****/
+  int                  use;            /* Use count @since CUPS 1.4.4/macOS 10.6.?@ */
+/**** New in CUPS 2.0 ****/
+  int                  atend,          /* At end of list? */
+                       curindex;       /* Current attribute index for hierarchical search */
+};
+
+typedef struct _ipp_option_s           /**** Attribute mapping data ****/
 {
   int          multivalue;             /* Option has multiple values? */
   const char   *name;                  /* Option/attribute name */
index 84e00271a4912985601aca7595309811fa4c2eb8..58f0f0b9acbade47c1337c67f6123aeacf1b3901 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Internet Printing Protocol definitions for CUPS.
  *
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 #ifndef _CUPS_IPP_H_
@@ -724,141 +725,6 @@ typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
                                         /**** ippCopyAttributes callback function @since CUPS 1.6/macOS 10.8 ****/
 
 
-/*
- * The following structures are PRIVATE starting with CUPS 1.6/macOS 10.8.
- * Please use the new accessor functions available in CUPS 1.6 and later, as
- * these definitions will be moved to a private header file in a future release.
- *
- * Define _IPP_PRIVATE_STRUCTURES to 1 to cause the private IPP structures to be
- * exposed in CUPS 1.6.  This happens automatically on macOS when compiling for
- * a deployment target of 10.7 or earlier.
- *
- * Define _IPP_PRIVATE_STRUCTURES to 0 to prevent the private IPP structures
- * from being exposed.  This is useful when migrating existing code to the new
- * accessors.
- */
-
-#  ifdef _IPP_PRIVATE_STRUCTURES
-     /* Somebody has overridden the value */
-#  elif defined(_CUPS_SOURCE) || defined(_CUPS_IPP_PRIVATE_H_)
-     /* Building CUPS */
-#    define _IPP_PRIVATE_STRUCTURES 1
-#  elif defined(__APPLE__)
-#    if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
-       /* Building for 10.7 and earlier */
-#      define _IPP_PRIVATE_STRUCTURES 1
-#    elif !defined(MAC_OS_X_VERSION_10_8)
-       /* Building for 10.7 and earlier */
-#      define _IPP_PRIVATE_STRUCTURES 1
-#    endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
-#  else
-#    define _IPP_PRIVATE_STRUCTURES 0
-#  endif /* _CUPS_SOURCE || _CUPS_IPP_PRIVATE_H_ */
-
-#  if _IPP_PRIVATE_STRUCTURES
-typedef union _ipp_request_u           /**** Request Header ****/
-{
-  struct                               /* Any Header */
-  {
-    ipp_uchar_t        version[2];             /* Protocol version number */
-    int                op_status;              /* Operation ID or status code*/
-    int                request_id;             /* Request ID */
-  }            any;
-
-  struct                               /* Operation Header */
-  {
-    ipp_uchar_t        version[2];             /* Protocol version number */
-    ipp_op_t   operation_id;           /* Operation ID */
-    int                request_id;             /* Request ID */
-  }            op;
-
-  struct                               /* Status Header */
-  {
-    ipp_uchar_t        version[2];             /* Protocol version number */
-    ipp_status_t status_code;          /* Status code */
-    int                request_id;             /* Request ID */
-  }            status;
-
-  /**** New in CUPS 1.1.19 ****/
-  struct                               /* Event Header @since CUPS 1.1.19/macOS 10.3@ */
-  {
-    ipp_uchar_t        version[2];             /* Protocol version number */
-    ipp_status_t status_code;          /* Status code */
-    int                request_id;             /* Request ID */
-  }            event;
-} _ipp_request_t;
-
-/**** New in CUPS 1.1.19 ****/
-
-typedef union _ipp_value_u             /**** Attribute Value ****/
-{
-  int          integer;                /* Integer/enumerated value */
-
-  char         boolean;                /* Boolean value */
-
-  ipp_uchar_t  date[11];               /* Date/time value */
-
-  struct
-  {
-    int                xres,                   /* Horizontal resolution */
-               yres;                   /* Vertical resolution */
-    ipp_res_t  units;                  /* Resolution units */
-  }            resolution;             /* Resolution value */
-
-  struct
-  {
-    int                lower,                  /* Lower value */
-               upper;                  /* Upper value */
-  }            range;                  /* Range of integers value */
-
-  struct
-  {
-    char       *language;              /* Language code */
-    char       *text;                  /* String */
-  }            string;                 /* String with language value */
-
-  struct
-  {
-    int                length;                 /* Length of attribute */
-    void       *data;                  /* Data in attribute */
-  }            unknown;                /* Unknown attribute type */
-
-/**** New in CUPS 1.1.19 ****/
-  ipp_t                *collection;            /* Collection value @since CUPS 1.1.19/macOS 10.3@ */
-} _ipp_value_t;
-typedef _ipp_value_t ipp_value_t;      /**** Convenience typedef that will be removed @private@ ****/
-
-struct _ipp_attribute_s                        /**** IPP attribute ****/
-{
-  ipp_attribute_t *next;               /* Next attribute in list */
-  ipp_tag_t    group_tag,              /* Job/Printer/Operation group tag */
-               value_tag;              /* What type of value is it? */
-  char         *name;                  /* Name of attribute */
-  int          num_values;             /* Number of values */
-  _ipp_value_t values[1];              /* Values */
-};
-
-struct _ipp_s                          /**** IPP Request/Response/Notification ****/
-{
-  ipp_state_t          state;          /* State of request */
-  _ipp_request_t       request;        /* Request header */
-  ipp_attribute_t      *attrs;         /* Attributes */
-  ipp_attribute_t      *last;          /* Last attribute in list */
-  ipp_attribute_t      *current;       /* Current attribute (for read/write) */
-  ipp_tag_t            curtag;         /* Current attribute group tag */
-
-/**** New in CUPS 1.2 ****/
-  ipp_attribute_t      *prev;          /* Previous attribute (for read) @since CUPS 1.2/macOS 10.5@ */
-
-/**** New in CUPS 1.4.4 ****/
-  int                  use;            /* Use count @since CUPS 1.4.4/macOS 10.6.?@ */
-/**** New in CUPS 2.0 ****/
-  int                  atend,          /* At end of list? */
-                       curindex;       /* Current attribute index for hierarchical search */
-};
-#  endif /* _IPP_PRIVATE_STRUCTURES */
-
-
 /*
  * Prototypes...
  */
index 46e689fa7432fd0d2d2a7e7d2c0d34618b6af59e..e2bdbb2c0f1d090ba883eb5df4008ef1bf8c27db 100644 (file)
@@ -8,11 +8,10 @@
  */
 
 /*
- * Disable private and deprecated stuff so we can verify that the public API
- * is sufficient to implement a server.
+ * Disable deprecated stuff so we can verify that the public API is sufficient
+ * to implement a server.
  */
 
-#define _IPP_PRIVATE_STRUCTURES 0      /* Disable private IPP stuff */
 #define _CUPS_NO_DEPRECATED 1          /* Disable deprecated stuff */
 
 
index 9f5ff3f2bba34986dc4a935aeb70792293ce2135..8a5ed247d7d138a1c38a0427dcd43636ca4d18eb 100644 (file)
@@ -12,7 +12,6 @@
  * Include necessary headers...
  */
 
-#define _IPP_PRIVATE_STRUCTURES 0      /* Disable private IPP stuff */
 #include <cups/cups-private.h>
 #include <cups/file-private.h>
 #include <regex.h>