]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/cups-private.h
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / cups / cups-private.h
index babc0d0814ea637a1d13b2fd01634963e5a85af9..97734a539b12498f76ecac6e0fd1f74d20ebf0c0 100644 (file)
@@ -1,18 +1,11 @@
 /*
- * "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $"
+ * Private definitions for CUPS.
  *
- *   Private definitions for CUPS.
+ * Copyright © 2007-2019 by Apple Inc.
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2012 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/".
- *
- *   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_PRIVATE_H_
  */
 
 #  include "string-private.h"
-#  include "debug-private.h"
 #  include "array-private.h"
 #  include "ipp-private.h"
 #  include "http-private.h"
 #  include "language-private.h"
 #  include "pwg-private.h"
-#  include "ppd-private.h"
 #  include "thread-private.h"
 #  include <cups/cups.h>
 #  ifdef __APPLE__
@@ -59,6 +50,30 @@ typedef struct _cups_buffer_s                /**** Read/write buffer ****/
                        d[1];           /* Data buffer */
 } _cups_buffer_t;
 
+typedef struct _cups_raster_error_s    /**** Error buffer structure ****/
+{
+  char *start,                         /* Start of buffer */
+       *current,                       /* Current position in buffer */
+       *end;                           /* End of buffer */
+} _cups_raster_error_t;
+
+typedef enum _cups_digestoptions_e     /**** Digest Options values */
+{
+  _CUPS_DIGESTOPTIONS_NONE,            /* No Digest authentication options */
+  _CUPS_DIGESTOPTIONS_DENYMD5          /* Do not use MD5 hashes for digest */
+} _cups_digestoptions_t;
+
+typedef enum _cups_uatokens_e          /**** UserAgentTokens values */
+{
+  _CUPS_UATOKENS_NONE,                 /* Do not send User-Agent */
+  _CUPS_UATOKENS_PRODUCT_ONLY,         /* CUPS IPP */
+  _CUPS_UATOKENS_MAJOR,                        /* CUPS/major IPP/2 */
+  _CUPS_UATOKENS_MINOR,                        /* CUPS/major.minor IPP/2.1 */
+  _CUPS_UATOKENS_MINIMAL,              /* CUPS/major.minor.patch IPP/2.1 */
+  _CUPS_UATOKENS_OS,                   /* CUPS/major.minor.patch (osname osversion) IPP/2.1 */
+  _CUPS_UATOKENS_FULL                  /* CUPS/major.minor.patch (osname osversion; architecture) IPP/2.1 */
+} _cups_uatokens_t;
+
 typedef struct _cups_globals_s         /**** CUPS global state data ****/
 {
   /* Multiple places... */
@@ -67,6 +82,7 @@ typedef struct _cups_globals_s                /**** CUPS global state data ****/
                        *cups_serverroot,
                                        /* CUPS_SERVERROOT environment var */
                        *cups_statedir, /* CUPS_STATEDIR environment var */
+                       *home,          /* HOME environment var */
                        *localedir;     /* LOCALDIR environment var */
 
   /* adminutil.c */
@@ -108,7 +124,7 @@ typedef struct _cups_globals_s              /**** CUPS global state data ****/
   int                  need_res_init;  /* Need to reinitialize resolver? */
 
   /* ipp.c */
-  ipp_uchar_t          ipp_date[11];   /* RFC-1903 date/time data */
+  ipp_uchar_t          ipp_date[11];   /* RFC-2579 date/time data */
   _cups_buffer_t       *cups_buffers;  /* Buffer list */
 
   /* ipp-support.c */
@@ -122,17 +138,16 @@ typedef struct _cups_globals_s            /**** CUPS global state data ****/
   char                 language[32];   /* Cached language */
 #  endif /* __APPLE__ */
 
-  /* ppd.c */
-  ppd_status_t         ppd_status;     /* Status of last ppdOpen*() */
-  int                  ppd_line;       /* Current line number */
-  ppd_conform_t                ppd_conform;    /* Level of conformance required */
-
   /* pwg-media.c */
   cups_array_t         *leg_size_lut,  /* Lookup table for legacy names */
                        *ppd_size_lut,  /* Lookup table for PPD names */
                        *pwg_size_lut;  /* Lookup table for PWG names */
-  _pwg_media_t         pwg_media;      /* PWG media data for custom size */
-  char                 pwg_name[65];   /* PWG media name for custom size */
+  pwg_media_t          pwg_media;      /* PWG media data for custom size */
+  char                 pwg_name[65],   /* PWG media name for custom size */
+                       ppd_name[41];   /* PPD media name for custom size */
+
+  /* raster-error.c */
+  _cups_raster_error_t raster_error;   /* Raster error information */
 
   /* request.c */
   http_t               *http;          /* Current server connection */
@@ -149,8 +164,11 @@ typedef struct _cups_globals_s             /**** CUPS global state data ****/
   char                 tempfile[1024]; /* cupsTempFd/File buffer */
 
   /* usersys.c */
+  _cups_digestoptions_t        digestoptions;  /* DigestOptions setting */
+  _cups_uatokens_t     uatokens;       /* UserAgentTokens setting */
   http_encryption_t    encryption;     /* Encryption setting */
   char                 user[65],       /* User name */
+                       user_agent[256],/* User-Agent string */
                        server[256],    /* Server address */
                        servername[256],/* Server hostname */
                        password[128];  /* Password for default callback */
@@ -164,15 +182,15 @@ typedef struct _cups_globals_s            /**** CUPS global state data ****/
   cups_server_cert_cb_t        server_cert_cb; /* Server certificate callback */
   void                 *server_cert_data;
                                        /* Server certificate user data */
-  int                  any_root,       /* Allow any root */
+  int                  server_version, /* Server IPP version */
+                       trust_first,    /* Trust on first use? */
+                       any_root,       /* Allow any (e.g., self-signed) root */
                        expired_certs,  /* Allow expired certs */
-                       expired_root;   /* Allow expired root */
+                       validate_certs; /* Validate certificates */
 
   /* util.c */
   char                 def_printer[256];
                                        /* Default printer */
-  char                 ppd_filename[HTTP_MAX_URI];
-                                       /* PPD filename */
 } _cups_globals_t;
 
 typedef struct _cups_media_db_s                /* Media database */
