]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/http.h
Update documentation and dependencies for 1.5b1.
[thirdparty/cups.git] / cups / http.h
CommitLineData
3840d6ba 1/*
b2e10895 2 * "$Id$"
3840d6ba 3 *
b9738d7c 4 * Hyper-Text Transport Protocol definitions for CUPS.
3840d6ba 5 *
94a1c8e4 6 * Copyright 2007-2011 by Apple Inc.
d220c7b8 7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
3840d6ba 8 *
fd8b1cf8 9 * These coded instructions, statements, and computer programs are the
4e8d321f 10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
dab1a4d8 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
3840d6ba 16 */
17
b2e10895 18#ifndef _CUPS_HTTP_H_
19# define _CUPS_HTTP_H_
3a193f5e 20
21/*
22 * Include necessary headers...
23 */
24
ff137eb1 25# include "versioning.h"
b9738d7c 26# include "array.h"
50146867 27# include <string.h>
aaa5608c 28# include <time.h>
4469b6fe 29# include <sys/types.h>
c3026ddc 30# ifdef WIN32
d220c7b8 31# ifndef __CUPS_SSIZE_T_DEFINED
32# define __CUPS_SSIZE_T_DEFINED
33/* Windows does not support the ssize_t type, so map it to off_t... */
34typedef off_t ssize_t; /* @private@ */
35# endif /* !__CUPS_SSIZE_T_DEFINED */
4469b6fe 36# include <winsock2.h>
37# include <ws2tcpip.h>
aaa5608c 38# else
1af1c5f7 39# ifdef __sgi
40# define INET6 /* IRIX IPv6 support... */
40b1b044 41# endif /* __sgi */
aaa5608c 42# include <unistd.h>
43# include <sys/time.h>
aaa5608c 44# include <sys/socket.h>
45# include <netdb.h>
46# include <netinet/in.h>
47# include <arpa/inet.h>
48# include <netinet/in_systm.h>
49# include <netinet/ip.h>
f915b00f 50# if !defined(__APPLE__) || !defined(TCP_NODELAY)
51# include <netinet/tcp.h>
52# endif /* !__APPLE__ || !TCP_NODELAY */
1af1c5f7 53# if defined(AF_UNIX) && !defined(AF_LOCAL)
54# define AF_LOCAL AF_UNIX /* Older UNIX's have old names... */
55# endif /* AF_UNIX && !AF_LOCAL */
c6075312 56# ifdef AF_LOCAL
57# include <sys/un.h>
58# endif /* AF_LOCAL */
21cc7184 59# if defined(LOCAL_PEERCRED) && !defined(SO_PEERCRED)
60# define SO_PEERCRED LOCAL_PEERCRED
61# endif /* LOCAL_PEERCRED && !SO_PEERCRED */
c3026ddc 62# endif /* WIN32 */
3b960317 63
3a193f5e 64
65/*
66 * C++ magic...
67 */
68
69# ifdef __cplusplus
70extern "C" {
71# endif /* __cplusplus */
72
73
9126c03b 74/*
75 * Oh, the wonderful world of IPv6 compatibility. Apparently some
76 * implementations expose the (more logical) 32-bit address parts
77 * to everyone, while others only expose it to kernel code... To
78 * make supporting IPv6 even easier, each vendor chose different
79 * core structure and union names, so the same defines or code
80 * can't be used on all platforms.
81 *
086c584d 82 * The following will likely need tweaking on new platforms that
9126c03b 83 * support IPv6 - the "s6_addr32" define maps to the 32-bit integer
84 * array in the in6_addr union, which is named differently on various
85 * platforms.
86 */
87
88#if defined(AF_INET6) && !defined(s6_addr32)
89# if defined(__sun)
90# define s6_addr32 _S6_un._S6_u32
94a1c8e4 91# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
9126c03b 92# define s6_addr32 __u6_addr.__u6_addr32
a1bcdf3e 93# elif defined(__osf__)
94# define s6_addr32 s6_un.sa6_laddr
4469b6fe 95# elif defined(WIN32)
96/*
97 * Windows only defines byte and 16-bit word members of the union and
98 * requires special casing of all raw address code...
99 */
100# define s6_addr32 error_need_win32_specific_code
9126c03b 101# endif /* __sun */
102#endif /* AF_INET6 && !s6_addr32 */
103
104
3a193f5e 105/*
106 * Limits...
107 */
108
109# define HTTP_MAX_URI 1024 /* Max length of URI string */
110# define HTTP_MAX_HOST 256 /* Max length of hostname string */
b0a98a63 111# define HTTP_MAX_BUFFER 2048 /* Max length of data buffer */
3a193f5e 112# define HTTP_MAX_VALUE 256 /* Max header field value length */
113
114
3840d6ba 115/*
086c584d 116 * Types and structures...
3840d6ba 117 */
118
c94f4aa9 119typedef enum http_auth_e /**** HTTP authentication types ****/
120{
121 HTTP_AUTH_NONE, /* No authentication in use */
122 HTTP_AUTH_BASIC, /* Basic authentication in use */
123 HTTP_AUTH_MD5, /* Digest authentication in use */
124 HTTP_AUTH_MD5_SESS, /* MD5-session authentication in use */
125 HTTP_AUTH_MD5_INT, /* Digest authentication in use for body */
cf94bcb1 126 HTTP_AUTH_MD5_SESS_INT, /* MD5-session authentication in use for body */
373b3e5f 127 HTTP_AUTH_NEGOTIATE /* GSSAPI authentication in use @since CUPS 1.3/Mac OS X 10.5@ */
c94f4aa9 128} http_auth_t;
129
130typedef enum http_encoding_e /**** HTTP transfer encoding values ****/
131{
132 HTTP_ENCODE_LENGTH, /* Data is sent with Content-Length */
f8699659 133 HTTP_ENCODE_CHUNKED, /* Data is chunked */
134 HTTP_ENCODE_FIELDS /* Sending HTTP fields */
c94f4aa9 135} http_encoding_t;
136
137typedef enum http_encryption_e /**** HTTP encryption values ****/
138{
139 HTTP_ENCRYPT_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */
140 HTTP_ENCRYPT_NEVER, /* Never encrypt */
141 HTTP_ENCRYPT_REQUIRED, /* Encryption is required (TLS upgrade) */
142 HTTP_ENCRYPT_ALWAYS /* Always encrypt (SSL) */
143} http_encryption_t;
144
145typedef enum http_field_e /**** HTTP field names ****/
146{
147 HTTP_FIELD_UNKNOWN = -1, /* Unknown field */
148 HTTP_FIELD_ACCEPT_LANGUAGE, /* Accept-Language field */
149 HTTP_FIELD_ACCEPT_RANGES, /* Accept-Ranges field */
150 HTTP_FIELD_AUTHORIZATION, /* Authorization field */
151 HTTP_FIELD_CONNECTION, /* Connection field */
152 HTTP_FIELD_CONTENT_ENCODING, /* Content-Encoding field */
153 HTTP_FIELD_CONTENT_LANGUAGE, /* Content-Language field */
154 HTTP_FIELD_CONTENT_LENGTH, /* Content-Length field */
155 HTTP_FIELD_CONTENT_LOCATION, /* Content-Location field */
156 HTTP_FIELD_CONTENT_MD5, /* Content-MD5 field */
157 HTTP_FIELD_CONTENT_RANGE, /* Content-Range field */
158 HTTP_FIELD_CONTENT_TYPE, /* Content-Type field */
159 HTTP_FIELD_CONTENT_VERSION, /* Content-Version field */
160 HTTP_FIELD_DATE, /* Date field */
161 HTTP_FIELD_HOST, /* Host field */
162 HTTP_FIELD_IF_MODIFIED_SINCE, /* If-Modified-Since field */
163 HTTP_FIELD_IF_UNMODIFIED_SINCE, /* If-Unmodified-Since field */
164 HTTP_FIELD_KEEP_ALIVE, /* Keep-Alive field */
165 HTTP_FIELD_LAST_MODIFIED, /* Last-Modified field */
166 HTTP_FIELD_LINK, /* Link field */
167 HTTP_FIELD_LOCATION, /* Location field */
168 HTTP_FIELD_RANGE, /* Range field */
169 HTTP_FIELD_REFERER, /* Referer field */
170 HTTP_FIELD_RETRY_AFTER, /* Retry-After field */
171 HTTP_FIELD_TRANSFER_ENCODING, /* Transfer-Encoding field */
172 HTTP_FIELD_UPGRADE, /* Upgrade field */
173 HTTP_FIELD_USER_AGENT, /* User-Agent field */
174 HTTP_FIELD_WWW_AUTHENTICATE, /* WWW-Authenticate field */
175 HTTP_FIELD_MAX /* Maximum field index */
176} http_field_t;
177
178typedef enum http_keepalive_e /**** HTTP keep-alive values ****/
179{
180 HTTP_KEEPALIVE_OFF = 0, /* No keep alive support */
181 HTTP_KEEPALIVE_ON /* Use keep alive */
182} http_keepalive_t;
183
086c584d 184typedef enum http_state_e /**** HTTP state values; states
185 **** are server-oriented...
186 ****/
3a193f5e 187{
086c584d 188 HTTP_WAITING, /* Waiting for command */
189 HTTP_OPTIONS, /* OPTIONS command, waiting for blank line */
190 HTTP_GET, /* GET command, waiting for blank line */
191 HTTP_GET_SEND, /* GET command, sending data */
192 HTTP_HEAD, /* HEAD command, waiting for blank line */
193 HTTP_POST, /* POST command, waiting for blank line */
194 HTTP_POST_RECV, /* POST command, receiving data */
195 HTTP_POST_SEND, /* POST command, sending data */
196 HTTP_PUT, /* PUT command, waiting for blank line */
197 HTTP_PUT_RECV, /* PUT command, receiving data */
198 HTTP_DELETE, /* DELETE command, waiting for blank line */
199 HTTP_TRACE, /* TRACE command, waiting for blank line */
200 HTTP_CLOSE, /* CLOSE command, waiting for blank line */
201 HTTP_STATUS /* Command complete, sending status */
3a193f5e 202} http_state_t;
fd8b1cf8 203
086c584d 204typedef enum http_status_e /**** HTTP status codes ****/
3a193f5e 205{
086c584d 206 HTTP_ERROR = -1, /* An error response from httpXxxx() */
207
208 HTTP_CONTINUE = 100, /* Everything OK, keep going... */
209 HTTP_SWITCHING_PROTOCOLS, /* HTTP upgrade to TLS/SSL */
210
211 HTTP_OK = 200, /* OPTIONS/GET/HEAD/POST/TRACE command was successful */
212 HTTP_CREATED, /* PUT command was successful */
213 HTTP_ACCEPTED, /* DELETE command was successful */
214 HTTP_NOT_AUTHORITATIVE, /* Information isn't authoritative */
215 HTTP_NO_CONTENT, /* Successful command, no new data */
216 HTTP_RESET_CONTENT, /* Content was reset/recreated */
217 HTTP_PARTIAL_CONTENT, /* Only a partial file was recieved/sent */
218
219 HTTP_MULTIPLE_CHOICES = 300, /* Multiple files match request */
220 HTTP_MOVED_PERMANENTLY, /* Document has moved permanently */
221 HTTP_MOVED_TEMPORARILY, /* Document has moved temporarily */
222 HTTP_SEE_OTHER, /* See this other link... */
223 HTTP_NOT_MODIFIED, /* File not modified */
224 HTTP_USE_PROXY, /* Must use a proxy to access this URI */
225
226 HTTP_BAD_REQUEST = 400, /* Bad request */
227 HTTP_UNAUTHORIZED, /* Unauthorized to access host */
228 HTTP_PAYMENT_REQUIRED, /* Payment required */
229 HTTP_FORBIDDEN, /* Forbidden to access this URI */
230 HTTP_NOT_FOUND, /* URI was not found */
231 HTTP_METHOD_NOT_ALLOWED, /* Method is not allowed */
232 HTTP_NOT_ACCEPTABLE, /* Not Acceptable */
233 HTTP_PROXY_AUTHENTICATION, /* Proxy Authentication is Required */
234 HTTP_REQUEST_TIMEOUT, /* Request timed out */
235 HTTP_CONFLICT, /* Request is self-conflicting */
236 HTTP_GONE, /* Server has gone away */
237 HTTP_LENGTH_REQUIRED, /* A content length or encoding is required */
238 HTTP_PRECONDITION, /* Precondition failed */
239 HTTP_REQUEST_TOO_LARGE, /* Request entity too large */
240 HTTP_URI_TOO_LONG, /* URI too long */
241 HTTP_UNSUPPORTED_MEDIATYPE, /* The requested media type is unsupported */
d834148f 242 HTTP_REQUESTED_RANGE, /* The requested range is not satisfiable */
243 HTTP_EXPECTATION_FAILED, /* The expectation given in an Expect header field was not met */
086c584d 244 HTTP_UPGRADE_REQUIRED = 426, /* Upgrade to SSL/TLS required */
245
246 HTTP_SERVER_ERROR = 500, /* Internal server error */
247 HTTP_NOT_IMPLEMENTED, /* Feature not implemented */
248 HTTP_BAD_GATEWAY, /* Bad gateway */
249 HTTP_SERVICE_UNAVAILABLE, /* Service is unavailable */
250 HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */
06830751 251 HTTP_NOT_SUPPORTED, /* HTTP version not supported */
252
b9738d7c 253 HTTP_AUTHORIZATION_CANCELED = 1000, /* User canceled authorization @since CUPS 1.4@ */
a1a2e89a 254 HTTP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
02a87a41 255 HTTP_WEBIF_DISABLED /* Web interface is disabled @private@ */
3a193f5e 256} http_status_t;
3840d6ba 257
b9738d7c 258typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/
3840d6ba 259{
911278f6 260 HTTP_URI_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */
6f41fc9a 261 HTTP_URI_BAD_ARGUMENTS = -7, /* Bad arguments to function (error) */
262 HTTP_URI_BAD_RESOURCE = -6, /* Bad resource in URI (error) */
263 HTTP_URI_BAD_PORT = -5, /* Bad port number in URI (error) */
264 HTTP_URI_BAD_HOSTNAME = -4, /* Bad hostname in URI (error) */
265 HTTP_URI_BAD_USERNAME = -3, /* Bad username in URI (error) */
266 HTTP_URI_BAD_SCHEME = -2, /* Bad scheme in URI (error) */
267 HTTP_URI_BAD_URI = -1, /* Bad/empty URI (error) */
c94f4aa9 268 HTTP_URI_OK = 0, /* URI decoded OK */
269 HTTP_URI_MISSING_SCHEME, /* Missing scheme in URI (warning) */
270 HTTP_URI_UNKNOWN_SCHEME, /* Unknown scheme in URI (warning) */
271 HTTP_URI_MISSING_RESOURCE /* Missing resource in URI (warning) */
272} http_uri_status_t;
273
00a1fad8 274typedef enum http_uri_coding_e /**** URI en/decode flags ****/
275{
276 HTTP_URI_CODING_NONE = 0, /* Don't en/decode anything */
277 HTTP_URI_CODING_USERNAME = 1, /* En/decode the username portion */
278 HTTP_URI_CODING_HOSTNAME = 2, /* En/decode the hostname portion */
279 HTTP_URI_CODING_RESOURCE = 4, /* En/decode the resource portion */
280 HTTP_URI_CODING_MOST = 7, /* En/decode all but the query */
281 HTTP_URI_CODING_QUERY = 8, /* En/decode the query portion */
282 HTTP_URI_CODING_ALL = 15 /* En/decode everything */
283} http_uri_coding_t;
284
c94f4aa9 285typedef enum http_version_e /**** HTTP version numbers ****/
286{
287 HTTP_0_9 = 9, /* HTTP/0.9 */
288 HTTP_1_0 = 100, /* HTTP/1.0 */
289 HTTP_1_1 = 101 /* HTTP/1.1 */
290} http_version_t;
99de6da0 291
7fbf7fc4 292typedef union _http_addr_u /**** Socket address union, which
086c584d 293 **** makes using IPv6 and other
294 **** address types easier and
373b3e5f 295 **** more portable. @since CUPS 1.2/Mac OS X 10.5@
086c584d 296 ****/
99de6da0 297{
298 struct sockaddr addr; /* Base structure for family value */
299 struct sockaddr_in ipv4; /* IPv4 address */
300#ifdef AF_INET6
301 struct sockaddr_in6 ipv6; /* IPv6 address */
302#endif /* AF_INET6 */
c6075312 303#ifdef AF_LOCAL
304 struct sockaddr_un un; /* Domain socket file */
305#endif /* AF_LOCAL */
086c584d 306 char pad[256]; /* Padding to ensure binary compatibility */
99de6da0 307} http_addr_t;
fd8b1cf8 308
086c584d 309typedef struct http_addrlist_s /**** Socket address list, which is
310 **** used to enumerate all of the
311 **** addresses that are associated
373b3e5f 312 **** with a hostname. @since CUPS 1.2/Mac OS X 10.5@
086c584d 313 ****/
314{
315 struct http_addrlist_s *next; /* Pointer to next address in list */
316 http_addr_t addr; /* Address */
317} http_addrlist_t;
fd8b1cf8 318
72510b94 319typedef struct _http_s http_t; /**** HTTP connection type ****/
3840d6ba 320
a1a2e89a 321typedef struct http_credential_s /**** Credential data @since CUPS 1.5/Mac OS X 10.7@ ****/
b9738d7c 322{
323 void *data; /* Pointer to credential data */
324 size_t datalen; /* Credential length */
325} http_credential_t;
326
3840d6ba 327
328/*
3a193f5e 329 * Prototypes...
3840d6ba 330 */
331
7fbf7fc4 332extern void httpBlocking(http_t *http, int b);
c1918ec5 333extern int httpCheck(http_t *http);
7fbf7fc4 334extern void httpClearFields(http_t *http);
a8374e1e 335extern void httpClose(http_t *http);
063e1ac7 336extern http_t *httpConnect(const char *host, int port);
b5cb0608 337extern http_t *httpConnectEncrypt(const char *host, int port,
7c298ddc 338 http_encryption_t encryption);
063e1ac7 339extern int httpDelete(http_t *http, const char *uri);
9889b84e 340extern int httpEncryption(http_t *http, http_encryption_t e);
7fbf7fc4 341extern int httpError(http_t *http);
69ee1496 342extern void httpFlush(http_t *http);
063e1ac7 343extern int httpGet(http_t *http, const char *uri);
a8374e1e 344extern char *httpGets(char *line, int length, http_t *http);
063e1ac7 345extern const char *httpGetDateString(time_t t);
346extern time_t httpGetDateTime(const char *s);
7fbf7fc4 347extern const char *httpGetField(http_t *http, http_field_t field);
753453e4 348extern struct hostent *httpGetHostByName(const char *name);
83e740a5 349extern char *httpGetSubField(http_t *http, http_field_t field,
350 const char *name, char *value);
063e1ac7 351extern int httpHead(http_t *http, const char *uri);
0542e38e 352extern void httpInitialize(void);
063e1ac7 353extern int httpOptions(http_t *http, const char *uri);
354extern int httpPost(http_t *http, const char *uri);
aa7e125a 355extern int httpPrintf(http_t *http, const char *format, ...)
356# ifdef __GNUC__
357__attribute__ ((__format__ (__printf__, 2, 3)))
358# endif /* __GNUC__ */
359;
063e1ac7 360extern int httpPut(http_t *http, const char *uri);
ff137eb1 361extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED;
a8374e1e 362extern int httpReconnect(http_t *http);
83e740a5 363extern void httpSeparate(const char *uri, char *method,
364 char *username, char *host, int *port,
ff137eb1 365 char *resource) _CUPS_DEPRECATED;
83e740a5 366extern void httpSetField(http_t *http, http_field_t field,
367 const char *value);
063e1ac7 368extern const char *httpStatus(http_status_t status);
369extern int httpTrace(http_t *http, const char *uri);
a8374e1e 370extern http_status_t httpUpdate(http_t *http);
ff137eb1 371extern int httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED;
372extern char *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED;
373extern char *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED;
374extern int httpGetLength(http_t *http) _CUPS_DEPRECATED;
83e740a5 375extern char *httpMD5(const char *, const char *, const char *,
376 char [33]);
377extern char *httpMD5Final(const char *, const char *, const char *,
378 char [33]);
f7a2ff7e 379extern char *httpMD5String(const unsigned char *, char [33]);
4a73831b 380
d40085f1 381/**** New in CUPS 1.1.19 ****/
ff137eb1 382extern void httpClearCookie(http_t *http) _CUPS_API_1_1_19;
383extern const char *httpGetCookie(http_t *http) _CUPS_API_1_1_19;
384extern void httpSetCookie(http_t *http, const char *cookie) _CUPS_API_1_1_19;
385extern int httpWait(http_t *http, int msec) _CUPS_API_1_1_19;
d40085f1 386
edd6ee99 387/**** New in CUPS 1.1.21 ****/
ff137eb1 388extern char *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21;
edd6ee99 389extern char *httpEncode64_2(char *out, int outlen, const char *in,
ff137eb1 390 int inlen) _CUPS_API_1_1_21;
edd6ee99 391extern void httpSeparate2(const char *uri,
392 char *method, int methodlen,
393 char *username, int usernamelen,
394 char *host, int hostlen, int *port,
ff137eb1 395 char *resource, int resourcelen) _CUPS_DEPRECATED;
edd6ee99 396
cb8cf1cf 397/**** New in CUPS 1.2/Mac OS X 10.5 ****/
ff137eb1 398extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
399extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
99de6da0 400extern int httpAddrEqual(const http_addr_t *addr1,
ff137eb1 401 const http_addr_t *addr2) _CUPS_API_1_2;
402extern void httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2;
086c584d 403extern http_addrlist_t *httpAddrGetList(const char *hostname, int family,
ff137eb1 404 const char *service) _CUPS_API_1_2;
405extern int httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2;
406extern int httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2;
99de6da0 407extern char *httpAddrLookup(const http_addr_t *addr,
ff137eb1 408 char *name, int namelen) _CUPS_API_1_2;
99de6da0 409extern char *httpAddrString(const http_addr_t *addr,
ff137eb1 410 char *s, int slen) _CUPS_API_1_2;
00a1fad8 411extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding,
412 char *uri, int urilen,
911278f6 413 const char *scheme,
414 const char *username,
415 const char *host, int port,
ff137eb1 416 const char *resource) _CUPS_API_1_2;
00a1fad8 417extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
418 char *uri, int urilen,
911278f6 419 const char *scheme,
420 const char *username,
421 const char *host, int port,
ff137eb1 422 const char *resourcef, ...) _CUPS_API_1_2;
423extern int httpFlushWrite(http_t *http) _CUPS_API_1_2;
424extern int httpGetBlocking(http_t *http) _CUPS_API_1_2;
425extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2;
426extern int httpGetFd(http_t *http) _CUPS_API_1_2;
427extern const char *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2;
428extern off_t httpGetLength2(http_t *http) _CUPS_API_1_2;
429extern http_status_t httpGetStatus(http_t *http) _CUPS_API_1_2;
ff84728d 430extern char *httpGetSubField2(http_t *http, http_field_t field,
431 const char *name, char *value,
ff137eb1 432 int valuelen) _CUPS_API_1_2;
433extern ssize_t httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2;
00a1fad8 434extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding,
435 const char *uri,
911278f6 436 char *scheme, int schemelen,
437 char *username, int usernamelen,
438 char *host, int hostlen, int *port,
ff137eb1 439 char *resource, int resourcelen) _CUPS_API_1_2;
440extern void httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2;
441extern void httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
00a1fad8 442extern ssize_t httpWrite2(http_t *http, const char *buffer,
ff137eb1 443 size_t length) _CUPS_API_1_2;
99de6da0 444
cb8cf1cf 445/**** New in CUPS 1.3/Mac OS X 10.5 ****/
ff137eb1 446extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
185977be 447extern void httpSetAuthString(http_t *http, const char *scheme,
ff137eb1 448 const char *data) _CUPS_API_1_3;
3840d6ba 449
b9738d7c 450/**** New in CUPS 1.5 ****/
451extern int httpAddCredential(cups_array_t *credentials,
452 const void *data, size_t datalen)
453 _CUPS_API_1_5;
a1a2e89a 454extern int httpCopyCredentials(http_t *http,
455 cups_array_t **credentials)
b9738d7c 456 _CUPS_API_1_5;
457extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
458extern int httpSetCredentials(http_t *http, cups_array_t *certs)
459 _CUPS_API_1_5;
460
3840d6ba 461/*
3a193f5e 462 * C++ magic...
3840d6ba 463 */
464
3a193f5e 465# ifdef __cplusplus
466}
467# endif /* __cplusplus */
b2e10895 468#endif /* !_CUPS_HTTP_H_ */
3840d6ba 469
470/*
b2e10895 471 * End of "$Id$".
3840d6ba 472 */