From ae677edf9015ca75e1570e7018757b682f755d62 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 29 May 2011 03:56:26 +0200 Subject: main: fix header inclusion order --- src/main.c | 137 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 75 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index a6adf4412..ee02e944a 100644 --- a/src/main.c +++ b/src/main.c @@ -19,8 +19,14 @@ * KIND, either express or implied. * ***************************************************************************/ +#include + #include "setup.h" +/* +** system headers +*/ + #include #include #include @@ -36,92 +42,106 @@ # endif #endif -#include - -#include "urlglob.h" -#include "writeout.h" -#include "getpass.h" -#include "homedir.h" -#include "curlutil.h" -#ifdef USE_MANUAL -#include "hugehelp.h" -#endif -#ifdef USE_ENVIRONMENT -#include "writeenv.h" -#endif -#include "rawstr.h" - -#include "xattr.h" - -#define CURLseparator "--_curl_--" - #ifdef NETWARE -#ifdef __NOVELL_LIBC__ -#include -#else -#include -#define mkdir mkdir_510 -#endif +# ifdef __NOVELL_LIBC__ +# include +# else +# include +# define mkdir mkdir_510 +# endif #endif -#include "version.h" - -#ifdef HAVE_IO_H /* typical win32 habit */ -#include +#ifdef HAVE_IO_H +# include #endif #ifdef HAVE_UNISTD_H -#include +# include #endif #ifdef HAVE_FCNTL_H -#include +# include #endif #ifdef HAVE_UTIME_H -#include -#else -#ifdef HAVE_SYS_UTIME_H -#include +# include +#elif defined(HAVE_SYS_UTIME_H) +# include #endif -#endif /* HAVE_UTIME_H */ - #ifdef HAVE_LIMITS_H -#include +# include #endif #ifdef HAVE_SYS_POLL_H -#include +# include #elif defined(HAVE_POLL_H) -#include +# include #endif #ifdef HAVE_LOCALE_H -#include /* for setlocale() */ +# include #endif -#define ENABLE_CURLX_PRINTF -/* make the curlx header define all printf() functions to use the curlx_* - versions instead */ -#include "curlx.h" /* header from the libcurl directory */ +#ifdef HAVE_NETINET_IN_H +# include +#endif + +#ifdef HAVE_NETINET_TCP_H +# include +#endif #if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV) -#include +# include /* set default codesets for iconv */ -#ifndef CURL_ICONV_CODESET_OF_NETWORK -#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" -#endif +# ifndef CURL_ICONV_CODESET_OF_NETWORK +# define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1" +# endif #endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */ -#ifdef HAVE_NETINET_IN_H -#include /* for IPPROTO_TCP */ +#ifdef MSDOS +# include #endif -#ifdef HAVE_NETINET_TCP_H -#include /* for TCP_KEEPIDLE, TCP_KEEPINTVL */ + +#if defined(USE_WIN32_LARGE_FILES) || defined(USE_WIN32_SMALL_FILES) +# include +# include +# include #endif +#ifdef WIN32 +# include +#endif + +/* +** src subdirectory headers +*/ + +#include "urlglob.h" +#include "writeout.h" +#include "getpass.h" +#include "homedir.h" +#include "curlutil.h" #include "os-specific.h" +#include "version.h" +#include "xattr.h" +#ifdef USE_MANUAL +# include "hugehelp.h" +#endif +#ifdef USE_ENVIRONMENT +# include "writeenv.h" +#endif + +/* +** libcurl subdirectory headers +*/ + +#include "rawstr.h" + +#define ENABLE_CURLX_PRINTF +/* make the curlx header define all printf() functions to use the curlx_* + versions instead */ +#include "curlx.h" /* The last #include file should be: */ #ifdef CURLDEBUG @@ -189,8 +209,6 @@ static char *sanitize_dos_name(char *); #ifdef MSDOS #define USE_WATT32 -#include - #ifdef DJGPP /* we want to glob our own argv[] */ char **__crt0_glob_function (char *arg) @@ -213,6 +231,8 @@ char **__crt0_glob_function (char *arg) #define STDERR_FILENO fileno(stderr) #endif +#define CURLseparator "--_curl_--" + #define CURL_PROGRESS_STATS 0 /* default progress display */ #define CURL_PROGRESS_BAR 1 @@ -231,9 +251,6 @@ typedef enum { */ #ifdef USE_WIN32_LARGE_FILES -# include -# include -# include # define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence) # define fstat(fdes,stp) _fstati64(fdes, stp) # define stat(fname,stp) _stati64(fname, stp) @@ -246,9 +263,6 @@ typedef enum { */ #ifdef USE_WIN32_SMALL_FILES -# include -# include -# include # define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence) # define fstat(fdes,stp) _fstat(fdes, stp) # define stat(fname,stp) _stat(fname, stp) @@ -265,7 +279,6 @@ typedef enum { #endif #ifdef WIN32 -# include # define mkdir(x,y) (mkdir)(x) # undef PATH_MAX # define PATH_MAX MAX_PATH -- cgit v1.2.3