@@ -205,6 +223,7 @@ typedef struct _cups_dconstres_s    /* Constraint/resolver */
 struct _cups_dinfo_s                   /* Destination capability and status
                                         * information */
 {
+  int                  version;        /* IPP version */
   const char           *uri;           /* Printer URI */
   char                 *resource;      /* Resource path */
   ipp_t                        *attrs;         /* Printer attributes */
@@ -216,6 +235,11 @@ struct _cups_dinfo_s                       /* Destination capability and status
   cups_array_t         *media_db;      /* Media database */
   _cups_media_db_t     min_size,       /* Minimum size */
                        max_size;       /* Maximum size */
+  unsigned             cached_flags;   /* Flags used for cached media */
+  cups_array_t         *cached_db;     /* Cache of media from last index/default */
+  time_t               ready_time;     /* When xxx-ready attributes were last queried */
+  ipp_t                        *ready_attrs;   /* xxx-ready attributes */
+  cups_array_t         *ready_db;      /* media[-col]-ready media database */
 };
 
 
@@ -224,43 +248,38 @@ struct _cups_dinfo_s                      /* Destination capability and status
  */
 
 #  ifdef __APPLE__
-extern CFStringRef     _cupsAppleCopyDefaultPaperID(void);
-extern CFStringRef     _cupsAppleCopyDefaultPrinter(void);
-extern int             _cupsAppleGetUseLastPrinter(void);
-extern void            _cupsAppleSetDefaultPaperID(CFStringRef name);
-extern void            _cupsAppleSetDefaultPrinter(CFStringRef name);
-extern void            _cupsAppleSetUseLastPrinter(int uselast);
+extern CFStringRef     _cupsAppleCopyDefaultPaperID(void) _CUPS_PRIVATE;
+extern CFStringRef     _cupsAppleCopyDefaultPrinter(void) _CUPS_PRIVATE;
+extern int             _cupsAppleGetUseLastPrinter(void) _CUPS_PRIVATE;
+extern void            _cupsAppleSetDefaultPaperID(CFStringRef name) _CUPS_PRIVATE;
+extern void            _cupsAppleSetDefaultPrinter(CFStringRef name) _CUPS_PRIVATE;
+extern void            _cupsAppleSetUseLastPrinter(int uselast) _CUPS_PRIVATE;
 #  endif /* __APPLE__ */
 
