From f871de0064ee4bd3aee07c5b018f7a6438ec8910 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 28 Dec 2012 12:40:20 +0100 Subject: build: make use of 76 lib/*.h renamed files 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree. --- tests/server/CMakeLists.txt | 6 ++--- tests/server/Makefile.inc | 14 +++++------ tests/server/fake_ntlm.c | 4 +-- tests/server/getpart.c | 4 +-- tests/server/resolve.c | 6 ++--- tests/server/rtspd.c | 4 +-- tests/server/server_setup.h | 3 ++- tests/server/server_tftp.h | 61 +++++++++++++++++++++++++++++++++++++++++++++ tests/server/sockfilt.c | 6 ++--- tests/server/sws.c | 6 ++--- tests/server/testpart.c | 4 +-- tests/server/tftp.h | 61 --------------------------------------------- tests/server/tftpd.c | 6 ++--- tests/server/util.c | 2 +- 14 files changed, 94 insertions(+), 93 deletions(-) create mode 100644 tests/server/server_tftp.h delete mode 100644 tests/server/tftp.h (limited to 'tests/server') diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 0401df215..2e82c1133 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -5,8 +5,8 @@ function(SETUP_EXECUTABLE TEST_NAME) # ARGN are the files in the test string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME) include_directories( - ${CURL_SOURCE_DIR}/lib # To be able to reach "setup_once.h" - ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" + ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h" + ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h" ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h" ) if(CURL_USE_ARES) @@ -67,5 +67,5 @@ endforeach() # SETUP_EXECUTABLE(resolve resolve.c util.c util.h ${useful}) # SETUP_EXECUTABLE(sockfilt sockfilt.c util.c util.h ${useful} ${CURL_SOURCE_DIR}/lib/inet_pton.c) # SETUP_EXECUTABLE(getpart testpart.c ${useful}) -# SETUP_EXECUTABLE(tftpd tftpd.c util.c util.h ${useful} tftp.h) +# SETUP_EXECUTABLE(tftpd tftpd.c util.c util.h ${useful} server_tftp.h) diff --git a/tests/server/Makefile.inc b/tests/server/Makefile.inc index 4a12ea872..2dbbf2660 100644 --- a/tests/server/Makefile.inc +++ b/tests/server/Makefile.inc @@ -10,11 +10,11 @@ CURLX_SRCS = \ CURLX_HDRS = \ $(top_srcdir)/lib/curlx.h \ - $(top_srcdir)/lib/nonblock.h \ - $(top_srcdir)/lib/strequal.h \ - $(top_srcdir)/lib/strtoofft.h \ - $(top_srcdir)/lib/timeval.h \ - $(top_srcdir)/lib/warnless.h + $(top_srcdir)/lib/curl_nonblock.h \ + $(top_srcdir)/lib/curl_strequal.h \ + $(top_srcdir)/lib/curl_strtoofft.h \ + $(top_srcdir)/lib/curl_timeval.h \ + $(top_srcdir)/lib/curl_warnless.h USEFUL = \ getpart.c \ @@ -23,7 +23,7 @@ USEFUL = \ $(top_srcdir)/lib/base64.c \ $(top_srcdir)/lib/curl_base64.h \ $(top_srcdir)/lib/memdebug.c \ - $(top_srcdir)/lib/memdebug.h + $(top_srcdir)/lib/curl_memdebug.h UTIL = \ util.c \ @@ -62,7 +62,7 @@ sws_CFLAGS = $(AM_CFLAGS) tftpd_SOURCES = $(CURLX_SRCS) $(CURLX_HDRS) $(USEFUL) $(UTIL) \ server_sockaddr.h \ tftpd.c \ - tftp.h + server_tftp.h tftpd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ tftpd_CFLAGS = $(AM_CFLAGS) diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c index 64f0675e7..1c10e4812 100644 --- a/tests/server/fake_ntlm.c +++ b/tests/server/fake_ntlm.c @@ -34,8 +34,8 @@ #include "getpart.h" #include "util.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" #ifndef DEFAULT_LOGFILE #define DEFAULT_LOGFILE "log/fake_ntlm.log" diff --git a/tests/server/getpart.c b/tests/server/getpart.c index f37f88cba..56719f05b 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -36,8 +36,8 @@ struct SessionHandle { #include "curl_base64.h" #include "curl_memory.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" #define EAT_SPACE(p) while(*(p) && ISSPACE(*(p))) (p)++ diff --git a/tests/server/resolve.c b/tests/server/resolve.c index d0609888a..a094b4d70 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -51,8 +51,8 @@ #include "curlx.h" /* from the private lib dir */ #include "util.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" static bool use_ipv6 = FALSE; static const char *ipv_inuse = "IPv4"; @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; /* Use parenthesis around function to stop it from being replaced by - the macro in memdebug.h */ + the macro in curl_memdebug.h */ rc = (getaddrinfo)(host, "80", &hints, &ai); } diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 3c55eff35..65f84e6e1 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -51,8 +51,8 @@ #include "util.h" #include "server_sockaddr.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; diff --git a/tests/server/server_setup.h b/tests/server/server_setup.h index 193ad84d7..d3efc93eb 100644 --- a/tests/server/server_setup.h +++ b/tests/server/server_setup.h @@ -24,6 +24,7 @@ #define CURL_NO_OLDIES -#include "setup.h" /* portability help from the lib directory */ +#include "curl_setup.h" /* portability help from the lib directory */ #endif /* HEADER_CURL_SERVER_SETUP_H */ + diff --git a/tests/server/server_tftp.h b/tests/server/server_tftp.h new file mode 100644 index 000000000..0650efe6a --- /dev/null +++ b/tests/server/server_tftp.h @@ -0,0 +1,61 @@ +#ifndef HEADER_CURL_SERVER_TFTP_H +#define HEADER_CURL_SERVER_TFTP_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * 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. + * + ***************************************************************************/ +#include "server_setup.h" + +/* This file is a rewrite/clone of the arpa/tftp.h file for systems without + it. */ + +#define SEGSIZE 512 /* data segment size */ + +#if defined(__GNUC__) && ((__GNUC__ >= 3) || \ + ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) +# define PACKED_STRUCT __attribute__((__packed__)) +#else +# define PACKED_STRUCT /*NOTHING*/ +#endif + +/* Using a packed struct as binary in a program is begging for problems, but + the tftpd server was written like this so we have this struct here to make + things build. */ + +struct tftphdr { + short th_opcode; /* packet type */ + unsigned short th_block; /* all sorts of things */ + char th_data[1]; /* data or error string */ +} PACKED_STRUCT; + +#define th_stuff th_block +#define th_code th_block +#define th_msg th_data + +#define EUNDEF 0 +#define ENOTFOUND 1 +#define EACCESS 2 +#define ENOSPACE 3 +#define EBADOP 4 +#define EBADID 5 +#define EEXISTS 6 +#define ENOUSER 7 + +#endif /* HEADER_CURL_SERVER_TFTP_H */ diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 93d0b5d14..394449ca9 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -98,12 +98,12 @@ versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" -#include "inet_pton.h" +#include "curl_inet_pton.h" #include "util.h" #include "server_sockaddr.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" #define DEFAULT_PORT 8999 diff --git a/tests/server/sws.c b/tests/server/sws.c index 44d899fd7..3afbe3e83 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -49,12 +49,12 @@ versions instead */ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" -#include "inet_pton.h" +#include "curl_inet_pton.h" #include "util.h" #include "server_sockaddr.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" #ifdef ENABLE_IPV6 static bool use_ipv6 = FALSE; diff --git a/tests/server/testpart.c b/tests/server/testpart.c index 912096f0b..255bbe8d3 100644 --- a/tests/server/testpart.c +++ b/tests/server/testpart.c @@ -26,8 +26,8 @@ #define _MPRINTF_REPLACE /* use our functions only */ #include -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" int main(int argc, char **argv) { diff --git a/tests/server/tftp.h b/tests/server/tftp.h deleted file mode 100644 index 0650efe6a..000000000 --- a/tests/server/tftp.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef HEADER_CURL_SERVER_TFTP_H -#define HEADER_CURL_SERVER_TFTP_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * 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. - * - ***************************************************************************/ -#include "server_setup.h" - -/* This file is a rewrite/clone of the arpa/tftp.h file for systems without - it. */ - -#define SEGSIZE 512 /* data segment size */ - -#if defined(__GNUC__) && ((__GNUC__ >= 3) || \ - ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) -# define PACKED_STRUCT __attribute__((__packed__)) -#else -# define PACKED_STRUCT /*NOTHING*/ -#endif - -/* Using a packed struct as binary in a program is begging for problems, but - the tftpd server was written like this so we have this struct here to make - things build. */ - -struct tftphdr { - short th_opcode; /* packet type */ - unsigned short th_block; /* all sorts of things */ - char th_data[1]; /* data or error string */ -} PACKED_STRUCT; - -#define th_stuff th_block -#define th_code th_block -#define th_msg th_data - -#define EUNDEF 0 -#define ENOTFOUND 1 -#define EACCESS 2 -#define ENOSPACE 3 -#define EBADOP 4 -#define EBADID 5 -#define EEXISTS 6 -#define ENOUSER 7 - -#endif /* HEADER_CURL_SERVER_TFTP_H */ diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index e8c3c2d82..c1033a5c0 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -67,7 +67,7 @@ #ifdef HAVE_ARPA_TFTP_H #include #else -#include "tftp.h" +#include "server_tftp.h" #endif #ifdef HAVE_NETDB_H #include @@ -91,8 +91,8 @@ #include "util.h" #include "server_sockaddr.h" -/* include memdebug.h last */ -#include "memdebug.h" +/* include curl_memdebug.h last */ +#include "curl_memdebug.h" /***************************************************************************** * STRUCT DECLARATIONS AND DEFINES * diff --git a/tests/server/util.c b/tests/server/util.c index 30766d80f..ef3c8f6a3 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -46,7 +46,7 @@ #include "curlx.h" /* from the private lib dir */ #include "getpart.h" #include "util.h" -#include "timeval.h" +#include "curl_timeval.h" #if defined(ENABLE_IPV6) && defined(__MINGW32__) const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; -- cgit v1.2.3