]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http.h
Merge changes from CUPS 1.6svn-r9968.
[thirdparty/cups.git] / cups / http.h
index 08067c45636817cc370aeb0c8aa2f2787b358d01..5e3a42d3a94cb58121f1a9f08e1405a9ea775fd2 100644 (file)
@@ -1,10 +1,9 @@
 /*
  * "$Id: http.h 7026 2007-10-19 00:57:45Z mike $"
  *
- *   Hyper-Text Transport Protocol definitions for the Common UNIX Printing
- *   System (CUPS).
+ *   Hyper-Text Transport Protocol definitions for CUPS.
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2011 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -24,6 +23,7 @@
  */
 
 #  include "versioning.h"
+#  include "array.h"
 #  include <string.h>
 #  include <time.h>
 #  include <sys/types.h>
@@ -88,7 +88,7 @@ extern "C" {
 #if defined(AF_INET6) && !defined(s6_addr32)
 #  if defined(__sun)
 #    define s6_addr32  _S6_un._S6_u32
-#  elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#  elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
 #    define s6_addr32  __u6_addr.__u6_addr32
 #  elif defined(__osf__)
 #    define s6_addr32  s6_un.sa6_laddr
@@ -250,11 +250,12 @@ typedef enum http_status_e                /**** HTTP status codes ****/
   HTTP_GATEWAY_TIMEOUT,                        /* Gateway connection timed out */
   HTTP_NOT_SUPPORTED,                  /* HTTP version not supported */
 
-  HTTP_AUTHORIZATION_CANCELED = 1000   /* User cancelled authorization */
-
+  HTTP_AUTHORIZATION_CANCELED = 1000,  /* User canceled authorization @since CUPS 1.4@ */
+  HTTP_PKI_ERROR,                      /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
+  HTTP_WEBIF_DISABLED                  /* Web interface is disabled @private@ */
 } http_status_t;
 
-typedef enum http_uri_status_e         /**** URI separation status @since CUPS1.2@ ****/
+typedef enum http_uri_status_e         /**** URI separation status @since CUPS 1.2@ ****/
 {
   HTTP_URI_OVERFLOW = -8,              /* URI buffer for httpAssembleURI is too small */
   HTTP_URI_BAD_ARGUMENTS = -7,         /* Bad arguments to function (error) */
@@ -317,6 +318,16 @@ typedef struct http_addrlist_s             /**** Socket address list, which is
 
 typedef struct _http_s http_t;         /**** HTTP connection type ****/
 
+typedef struct http_credential_s       /**** HTTP credential data @since CUPS 1.5/Mac OS X 10.7@ ****/
+{
+  void         *data;                  /* Pointer to credential data */
+  size_t       datalen;                /* Credential length */
+} http_credential_t;
+
+typedef int (*http_timeout_cb_t)(http_t *http, void *user_data);
+                                       /**** HTTP timeout callback @since CUPS 1.5/Mac OS X 10.7@ ****/
+
+
 
 /*
  * Prototypes...
@@ -346,10 +357,7 @@ extern void                httpInitialize(void);
 extern int             httpOptions(http_t *http, const char *uri);
 extern int             httpPost(http_t *http, const char *uri);
 extern int             httpPrintf(http_t *http, const char *format, ...)
-#  ifdef __GNUC__
-__attribute__ ((__format__ (__printf__, 2, 3)))
-#  endif /* __GNUC__ */
-;
+                       __attribute__ ((__format__ (__printf__, 2, 3)));
 extern int             httpPut(http_t *http, const char *uri);
 extern int             httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
 extern int             httpReconnect(http_t *http);
@@ -440,6 +448,20 @@ extern char                *httpGetAuthString(http_t *http) _CUPS_API_1_3;
 extern void            httpSetAuthString(http_t *http, const char *scheme,
                                          const char *data) _CUPS_API_1_3;
 
+/**** New in CUPS 1.5/Mac OS X 10.7 ****/
+extern int             httpAddCredential(cups_array_t *credentials,
+                                         const void *data, size_t datalen)
+                                         _CUPS_API_1_5;
+extern int             httpCopyCredentials(http_t *http,
+                                           cups_array_t **credentials)
+                                           _CUPS_API_1_5;
+extern void            httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
+extern int             httpSetCredentials(http_t *http, cups_array_t *certs)
+                                          _CUPS_API_1_5;
+extern void            httpSetTimeout(http_t *http, double timeout,
+                                      http_timeout_cb_t cb, void *user_data);
+
+
 /*
  * C++ magic...
  */