Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:11

0001 #ifndef CURLINC_HEADER_H
0002 #define CURLINC_HEADER_H
0003 /***************************************************************************
0004  *                                  _   _ ____  _
0005  *  Project                     ___| | | |  _ \| |
0006  *                             / __| | | | |_) | |
0007  *                            | (__| |_| |  _ <| |___
0008  *                             \___|\___/|_| \_\_____|
0009  *
0010  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
0011  *
0012  * This software is licensed as described in the file COPYING, which
0013  * you should have received as part of this distribution. The terms
0014  * are also available at https://curl.se/docs/copyright.html.
0015  *
0016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
0017  * copies of the Software, and permit persons to whom the Software is
0018  * furnished to do so, under the terms of the COPYING file.
0019  *
0020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
0021  * KIND, either express or implied.
0022  *
0023  * SPDX-License-Identifier: curl
0024  *
0025  ***************************************************************************/
0026 
0027 #ifdef  __cplusplus
0028 extern "C" {
0029 #endif
0030 
0031 struct curl_header {
0032   char *name;    /* this might not use the same case */
0033   char *value;
0034   size_t amount; /* number of headers using this name  */
0035   size_t index;  /* ... of this instance, 0 or higher */
0036   unsigned int origin; /* see bits below */
0037   void *anchor; /* handle privately used by libcurl */
0038 };
0039 
0040 /* 'origin' bits */
0041 #define CURLH_HEADER    (1<<0) /* plain server header */
0042 #define CURLH_TRAILER   (1<<1) /* trailers */
0043 #define CURLH_CONNECT   (1<<2) /* CONNECT headers */
0044 #define CURLH_1XX       (1<<3) /* 1xx headers */
0045 #define CURLH_PSEUDO    (1<<4) /* pseudo headers */
0046 
0047 typedef enum {
0048   CURLHE_OK,
0049   CURLHE_BADINDEX,      /* header exists but not with this index */
0050   CURLHE_MISSING,       /* no such header exists */
0051   CURLHE_NOHEADERS,     /* no headers at all exist (yet) */
0052   CURLHE_NOREQUEST,     /* no request with this number was used */
0053   CURLHE_OUT_OF_MEMORY, /* out of memory while processing */
0054   CURLHE_BAD_ARGUMENT,  /* a function argument was not okay */
0055   CURLHE_NOT_BUILT_IN   /* if API was disabled in the build */
0056 } CURLHcode;
0057 
0058 CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,
0059                                        const char *name,
0060                                        size_t index,
0061                                        unsigned int origin,
0062                                        int request,
0063                                        struct curl_header **hout);
0064 
0065 CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
0066                                                      unsigned int origin,
0067                                                      int request,
0068                                                      struct curl_header *prev);
0069 
0070 #ifdef __cplusplus
0071 } /* end of extern "C" */
0072 #endif
0073 
0074 #endif /* CURLINC_HEADER_H */