From 13bd4f66be5a3c6995815367f1bef649d70c8487 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 7 Jun 2008 08:16:52 +0000 Subject: [PATCH] 2008-06-07 09:40 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/hbcurl/hbcurl.c + Added RTEs when wrong parameter was passed to the remaining functions: CURL_EASY_STRERROR() CURL_SHARE_STRERROR() CURL_MULTI_STRERROR() CURL_GETDATE() [RC1] * contrib/hbcurl/hbcurl.c % Minor opt. [RC1] ; Not bugfixes per se, but I didn't want to leave a gap in behaviour. This are the final finishes to this lib. --- harbour-RC1/ChangeLog | 16 ++++++++++++++++ harbour-RC1/contrib/hbcurl/hbcurl.c | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/harbour-RC1/ChangeLog b/harbour-RC1/ChangeLog index bc2cd60e16..18b6e3ecbb 100644 --- a/harbour-RC1/ChangeLog +++ b/harbour-RC1/ChangeLog @@ -8,6 +8,22 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-07 09:40 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbcurl/hbcurl.c + + Added RTEs when wrong parameter was passed + to the remaining functions: + CURL_EASY_STRERROR() + CURL_SHARE_STRERROR() + CURL_MULTI_STRERROR() + CURL_GETDATE() + [RC1] + + * contrib/hbcurl/hbcurl.c + % Minor opt. [RC1] + + ; Not bugfixes per se, but I didn't want to leave a gap + in behaviour. This are the final finishes to this lib. + 2008-06-07 09:39 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/gtwvt/gtwvt.c ! Fixed cursor width to be synced properly after diff --git a/harbour-RC1/contrib/hbcurl/hbcurl.c b/harbour-RC1/contrib/hbcurl/hbcurl.c index 1eb463aa5d..7b29b97334 100644 --- a/harbour-RC1/contrib/hbcurl/hbcurl.c +++ b/harbour-RC1/contrib/hbcurl/hbcurl.c @@ -1673,23 +1673,36 @@ HB_FUNC( CURL_VERSION_INFO ) HB_FUNC( CURL_EASY_STRERROR ) { - hb_retc( curl_easy_strerror( ( CURLcode ) hb_parnl( 1 ) ) ); + if( ISNUM( 1 ) ) + hb_retc( curl_easy_strerror( ( CURLcode ) hb_parnl( 1 ) ) ); + else + hb_errRT_BASE( EG_ARG, 2010, NULL, "CURL_EASY_STRERROR", HB_ERR_ARGS_BASEPARAMS ); } HB_FUNC( CURL_SHARE_STRERROR ) { - hb_retc( curl_share_strerror( ( CURLSHcode ) hb_parnl( 1 ) ) ); + if( ISNUM( 1 ) ) + hb_retc( curl_share_strerror( ( CURLSHcode ) hb_parnl( 1 ) ) ); + else + hb_errRT_BASE( EG_ARG, 2010, NULL, "CURL_SHARE_STRERROR", HB_ERR_ARGS_BASEPARAMS ); } HB_FUNC( CURL_MULTI_STRERROR ) { - hb_retc( curl_multi_strerror( ( CURLMcode ) hb_parnl( 1 ) ) ); + if( ISNUM( 1 ) ) + hb_retc( curl_multi_strerror( ( CURLMcode ) hb_parnl( 1 ) ) ); + else + hb_errRT_BASE( EG_ARG, 2010, NULL, "CURL_MULTI_STRERROR", HB_ERR_ARGS_BASEPARAMS ); } #endif /* NOTE: This returns the number of seconds since January 1st 1970 in the UTC time zone. */ +/* TODO: Add support for second curl_getdate() parameter: 'time_t * now' */ HB_FUNC( CURL_GETDATE ) { - hb_retnint( ( HB_LONG ) curl_getdate( hb_parcx( 1 ), NULL ) ); + if( ISCHAR( 1 ) ) + hb_retnint( ( HB_LONG ) curl_getdate( hb_parc( 1 ), NULL ) ); + else + hb_errRT_BASE( EG_ARG, 2010, NULL, "CURL_GETDATE", HB_ERR_ARGS_BASEPARAMS ); }