syslog-ng source
curl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Attila Szakacs
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef COMPAT_CURL_H_INCLUDED
25 #define COMPAT_CURL_H_INCLUDED
26 
27 #include "compat/compat.h"
28 #include <curl/curl.h>
29 
30 #ifndef CURL_VERSION_BITS
31 #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
32 #endif
33 
34 #ifndef CURL_AT_LEAST_VERSION
35 #define CURL_AT_LEAST_VERSION(x,y,z) \
36  (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
37 #endif
38 
39 #if ! SYSLOG_NG_HAVE_DECL_CURLUE_LAST
40 #define CURLUE_LAST (64)
41 #endif
42 
43 #define SYSLOG_NG_CURL_FULLY_SUPPORTS_URL_PARSING \
44  ( \
45  SYSLOG_NG_HAVE_DECL_CURL_URL && \
46  SYSLOG_NG_HAVE_DECL_CURLU_ALLOW_SPACE && \
47  SYSLOG_NG_HAVE_DECL_CURLUE_BAD_SCHEME && \
48  SYSLOG_NG_HAVE_DECL_CURLUE_BAD_HOSTNAME && \
49  SYSLOG_NG_HAVE_DECL_CURLUE_BAD_PORT_NUMBER && \
50  SYSLOG_NG_HAVE_DECL_CURLUE_BAD_USER && \
51  SYSLOG_NG_HAVE_DECL_CURLUE_BAD_PASSWORD && \
52  SYSLOG_NG_HAVE_DECL_CURLUE_MALFORMED_INPUT && \
53  SYSLOG_NG_HAVE_DECL_CURLUPART_SCHEME && \
54  SYSLOG_NG_HAVE_DECL_CURLUPART_HOST && \
55  SYSLOG_NG_HAVE_DECL_CURLUPART_PORT && \
56  SYSLOG_NG_HAVE_DECL_CURLUPART_USER && \
57  SYSLOG_NG_HAVE_DECL_CURLUPART_PASSWORD && \
58  SYSLOG_NG_HAVE_DECL_CURLUPART_URL \
59  )
60 
61 #endif