From f6433211ae9afb30ec461e6633dafc6d8c77eaa9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 11 Sep 2004 09:24:02 +0000 Subject: getdate replacement code. smaller, slicker, faster. --- lib/parsedate.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/parsedate.h (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h new file mode 100644 index 000000000..da33c45d7 --- /dev/null +++ b/lib/parsedate.h @@ -0,0 +1,28 @@ +#ifndef __PARSEDATE_H +#define __PARSEDATE_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$ + ***************************************************************************/ + +time_t Curl_parsedate(const char *date); + +#endif -- cgit v1.2.1 From 33f69c0546ac56f616d98c2a43170a67d8840f4c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 13 Sep 2004 20:48:24 +0000 Subject: removed this file again, we only provide a single public function and that is already in the public header file --- lib/parsedate.h | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 lib/parsedate.h (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h deleted file mode 100644 index da33c45d7..000000000 --- a/lib/parsedate.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __PARSEDATE_H -#define __PARSEDATE_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$ - ***************************************************************************/ - -time_t Curl_parsedate(const char *date); - -#endif -- cgit v1.2.1 From e7cefd684b2d5e1f3710eb24babc0b9974095c97 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 Feb 2005 00:03:49 +0000 Subject: Removed all uses of strftime() since it uses the localised version of the week day names and month names and servers don't like that. --- lib/parsedate.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/parsedate.h (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h new file mode 100644 index 000000000..4738117a2 --- /dev/null +++ b/lib/parsedate.h @@ -0,0 +1,28 @@ +#ifndef __PARSEDATE_H +#define __PARSEDATEL_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$ + ***************************************************************************/ +extern const char * const Curl_wkday[7]; +extern const char * const Curl_month[12]; + +#endif -- cgit v1.2.1 From ab4086bc244bf3267976e9f0193e5ed4430190d8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 31 Mar 2005 07:02:02 +0000 Subject: Updated the copyright year since changes have been this year. --- lib/parsedate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index 4738117a2..0ea2d83c3 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, 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 da6fa34f021c5dfd3d0ecc9de6950497dc1a737a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 11 Jul 2008 18:59:00 +0000 Subject: fix multiple header inclusion prevention definition --- lib/parsedate.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index 0ea2d83c3..3e502b9bc 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -1,5 +1,5 @@ -#ifndef __PARSEDATE_H -#define __PARSEDATEL_H +#ifndef __CURL_PARSEDATE_H +#define __CURL_PARSEDATE_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, 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 @@ -22,6 +22,7 @@ * * $Id$ ***************************************************************************/ + extern const char * const Curl_wkday[7]; extern const char * const Curl_month[12]; -- cgit v1.2.1 From 777168cb778b6626ec9a2325e85acc3e17b5cde9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 3 Sep 2009 08:13:32 +0000 Subject: provide and export Curl_parsedate() as a library-wide internal function for a better API to date parsing than the external API is --- lib/parsedate.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index 3e502b9bc..af59bae7f 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -26,4 +26,22 @@ extern const char * const Curl_wkday[7]; extern const char * const Curl_month[12]; +/* + * Curl_parsedate() + * + * Returns: + * + * PARSEDATE_OK - a fine conversion + * PARSEDATE_FAIL - failed to convert + * PARSEDATE_LATER - time overflow at the far end of time_t + * PARSEDATE_SOONER - time underflow at the low end of time_t + */ + +int Curl_parsedate(const char *date, time_t *output); + +#define PARSEDATE_OK 0 +#define PARSEDATE_FAIL -1 +#define PARSEDATE_LATER 1 +#define PARSEDATE_SOONER 2 + #endif -- cgit v1.2.1 From 183c9ce1cfde10c860dc5cb1a3cb25a56038625f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 3 Sep 2009 08:30:28 +0000 Subject: fix copyright year --- lib/parsedate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index af59bae7f..9cdcdd331 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, 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 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/parsedate.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index 9cdcdd331..e1bf5441f 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ extern const char * const Curl_wkday[7]; -- cgit v1.2.1 From 54d9f060b4b0a8fb5fa006813e4db1ca5c1a07e8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 7 Feb 2011 15:00:48 +0100 Subject: Curl_gmtime: added a portable gmtime Instead of polluting many places with #ifdefs, we create a single place for this function, and also check return code properly so that a NULL pointer returned won't cause problems. --- lib/parsedate.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index e1bf5441f..421befea0 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2011, 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 @@ -43,4 +43,6 @@ int Curl_parsedate(const char *date, time_t *output); #define PARSEDATE_LATER 1 #define PARSEDATE_SOONER 2 +CURLcode Curl_gmtime(time_t intime, struct tm *store); + #endif -- cgit v1.2.1 From a6f14e17b747893295bd6805abcaeb3e9b3217e0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 3 Jun 2011 19:31:32 +0200 Subject: parsedate: turn private and static I removed the prefix as well accordingly. --- lib/parsedate.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'lib/parsedate.h') diff --git a/lib/parsedate.h b/lib/parsedate.h index 421befea0..25d25367d 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -25,24 +25,6 @@ extern const char * const Curl_wkday[7]; extern const char * const Curl_month[12]; -/* - * Curl_parsedate() - * - * Returns: - * - * PARSEDATE_OK - a fine conversion - * PARSEDATE_FAIL - failed to convert - * PARSEDATE_LATER - time overflow at the far end of time_t - * PARSEDATE_SOONER - time underflow at the low end of time_t - */ - -int Curl_parsedate(const char *date, time_t *output); - -#define PARSEDATE_OK 0 -#define PARSEDATE_FAIL -1 -#define PARSEDATE_LATER 1 -#define PARSEDATE_SOONER 2 - CURLcode Curl_gmtime(time_t intime, struct tm *store); #endif -- cgit v1.2.1