From 913e1570bd45f11be03b2301dc566693036ab2a5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 30 Apr 2004 08:22:38 +0000 Subject: New header file that offers easy access to the curlx_ functions for an app. curlx_ functions are NOT part of the offical API, but only available as source code functions from the lib directory in case of need. --- lib/curlx.h | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 lib/curlx.h (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h new file mode 100644 index 000000000..f9da6a8dd --- /dev/null +++ b/lib/curlx.h @@ -0,0 +1,95 @@ +#ifndef __CURLX_H +#define __CURLX_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2004, 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. + * + * $Id$ + ***************************************************************************/ + +/* + * Defines protos and includes all header files that provide the curlx_* + * functions. The curlx_* functions are not part of the libcurl API, but are + * stand-alone functions whose sources can be built and linked by apps if need + * be. + */ + +#include +/* this is still a public header file that provides the curl_mprintf() + functions while they still are offered publicly. They will be made library- + private one day */ + +#include "strequal.h" +/* "strequal.h" provides the strequal protos */ + +#include "strtoofft.h" +/* "strtoofft.h" provides this function: curlx_strtoofft(), returns a + curl_off_t number from a given string. +*/ + +#include "timeval.h" +/* + "timeval.h" sets up a 'struct timeval' even for platforms that otherwise + don't have one and has protos for these functions: + + curlx_tvnow() + curlx_tvdiff() + curlx_tvdiff_secs() +*/ + +/* Now setup curlx_ * names for the functions that are to become curlx_ and + be removed from a future libcurl official API: + curlx_getenv + curlx_mprintf (and its variations) + curlx_strequal + curlx_strnequal + +*/ + +#define curlx_getenv curl_getenv +#define curlx_strequal curl_strequal +#define curlx_strnequal curl_strnequal +#define curlx_mvsnprintf curl_mvsnprintf +#define curlx_msnprintf curl_msnprintf +#define curlx_maprintf curl_maprintf +#define curlx_mvaprintf curl_mvaprintf +#define curlx_msprintf curl_msprintf +#define curlx_mprintf curl_mprintf +#define curlx_mfprintf curl_mfprintf +#define curlx_mvsprintf curl_mvsprintf +#define curlx_mvprintf curl_mvprintf +#define curlx_mvfprintf curl_mvfprintf + +#ifdef ENABLE_CURLX_PRINTF +/* If this define is set, we define all "standard" printf() functions to use + the curlx_* version instead. It makes the source code transparant and + easier to understand/patch. */ +# define printf curlx_mprintf +# define fprintf curlx_mfprintf +# define sprintf curlx_msprintf +# define snprintf curlx_msnprintf +# define vprintf curlx_mvprintf +# define vfprintf curlx_mvfprintf +# define vsprintf curlx_mvsprintf +# define vsnprintf curlx_mvsnprintf +# define aprintf curlx_maprintf +# define vaprintf curlx_mvaprintf +#endif /* ENABLE_CURLX_PRINTF */ + +#endif /* __CURLX_H */ -- cgit v1.2.1 From 5d8b526b80b40a87eee3303a5e8c69eaa957629d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 24 May 2004 11:57:34 +0000 Subject: delete trailing whitespace --- lib/curlx.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index f9da6a8dd..0dd9a0948 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -1,10 +1,10 @@ #ifndef __CURLX_H #define __CURLX_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. @@ -12,7 +12,7 @@ * 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. -- cgit v1.2.1 From 2ddb9d57aab0c46e8e33b4954b5be881a9e41c6b Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Thu, 6 Jul 2006 13:57:26 +0000 Subject: Undefine symbols before redefining them. --- lib/curlx.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 0dd9a0948..ffc860fc9 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -79,7 +79,19 @@ #ifdef ENABLE_CURLX_PRINTF /* If this define is set, we define all "standard" printf() functions to use the curlx_* version instead. It makes the source code transparant and - easier to understand/patch. */ + easier to understand/patch. Undefine them first in case _MPRINTF_REPLACE + is set. */ +# undef printf +# undef fprintf +# undef sprintf +# undef snprintf +# undef vprintf +# undef vfprintf +# undef vsprintf +# undef vsnprintf +# undef aprintf +# undef vaprintf + # define printf curlx_mprintf # define fprintf curlx_mfprintf # define sprintf curlx_msprintf -- cgit v1.2.1 From 772a985dc3318214443ddd2ad6541d520f089368 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 27 Oct 2006 03:47:57 +0000 Subject: Update copyright year, since the file has been modified --- lib/curlx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index ffc860fc9..26948d305 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, 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 -- cgit v1.2.1 From a579d6706436615845f57692921e0891fb6e3719 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 15 Oct 2008 21:43:48 +0000 Subject: - Pascal Terjan filed bug #2154627 (http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl uses strcasecmp() in multiple places where it causes failures when the Turkish locale is used. This is because 'i' and 'I' isn't the same letter so strcasecmp() on those letters are different in Turkish than in English (or just about all other languages). I thus introduced a totally new internal function in libcurl (called Curl_ascii_equal) for doing case insentive comparisons for english-(ascii?) style strings that thus will make "file" and "FILE" match even if the Turkish locale is selected. --- lib/curlx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 26948d305..94f277f10 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2008, 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 @@ -65,6 +65,7 @@ #define curlx_getenv curl_getenv #define curlx_strequal curl_strequal #define curlx_strnequal curl_strnequal +#define curlx_ascii_equal Curl_ascii_equal #define curlx_mvsnprintf curl_mvsnprintf #define curlx_msnprintf curl_msnprintf #define curlx_maprintf curl_maprintf -- cgit v1.2.1 From 9d16b4081ed011c11f9876ae2685076e92113593 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Oct 2008 08:23:48 +0000 Subject: Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper function used in strequal.c so now all test cases run fine for me again. --- lib/curlx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 94f277f10..9558845e9 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -65,7 +65,7 @@ #define curlx_getenv curl_getenv #define curlx_strequal curl_strequal #define curlx_strnequal curl_strnequal -#define curlx_ascii_equal Curl_ascii_equal +#define curlx_raw_equal Curl_raw_equal #define curlx_mvsnprintf curl_mvsnprintf #define curlx_msnprintf curl_msnprintf #define curlx_maprintf curl_maprintf -- cgit v1.2.1 From d709cb2ae37c9d9512fe3a9724dd95b0fe49d108 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 9 Jul 2009 21:47:24 +0000 Subject: - Eric Wong introduced curlx_nonblock() that the curl tool now (re-)uses for setting a file descriptor non-blocking. Used by the functionality Eric himself brough on June 15th. --- lib/curlx.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 9558845e9..1e03a05fc 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -53,6 +53,9 @@ curlx_tvdiff_secs() */ +#include "nonblock.h" +/* "nonblock.h" provides curlx_nonblock() */ + /* Now setup curlx_ * names for the functions that are to become curlx_ and be removed from a future libcurl official API: curlx_getenv -- cgit v1.2.1 From 439f62bfa8fff1b6370c286f4e06775aa81661bc Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 22 Feb 2010 18:56:29 +0000 Subject: convert Curl_ultous() and Curl_ultouc() functions to curlx_ultous() and curlx_ultouc(), exposing them through curlx.h to allow proper code reuse later in our test harness. --- lib/curlx.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 1e03a05fc..1f84e6d0a 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -56,6 +56,13 @@ #include "nonblock.h" /* "nonblock.h" provides curlx_nonblock() */ +#include "warnless.h" +/* "warnless.h" provides functions: + + curlx_ultous() + curlx_ultouc() +*/ + /* Now setup curlx_ * names for the functions that are to become curlx_ and be removed from a future libcurl official API: curlx_getenv -- cgit v1.2.1 From bcd1c7c2e92d41ab02163a36a1ab9d5a7afd83a9 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 26 Feb 2010 16:42:33 +0000 Subject: fix compiler warning --- lib/curlx.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 1f84e6d0a..d5de599f5 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -61,6 +61,7 @@ curlx_ultous() curlx_ultouc() + curlx_uztosi() */ /* Now setup curlx_ * names for the functions that are to become curlx_ and -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/curlx.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index d5de599f5..2b7fec58a 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ /* -- cgit v1.2.1 From f37d681166053a25af9e1427ffe87c5ed67f0ab3 Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Sun, 19 Dec 2010 10:22:44 +1100 Subject: Typo fixes. --- lib/curlx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/curlx.h') diff --git a/lib/curlx.h b/lib/curlx.h index 2b7fec58a..a1df66902 100644 --- a/lib/curlx.h +++ b/lib/curlx.h @@ -89,7 +89,7 @@ #ifdef ENABLE_CURLX_PRINTF /* If this define is set, we define all "standard" printf() functions to use - the curlx_* version instead. It makes the source code transparant and + the curlx_* version instead. It makes the source code transparent and easier to understand/patch. Undefine them first in case _MPRINTF_REPLACE is set. */ # undef printf -- cgit v1.2.1