2015-04-27 22:25:09 +02:00
|
|
|
#ifndef HEADER_CURL_CONTENT_ENCODING_H
|
|
|
|
#define HEADER_CURL_CONTENT_ENCODING_H
|
2008-10-12 18:41:06 +02:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2023-07-02 19:51:09 +02:00
|
|
|
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2008-10-12 18:41:06 +02:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2021-09-14 00:13:48 +02:00
|
|
|
* are also available at https://curl.se/docs/copyright.html.
|
2008-10-12 18:41:06 +02:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
2022-11-16 20:14:03 +01:00
|
|
|
* SPDX-License-Identifier: curl
|
|
|
|
*
|
2008-10-12 18:41:06 +02:00
|
|
|
***************************************************************************/
|
2015-04-27 22:25:09 +02:00
|
|
|
#include "curl_setup.h"
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
struct contenc_writer {
|
|
|
|
const struct content_encoding *handler; /* Encoding handler. */
|
|
|
|
struct contenc_writer *downstream; /* Downstream writer. */
|
2023-07-02 19:51:09 +02:00
|
|
|
unsigned int order; /* Ordering within writer stack. */
|
2018-04-23 21:13:27 +02:00
|
|
|
};
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2018-04-23 21:13:27 +02:00
|
|
|
/* Content encoding writer. */
|
2020-08-30 11:54:41 +02:00
|
|
|
struct content_encoding {
|
2018-04-23 21:13:27 +02:00
|
|
|
const char *name; /* Encoding name. */
|
|
|
|
const char *alias; /* Encoding name alias. */
|
2021-09-14 00:13:48 +02:00
|
|
|
CURLcode (*init_writer)(struct Curl_easy *data,
|
2020-08-30 11:54:41 +02:00
|
|
|
struct contenc_writer *writer);
|
2021-09-14 00:13:48 +02:00
|
|
|
CURLcode (*unencode_write)(struct Curl_easy *data,
|
2020-08-30 11:54:41 +02:00
|
|
|
struct contenc_writer *writer,
|
2018-04-23 21:13:27 +02:00
|
|
|
const char *buf, size_t nbytes);
|
2021-09-14 00:13:48 +02:00
|
|
|
void (*close_writer)(struct Curl_easy *data,
|
2020-08-30 11:54:41 +02:00
|
|
|
struct contenc_writer *writer);
|
2022-11-16 20:14:03 +01:00
|
|
|
size_t writersize;
|
2018-04-23 21:13:27 +02:00
|
|
|
};
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2015-04-27 22:25:09 +02:00
|
|
|
|
2021-09-14 00:13:48 +02:00
|
|
|
CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
|
2023-07-02 19:51:09 +02:00
|
|
|
const char *enclist, int is_transfer);
|
2021-09-14 00:13:48 +02:00
|
|
|
CURLcode Curl_unencode_write(struct Curl_easy *data,
|
2020-08-30 11:54:41 +02:00
|
|
|
struct contenc_writer *writer,
|
2018-04-23 21:13:27 +02:00
|
|
|
const char *buf, size_t nbytes);
|
2021-09-14 00:13:48 +02:00
|
|
|
void Curl_unencode_cleanup(struct Curl_easy *data);
|
2018-04-23 21:13:27 +02:00
|
|
|
char *Curl_all_content_encodings(void);
|
2015-04-27 22:25:09 +02:00
|
|
|
|
|
|
|
#endif /* HEADER_CURL_CONTENT_ENCODING_H */
|