-extern char            *_cupsBufferGet(size_t size);
-extern void            _cupsBufferRelease(char *b);
-
-extern http_t          *_cupsConnect(void);
-extern int             _cupsGet1284Values(const char *device_id,
-                                          cups_option_t **values);
-extern const char      *_cupsGetDestResource(cups_dest_t *dest, char *resource,
-                                             size_t resourcesize);
-extern int             _cupsGetDests(http_t *http, ipp_op_t op,
-                                     const char *name, cups_dest_t **dests,
-                                     cups_ptype_t type, cups_ptype_t mask);
-extern const char      *_cupsGetPassword(const char *prompt);
-extern void            _cupsGlobalLock(void);
-extern _cups_globals_t *_cupsGlobals(void);
-extern void            _cupsGlobalUnlock(void);
+extern char            *_cupsBufferGet(size_t size) _CUPS_PRIVATE;
+extern void            _cupsBufferRelease(char *b) _CUPS_PRIVATE;
+
+extern http_t          *_cupsConnect(void) _CUPS_PRIVATE;
+extern char            *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize) _CUPS_PRIVATE;
+extern ipp_attribute_t *_cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value) _CUPS_PRIVATE;
+extern int             _cupsGet1284Values(const char *device_id, cups_option_t **values) _CUPS_PRIVATE;
+extern const char      *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize) _CUPS_PRIVATE;
+extern int             _cupsGetDests(http_t *http, ipp_op_t op, const char *name, cups_dest_t **dests, cups_ptype_t type, cups_ptype_t mask) _CUPS_PRIVATE;
+extern const char      *_cupsGetPassword(const char *prompt) _CUPS_PRIVATE;
+extern void            _cupsGlobalLock(void) _CUPS_PRIVATE;
+extern _cups_globals_t *_cupsGlobals(void) _CUPS_PRIVATE;
+extern void            _cupsGlobalUnlock(void) _CUPS_PRIVATE;
 #  ifdef HAVE_GSSAPI
-extern const char      *_cupsGSSServiceName(void);
+extern const char      *_cupsGSSServiceName(void) _CUPS_PRIVATE;
 #  endif /* HAVE_GSSAPI */
-extern int             _cupsNextDelay(int current, int *previous);
-extern void            _cupsSetDefaults(void);
-extern void            _cupsSetError(ipp_status_t status, const char *message,
-                                     int localize);
-extern void            _cupsSetHTTPError(http_status_t status);
+extern int             _cupsNextDelay(int current, int *previous) _CUPS_PRIVATE;
+extern void            _cupsSetDefaults(void) _CUPS_INTERNAL;
+extern void            _cupsSetError(ipp_status_t status, const char *message, int localize) _CUPS_PRIVATE;
+extern void            _cupsSetHTTPError(http_status_t status) _CUPS_INTERNAL;
 #  ifdef HAVE_GSSAPI
-extern int             _cupsSetNegotiateAuthString(http_t *http,
-                                                   const char *method,
-                                                   const char *resource);
+extern int             _cupsSetNegotiateAuthString(http_t *http, const char *method, const char *resource) _CUPS_PRIVATE;
 #  endif /* HAVE_GSSAPI */
-extern char            *_cupsUserDefault(char *name, size_t namesize);
+extern char            *_cupsUserDefault(char *name, size_t namesize) _CUPS_INTERNAL;
 
 
 /*
@@ -271,7 +290,3 @@ extern char         *_cupsUserDefault(char *name, size_t namesize);
 }
 #  endif /* __cplusplus */
 #endif /* !_CUPS_CUPS_PRIVATE_H_ */
-
-/*
- * End of "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $".
- */