build: drop explicit curlx from hdr paths, refer headers with curlx/ prefix

To make all src and test code refer to curlx headers the same way.

Also:
- src: move `curlx.h` include to `tool_setup.h`.
- src/tool_setup.h: drop stray `curlx/timeval.h`.
- servers: de-duplicate `curlx.h` and `curl_setup.h` includes.
- libtests, units: drop stray curlx sub-headers in favor of
  `<curlx/curlx.h>`.
- tests: include `curlx.h` with `<>` instead of `""`. To match
  other parts of the codebase.

Closes #17680
This commit is contained in:
Viktor Szakats 2025-06-20 09:20:45 +02:00
parent 63011ac638
commit 1a70977a83
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
64 changed files with 26 additions and 90 deletions

View file

@ -80,8 +80,7 @@ endif()
set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx functions
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${CMAKE_CURRENT_SOURCE_DIR}" # for "tool_hugehelp.c"
)

View file

@ -45,7 +45,6 @@ EXTRA_DIST = mk-file-embed.pl mkhelp.pl \
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(srcdir)
bin_PROGRAMS = curl

View file

@ -28,7 +28,6 @@
#endif
#include "terminal.h"
#include <curlx.h>
#include <memdebug.h> /* keep this as LAST include */
#ifdef HAVE_TERMIOS_H

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include "tool_cb_dbg.h"

View file

@ -27,8 +27,6 @@
#include <unistd.h>
#endif
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_doswin.h"
#include "tool_msgs.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_cb_prg.h"
#include "tool_util.h"

View file

@ -27,8 +27,6 @@
#include <sys/select.h>
#endif
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_cb_rea.h"
#include "tool_operate.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_operate.h"
#include "tool_cb_see.h"

View file

@ -30,8 +30,6 @@
#include <sys/stat.h>
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include "tool_cb_wrt.h"

View file

@ -27,7 +27,6 @@
#include "tool_formparse.h"
#include "tool_paramhlp.h"
#include "tool_main.h"
#include <curlx.h>
#include <memdebug.h> /* keep this as LAST include */
void config_init(struct OperationConfig *config)

View file

@ -29,8 +29,6 @@
# include <direct.h>
#endif
#include <curlx.h>
#include "tool_dirhie.h"
#include "tool_msgs.h"

View file

@ -40,7 +40,6 @@
#include "tool_doswin.h"
#include "tool_msgs.h"
#include <curlx.h>
#include <memdebug.h> /* keep this as LAST include */
#ifdef _WIN32

View file

@ -27,8 +27,6 @@
#ifndef CURL_DISABLE_LIBCURL_OPTION
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_easysrc.h"
#include "tool_msgs.h"

View file

@ -24,7 +24,6 @@
#include "tool_filetime.h"
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include <curlx.h>
#ifdef HAVE_UTIME_H
# include <utime.h>

View file

@ -36,8 +36,6 @@
#include <fcntl.h>
#endif
#include <curlx.h>
#include "tool_findfile.h"
#include "tool_cfgable.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include "tool_getparam.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_cb_prg.h"
#include "tool_filetime.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_help.h"
#include "tool_libinfo.h"
#include "tool_util.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include "tool_getparam.h"

View file

@ -24,7 +24,6 @@
#include "tool_setup.h"
#ifndef CURL_DISABLE_IPFS
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_libinfo.h"
#include <memdebug.h> /* keep this as LAST include */

View file

@ -37,8 +37,6 @@
#include <fcntl.h>
#endif
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_doswin.h"
#include "tool_msgs.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_msgs.h"
#include "tool_cb_prg.h"

View file

@ -54,8 +54,6 @@
#include <uv.h>
#endif
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_cb_dbg.h"
#include "tool_cb_hdr.h"

View file

@ -24,7 +24,6 @@
#include "tool_setup.h"
#include "tool_operate.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_doswin.h"
#include "tool_operhlp.h"

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_getparam.h"
#include "tool_getpass.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_getparam.h"
#include "tool_helpers.h"

View file

@ -25,7 +25,6 @@
#include "tool_operate.h"
#include "tool_progress.h"
#include "tool_util.h"
#include <curlx.h>
/* The point of this function would be to return a string of the input data,
but never longer than 5 columns (+ one zero byte).

View file

@ -25,7 +25,6 @@
#ifndef CURL_DISABLE_LIBCURL_OPTION
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_easysrc.h"
#include "tool_setopt.h"

View file

@ -47,7 +47,7 @@ extern FILE *tool_stderr;
#include <curl/curl.h> /* external interface */
#include "timeval.h"
#include <curlx/curlx.h>
/*
* Platform specific stuff.

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_cb_dbg.h"
#include "tool_msgs.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_doswin.h"
#include "tool_urlglob.h"

View file

@ -24,7 +24,6 @@
#include "tool_setup.h"
#include "tool_util.h"
#include <curlx.h>
#include <memdebug.h> /* keep this as LAST include */
#ifdef _WIN32

View file

@ -30,7 +30,6 @@
#include <unixlib.h>
#endif
#include <curlx.h>
#include "curlmsg_vms.h"
#include "tool_vms.h"
#include <memdebug.h> /* keep this as LAST include */

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_writeout.h"
#include "tool_writeout_json.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_writeout_json.h"
#include "tool_writeout.h"

View file

@ -23,7 +23,6 @@
***************************************************************************/
#include "tool_setup.h"
#include <curlx.h>
#include "tool_cfgable.h"
#include "tool_getparam.h"
#include "tool_helpers.h"

