]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/cups-private.h
Merge changes from CUPS 1.6svn-r10437.
[thirdparty/cups.git] / cups / cups-private.h
index 0a0e9e2bc91155e12fc7d059fad163cccd947327..e2c0239ade498a282722dc2e3be34987bfb6f8a6 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id$"
+ * "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $"
  *
  *   Private definitions for CUPS.
  *
- *   Copyright 2007-2010 by Apple Inc.
+ *   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
  * Include necessary headers...
  */
 
-#  include <cups/cups.h>
 #  include "string-private.h"
 #  include "debug-private.h"
-#  include "ppd-private.h"
-#  include "http-private.h"
 #  include "ipp-private.h"
+#  include "http-private.h"
 #  include "language-private.h"
 #  include "pwg-private.h"
-#  ifdef HAVE_PTHREAD_H
-#    include <pthread.h>
-#  endif /* HAVE_PTHREAD_H */
+#  include "ppd-private.h"
+#  include "thread-private.h"
+#  include <cups/cups.h>
+#  ifdef __APPLE__
+#    include <sys/cdefs.h>
+#    include <CoreFoundation/CoreFoundation.h>
+#  endif /* __APPLE__ */
 
 
 /*
@@ -48,6 +50,14 @@ extern "C" {
  * Types...
  */
 
+typedef struct _cups_buffer_s          /**** Read/write buffer ****/
+{
+  struct _cups_buffer_s        *next;          /* Next buffer in list */
+  size_t               size;           /* Size of buffer */
+  char                 used,           /* Is this buffer used? */
+                       d[1];           /* Data buffer */
+} _cups_buffer_t;
+
 typedef struct _cups_globals_s         /**** CUPS global state data ****/
 {
   /* Multiple places... */
@@ -66,6 +76,12 @@ typedef struct _cups_globals_s               /**** CUPS global state data ****/
                                        /* Number of server settings */
   cups_option_t                *cupsd_settings;/* Server settings */
 
+  /* auth.c */
+#  ifdef HAVE_GSSAPI
+  char                 gss_service_name[32];
+                                       /* Kerberos service name */
+#  endif /* HAVE_GSSAPI */
+
   /* backend.c */
   char                 resolved_uri[1024];
                                        /* Buffer for cupsBackendDeviceURI */
@@ -87,7 +103,7 @@ typedef struct _cups_globals_s               /**** CUPS global state data ****/
 
   /* ipp.c */
   ipp_uchar_t          ipp_date[11];   /* RFC-1903 date/time data */
-  _ipp_buffer_t                *ipp_buffers;   /* Buffer list */
+  _cups_buffer_t       *cups_buffers;  /* Buffer list */
 
   /* ipp-support.c */
   int                  ipp_port;       /* IPP port number */
@@ -130,9 +146,21 @@ typedef struct _cups_globals_s             /**** CUPS global state data ****/
   http_encryption_t    encryption;     /* Encryption setting */
   char                 user[65],       /* User name */
                        server[256],    /* Server address */
-                       servername[256];/* Server hostname */
+                       servername[256],/* Server hostname */
+                       password[128];  /* Password for default callback */
   cups_password_cb2_t  password_cb;    /* Password callback */
   void                 *password_data; /* Password user data */
+  http_tls_credentials_t tls_credentials;
+                                       /* Default client credentials */
+  cups_client_cert_cb_t        client_cert_cb; /* Client certificate callback */
+  void                 *client_cert_data;
+                                       /* Client certificate user 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 */
+                       expired_certs,  /* Allow expired certs */
+                       expired_root;   /* Allow expired root */
 
   /* util.c */
   char                 def_printer[256];
@@ -141,20 +169,82 @@ typedef struct _cups_globals_s            /**** CUPS global state data ****/
                                        /* PPD filename */
 } _cups_globals_t;
 
+typedef struct _cups_media_db_s                /* Media database */
+{
+  char         *color,                 /* Media color, if any */
+               *key,                   /* Media key, if any */
+               *info,                  /* Media human-readable name, if any */
+               *size_name,             /* Media PWG size name, if provided */
+               *source,                /* Media source, if any */
+               *type;                  /* Media type, if any */
+  int          width,                  /* Width in hundredths of millimeters */
+               length,                 /* Length in hundredths of
+                                        * millimeters */
+               bottom,                 /* Bottom margin in hundredths of
+                                        * millimeters */
+               left,                   /* Left margin in hundredths of
+                                        * millimeters */
+               right,                  /* Right margin in hundredths of
+                                        * millimeters */
+               top;                    /* Top margin in hundredths of
+                                        * millimeters */
+} _cups_media_db_t;
+
+struct _cups_dinfo_s                   /* Destination capability and status
+                                        * information */
+{
+  const char           *uri;           /* Printer URI */
+  char                 *resource;      /* Resource path */
+  ipp_t                        *attrs;         /* Printer attributes */
+  cups_array_t         *constraints;   /* Job constraints */
+  cups_array_t         *localizations; /* Localization information */
+  cups_array_t         *media_db;      /* Media database */
+  _cups_media_db_t     min_size,       /* Minimum size */
+                       max_size;       /* Maximum size */
+};
+
 
 /*
  * Prototypes...
  */
 
+#  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);
+#  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);
+#  ifdef HAVE_GSSAPI
+extern const char      *_cupsGSSServiceName(void);
+#  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);
+#  ifdef HAVE_GSSAPI
+extern int             _cupsSetNegotiateAuthString(http_t *http,
+                                                   const char *method,
+                                                   const char *resource);
+#  endif /* HAVE_GSSAPI */
 extern char            *_cupsUserDefault(char *name, size_t namesize);
 
 
@@ -168,5 +258,5 @@ extern char         *_cupsUserDefault(char *name, size_t namesize);
 #endif /* !_CUPS_CUPS_PRIVATE_H_ */
 
 /*
- * End of "$Id$".
+ * End of "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $".
  */