jpayne@69: #ifndef CURLINC_HEADER_H jpayne@69: #define CURLINC_HEADER_H jpayne@69: /*************************************************************************** jpayne@69: * _ _ ____ _ jpayne@69: * Project ___| | | | _ \| | jpayne@69: * / __| | | | |_) | | jpayne@69: * | (__| |_| | _ <| |___ jpayne@69: * \___|\___/|_| \_\_____| jpayne@69: * jpayne@69: * Copyright (C) 2018 - 2022, Daniel Stenberg, , et al. jpayne@69: * jpayne@69: * This software is licensed as described in the file COPYING, which jpayne@69: * you should have received as part of this distribution. The terms jpayne@69: * are also available at https://curl.se/docs/copyright.html. jpayne@69: * jpayne@69: * You may opt to use, copy, modify, merge, publish, distribute and/or sell jpayne@69: * copies of the Software, and permit persons to whom the Software is jpayne@69: * furnished to do so, under the terms of the COPYING file. jpayne@69: * jpayne@69: * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY jpayne@69: * KIND, either express or implied. jpayne@69: * jpayne@69: * SPDX-License-Identifier: curl jpayne@69: * jpayne@69: ***************************************************************************/ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: struct curl_header { jpayne@69: char *name; /* this might not use the same case */ jpayne@69: char *value; jpayne@69: size_t amount; /* number of headers using this name */ jpayne@69: size_t index; /* ... of this instance, 0 or higher */ jpayne@69: unsigned int origin; /* see bits below */ jpayne@69: void *anchor; /* handle privately used by libcurl */ jpayne@69: }; jpayne@69: jpayne@69: /* 'origin' bits */ jpayne@69: #define CURLH_HEADER (1<<0) /* plain server header */ jpayne@69: #define CURLH_TRAILER (1<<1) /* trailers */ jpayne@69: #define CURLH_CONNECT (1<<2) /* CONNECT headers */ jpayne@69: #define CURLH_1XX (1<<3) /* 1xx headers */ jpayne@69: #define CURLH_PSEUDO (1<<4) /* pseudo headers */ jpayne@69: jpayne@69: typedef enum { jpayne@69: CURLHE_OK, jpayne@69: CURLHE_BADINDEX, /* header exists but not with this index */ jpayne@69: CURLHE_MISSING, /* no such header exists */ jpayne@69: CURLHE_NOHEADERS, /* no headers at all exist (yet) */ jpayne@69: CURLHE_NOREQUEST, /* no request with this number was used */ jpayne@69: CURLHE_OUT_OF_MEMORY, /* out of memory while processing */ jpayne@69: CURLHE_BAD_ARGUMENT, /* a function argument was not okay */ jpayne@69: CURLHE_NOT_BUILT_IN /* if API was disabled in the build */ jpayne@69: } CURLHcode; jpayne@69: jpayne@69: CURL_EXTERN CURLHcode curl_easy_header(CURL *easy, jpayne@69: const char *name, jpayne@69: size_t index, jpayne@69: unsigned int origin, jpayne@69: int request, jpayne@69: struct curl_header **hout); jpayne@69: jpayne@69: CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy, jpayne@69: unsigned int origin, jpayne@69: int request, jpayne@69: struct curl_header *prev); jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } /* end of extern "C" */ jpayne@69: #endif jpayne@69: jpayne@69: #endif /* CURLINC_HEADER_H */