View file

@ -25,7 +25,6 @@
***************************************************************************/
#include "tool_getparam.h"
#include <curlx.h>
struct tool_var {
struct tool_var *next;

View file

@ -43,8 +43,7 @@ add_dependencies(testdeps ${BUNDLE})
target_link_libraries(${BUNDLE} ${LIB_SELECTED} ${CURL_LIBS})
target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
)
set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES")

View file

@ -36,7 +36,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(srcdir)
# Get BUNDLE, FIRSTFILES, CURLX_CFILES, TESTFILES variables

View file

@ -36,7 +36,7 @@ extern const struct entry_s s_entries[];
#include <curl/curl.h>
#include "curlx.h"
#include <curlx/curlx.h>
#define ERR() \
do { \

View file

@ -52,8 +52,7 @@ add_dependencies(testdeps ${BUNDLE})
target_link_libraries(${BUNDLE} ${LIB_SELECTED} ${CURL_LIBS})
target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
"${PROJECT_SOURCE_DIR}/tests/unit" # for "curlcheck.h"
)

View file

@ -36,7 +36,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(srcdir) \
-I$(top_srcdir)/tests/unit

View file

@ -34,6 +34,6 @@ struct entry_s {
extern const struct entry_s s_entries[];
#include "curlx.h"
#include <curlx/curlx.h>
#endif /* HEADER_LIBTEST_FIRST_H */

View file

@ -39,8 +39,7 @@ add_dependencies(testdeps ${BUNDLE})
target_link_libraries(${BUNDLE} ${CURL_LIBS})
target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
)
set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "WITHOUT_LIBCURL")

View file

@ -36,7 +36,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(srcdir)
# Get BUNDLE, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES variables

View file

@ -50,7 +50,7 @@ extern const struct entry_s s_entries[];
#include <netdb.h>
#endif
#include <curlx.h> /* from the private lib dir */
#include <curlx/curlx.h>
/* adjust for old MSVC */
#if defined(_MSC_VER) && (_MSC_VER < 1900)

View file

@ -85,9 +85,8 @@
* it!
*/
/* buffer is this excessively large only to be able to support things like
test 1003 which tests exceedingly large server response lines */
test 1003 which tests exceedingly large server response lines */
#define BUFFER_SIZE 17010
static bool verbose = FALSE;

View file

@ -39,8 +39,7 @@ add_dependencies(testdeps ${BUNDLE})
target_link_libraries(${BUNDLE} curltool curlu)
target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${PROJECT_SOURCE_DIR}/src" # for tool headers
"${PROJECT_SOURCE_DIR}/tests/libtest" # for "first.h"
"${PROJECT_SOURCE_DIR}/tests/unit" # for "curlcheck.h"

View file

@ -36,7 +36,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(top_srcdir)/src \
-I$(top_srcdir)/tests/libtest \
-I$(top_srcdir)/tests/unit \

View file

@ -39,8 +39,7 @@ add_dependencies(testdeps ${BUNDLE})
target_link_libraries(${BUNDLE} curlu)
target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx
"${PROJECT_SOURCE_DIR}/tests/libtest" # for "first.h"
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
)

View file

@ -36,7 +36,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib/curlx \
-I$(top_srcdir)/tests/libtest \
-I$(srcdir)

View file

@ -25,7 +25,7 @@
#include "urldata.h"
#include "url.h" /* for Curl_safefree */
#include "curlx/base64.h"
#include <curlx/base64.h>
#include "memdebug.h" /* LAST include file */
static CURLcode test_unit1302(char *arg)

View file

@ -33,8 +33,6 @@
#include <arpa/inet.h>
#endif
#include <curlx.h>
#include "hash.h"
#include "hostip.h"

View file

@ -23,7 +23,7 @@
***************************************************************************/
#include "curlcheck.h"
#include "timeval.h"
#include <curlx/timeval.h>
static CURLcode test_unit1323(char *arg)
{

View file

@ -23,8 +23,6 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx.h>
#include "hash.h"
#include <memdebug.h> /* LAST include file */

View file

@ -23,8 +23,8 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx.h>
#include "hash.h"
#include <memdebug.h> /* LAST include file */
static const size_t slots = 3;

View file

@ -23,8 +23,8 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx.h>
#include <uint-hash.h>
#include "uint-hash.h"
#include <memdebug.h> /* LAST include file */
static void t1616_mydtor(unsigned int id, void *elem)

View file

@ -23,8 +23,9 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx/dynbuf.h>
#include "doh.h"
#include "dynbuf.h"
static CURLcode test_unit1650(char *arg)
{

View file

@ -30,7 +30,7 @@
#include <netinet/in6.h>
#endif
#include "curlx/strparse.h"
#include <curlx/strparse.h>
#include "memdebug.h" /* LAST include file */

View file

@ -23,8 +23,9 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx/dynbuf.h>
#include "http_aws_sigv4.h"
#include "dynbuf.h"
static CURLcode test_unit1979(char *arg)
{

View file

@ -23,8 +23,9 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx/dynbuf.h>
#include "http_aws_sigv4.h"
#include "dynbuf.h"
static CURLcode test_unit1980(char *arg)
{

View file

@ -23,7 +23,7 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx.h>
#include <curlx/curlx.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>

View file

@ -23,8 +23,9 @@
***************************************************************************/
#include "curlcheck.h"
#include <curlx/dynbuf.h>
#include "urldata.h"
#include "dynbuf.h"
#include "dynhds.h"
#include "curl_trc.h"