#ifndef CURLINC_HEADER_H1#define CURLINC_HEADER_H2/***************************************************************************3* _ _ ____ _4* Project ___| | | | _ \| |5* / __| | | | |_) | |6* | (__| |_| | _ <| |___7* \___|\___/|_| \_\_____|8*9* Copyright (C) Daniel Stenberg, <[email protected]>, et al.10*11* This software is licensed as described in the file COPYING, which12* you should have received as part of this distribution. The terms13* are also available at https://curl.se/docs/copyright.html.14*15* You may opt to use, copy, modify, merge, publish, distribute and/or sell16* copies of the Software, and permit persons to whom the Software is17* furnished to do so, under the terms of the COPYING file.18*19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY20* KIND, either express or implied.21*22* SPDX-License-Identifier: curl23*24***************************************************************************/2526#ifdef __cplusplus27extern "C" {28#endif2930struct curl_header {31char *name; /* this might not use the same case */32char *value;33size_t amount; /* number of headers using this name */34size_t index; /* ... of this instance, 0 or higher */35unsigned int origin; /* see bits below */36void *anchor; /* handle privately used by libcurl */37};3839/* 'origin' bits */40#define CURLH_HEADER (1<<0) /* plain server header */41#define CURLH_TRAILER (1<<1) /* trailers */42#define CURLH_CONNECT (1<<2) /* CONNECT headers */43#define CURLH_1XX (1<<3) /* 1xx headers */44#define CURLH_PSEUDO (1<<4) /* pseudo headers */4546typedef enum {47CURLHE_OK,48CURLHE_BADINDEX, /* header exists but not with this index */49CURLHE_MISSING, /* no such header exists */50CURLHE_NOHEADERS, /* no headers at all exist (yet) */51CURLHE_NOREQUEST, /* no request with this number was used */52CURLHE_OUT_OF_MEMORY, /* out of memory while processing */53CURLHE_BAD_ARGUMENT, /* a function argument was not okay */54CURLHE_NOT_BUILT_IN /* if API was disabled in the build */55} CURLHcode;5657CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,58const char *name,59size_t index,60unsigned int origin,61int request,62struct curl_header **hout);6364CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,65unsigned int origin,66int request,67struct curl_header *prev);6869#ifdef __cplusplus70} /* end of extern "C" */71#endif7273#endif /* CURLINC_HEADER_H */747576