From 5502de48eb5433285f6595ff5d619090510e1a5c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 2 Jul 2010 08:19:59 +0000 Subject: [PATCH] 2010-07-02 10:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog * Revised and updated status for pending TODOs TOFIXes of this year. * contrib/hbcurl/hbcurl.c * contrib/hbcurl/hbcurl.ch + Added support for all new libcurl features introduced in 7.19.4, 7.20.0, 7.21.0 * Changed some recently added constants to be in sync libcurl values. * contrib/hbwin/Makefile * contrib/hbwin/hbwin.hbp + contrib/hbwin/wapi_winnetwk.c + Added WAPI_WNETGETLASTERROR() * contrib/hbct/ctnet.c * NETREDIR(): Deleted Windows specific 4th parameter extension which activated debug-style features (introduced in xhb) based on WNetGetLastError() call. Such call was now added separately to hbwin. * contrib/hbide/hbide.prg ! Deleted hard-coded reference for specific QT version. This should be solved differently. ; TOFIX: BTW the whole notion of having a special build for a given distro is wrong. It should rather do autodetection in all builds. ; Patches from Tamas Tevesz: * src/rtl/memvarhb.prg * Adjusted information on magic byte + Version number change to 1. * src/rtl/hbcom.c ! Fix for linux/watcom link problem. * bin/postinst.sh * Ajustment for some undisclosed but probably weird system :) --- harbour/ChangeLog | 103 ++++++++++++------ harbour/bin/postinst.sh | 2 +- harbour/contrib/hbct/ctnet.c | 67 +----------- harbour/contrib/hbcurl/hbcurl.c | 146 +++++++++++++++++++++++++- harbour/contrib/hbcurl/hbcurl.ch | 100 +++++++++++++++--- harbour/contrib/hbide/hbide.prg | 2 +- harbour/contrib/hbwin/Makefile | 1 + harbour/contrib/hbwin/hbwin.hbp | 1 + harbour/contrib/hbwin/wapi_winnetwk.c | 79 ++++++++++++++ harbour/src/rtl/hbcom.c | 2 +- harbour/src/rtl/memvarhb.prg | 12 ++- 11 files changed, 396 insertions(+), 119 deletions(-) create mode 100644 harbour/contrib/hbwin/wapi_winnetwk.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4357a0af83..fd3eaef62e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,48 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-02 10:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * ChangeLog + * Revised and updated status for pending TODOs TOFIXes of + this year. + + * contrib/hbcurl/hbcurl.c + * contrib/hbcurl/hbcurl.ch + + Added support for all new libcurl features introduced in + 7.19.4, 7.20.0, 7.21.0 + * Changed some recently added constants to be in sync libcurl + values. + + * contrib/hbwin/Makefile + * contrib/hbwin/hbwin.hbp + + contrib/hbwin/wapi_winnetwk.c + + Added WAPI_WNETGETLASTERROR() + + * contrib/hbct/ctnet.c + * NETREDIR(): Deleted Windows specific 4th parameter extension + which activated debug-style features (introduced in xhb) + based on WNetGetLastError() call. Such call was now added + separately to hbwin. + + * contrib/hbide/hbide.prg + ! Deleted hard-coded reference for specific QT version. + This should be solved differently. + ; TOFIX: BTW the whole notion of having a special build + for a given distro is wrong. It should rather + do autodetection in all builds. + + ; Patches from Tamas Tevesz: + + * src/rtl/memvarhb.prg + * Adjusted information on magic byte + + Version number change to 1. + + * src/rtl/hbcom.c + ! Fix for linux/watcom link problem. + + * bin/postinst.sh + * Ajustment for some undisclosed but probably weird system :) + 2010-07-01 17:32 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/memvarhb.prg + Added file signature and version no. to .hbv files. @@ -392,7 +434,7 @@ at the same locations as as hbide.ini. It would be even better if hbide.env could use more standard .ini layout and be simply merged into hbide.ini. - Pritpal, could you check this issue? + Pritpal, could you check this issue? [NO FEEDBACK] 2010-06-29 09:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL @@ -407,8 +449,7 @@ This uses 'rcc' QT tool and since this one generates a .cpp file, the build process will require QT headers. ; TODO: If possible, create QRC .cpp to .prg converter to - remove this dependency. Pritpal, do you think it's - possible? + remove this dependency. [DONE] + contrib/hbide/hbide.qrc + Added QRC file with all the .png files in resources dir. @@ -513,7 +554,7 @@ some logic cleaned. Made all the changes that were needed in order to include the code in a hbmk2 plugin. hbqtui is not needed anymore. - ; TODO: Use hb_regexAll() instead of hb_regex() if possible. + ; TODO: Use hb_regexAll() instead of hb_regex() if possible. [CANCELLED] * contrib/hbqt/hbmk2_plugin_moc.prg * Minor cleanup in error messages. @@ -545,7 +586,7 @@ instead of .uip. ; TOFIX: The generator creates reference to function named Q__TR() which turned out to be part of HBQT. - What is this function? + What is this function? [CLEARED] * contrib/hbqt/hbmk2_plugin_ui.prg * Changed to use ui_ prefix and std .prg extension @@ -609,7 +650,7 @@ fails. This means that the caller will fail in various ways depending on how hbqtui failed. It also doesn't return anything via errorlevel. Pritpal can you look - at it? + at it? [SOLVED DIFFERENTLY] * contrib/Makefile * contrib/makefile.prg @@ -1536,12 +1577,12 @@ + Changed to generate .uip files dynamically using uip plugin. ; TODO: If this goes well, delete .uic and .uip files from SVN, - move resources/*.ui to hbide source root dir. + move resources/*.ui to hbide source root dir. [DONE] * contrib/hbqt/utils/hbqtui.prg ! Fixed to use GTCGI. ; TOFIX: There is a great deal of screen flickering due to - external call to uic.exe on Windows. + external call to uic.exe on Windows. [DONE] + contrib/hbide/resources/hbmk2_plugin_uip.prg + Added .ui -> .uip plugin. @@ -1965,7 +2006,7 @@ + Win64 support for HVM stack and other related internals. (HB_ULONG -> HB_SIZE, HB_LONG -> HB_ISIZ, long -> HB_ISIZ) + Using size API in debug functions. - ; TOFIX: These two warnings remain in HVM (not counting dlmalloc): + ; TOFIX: These two warnings remain in HVM (not counting dlmalloc): [DONE] --- hvm.c(10695) : warning C4244: 'argument' : conversion from 'HB_MAXINT' to 'double', possible loss of data macro.c(1315) : warning C4310: cast truncates constant value @@ -3837,7 +3878,7 @@ * src/rtl/gttrm/gttrm.c ! Added fix to compile when SA_RESTART is not available (in QNX). - ; TOFIX: Replace this with some more meaningful solution. + ; TOFIX: Replace this with some more meaningful solution. [MOVED] * src/rtl/hbzlib.c ! Fixed to compile when compressBound() is not available. @@ -3891,7 +3932,7 @@ 3.81 make versions. Some feature are disabled in this case, f.e. HB_BUILD_PKG (win/dos specific feature) ; TOFIX: host platform and cpu detection relies on $(eval) - which is not present on pre 3.80. + which is not present on pre 3.80. [DONE] ; habour and hbpp builds fine, but there are several remaining problems in rtl and vm. @@ -4023,10 +4064,10 @@ + mpkg_nightly.sh + Added script to generate nightly sources. - ; TODO: Upload nightlies to sf.net. - ; TODO: Change nightly filenames to match our normal source releases. + ; TODO: Upload nightlies to sf.net. [DONE] + ; TODO: Change nightly filenames to match our normal source releases. [DONE] ; TOFIX: Current .zip nighly has wrong (*nix) EOLs. This has to be - changed to CRLF. + changed to CRLF. [DONE] * INSTALL * Changed nightly script URLs to point to sf.net file area. @@ -8052,7 +8093,7 @@ + contrib/hbqt/hbqt.h + Added: constants hbqt_par_Qsci* - ; TODO make them local. + ; TODO make them local. [DONE] + Initial upload of wrappers for QScintilla. To generate the sources auto you need to stay in hbqt/hbqscintilla @@ -8257,7 +8298,7 @@ + Added SVN ID as comments. (I hope watcom supports it, if not pls tell) ; TODO: We should somehow merge these into one .def, - even if it requires some extra hbmk2 "magic". + even if it requires some extra hbmk2 "magic". [POSTPONED] * contrib/hbwin/tests/oletst1.hbp * contrib/hbwin/tests/olesrv1.hbp @@ -8674,7 +8715,7 @@ Disabling strict order for non empty hash arrays may change the items order. ; TODO: add translation for xHarbour's HAA*() functions to hbcompat.ch - and/or xhb library. + and/or xhb library. [DONE] * harbour/contrib/hbnetio/netiocli.c * harbour/contrib/hbnetio/netiosrv.c @@ -9380,7 +9421,7 @@ + Added experimental -hbdynvm mode. + Added support for .def input file in -hbdyn/-hbdynvm modes. ; TODO: Couldn't find how to pass .def files to Open Watcom wlink. - Anybody with an experience here? + Anybody with an experience here? [DONE] * src/rtl/memvarhb.prg + Added one initialization to NIL. @@ -9796,7 +9837,7 @@ and HB_K_CLOSE. ; TOFIX: HB_K_CLOSE doesn't work yet. Probably some rearrengement - of window close control will be needed. + of window close control will be needed. [DONE] ; The goal is to be able to keep "fireevent" feature in a Clipper/Harbour and thread friendly manner, so it becomes possible to move OS level @@ -11932,7 +11973,7 @@ (deleted bogus -Od and some other options) ; TODO: msvc optimization options for old compiler version could - still use a revamp. + still use a revamp. [CANCELLED] 2010-04-16 11:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL @@ -12392,7 +12433,7 @@ need changes in Harbour wrapper code. ; TOFIX: In quick tests BCC was throwing 'Abnormal program termination' and created corrupted .zip. Rest seems okay. [DONE] - ; TODO: Platforms tests, review patches, etc. + ; TODO: Platforms tests, review patches, etc. [DONE] 2010-04-09 14:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/jpeg/jidctflt.c @@ -16788,7 +16829,7 @@ avoiding some new warnings on this target. - Deleted code section which is superfluous after merging HB_OS_WIN and HB_IO_WIN modes. - ; TODO: Clean the rest. + ; TODO: Clean the rest. [DONE] ; TODO: Use native Windows API in the remaining places. [DONE] * include/hbdefs.h @@ -19842,8 +19883,8 @@ - Delete hacks dealing with former type chaos: HB_DONT_DEFINE_BASIC_TYPES, HB_DONT_DEFINE_BOOL, HB_DONT_DEFINE_BYTE, HB_DONT_DEFINE_LONG - Normalize HB_BYTE vs. HB_UCHAR usage [DONE - both stays] - - Type cleanups, f.e. HB_SIZE vs. HB_ULONG - - Add new special types (see above) + - Type cleanups, f.e. HB_SIZE vs. HB_ULONG [DONE] + - Add new special types (see above) [DONE] - Switch HB_SIZE to signed (big project), and delete HB_ISIZ afterwards. 2010-02-08 20:24 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) @@ -23234,7 +23275,7 @@ Based on logic found in WIN_DRAWBITMAP(). ; TOFIX: Both of these functions may GPF is passed wrong data. I don't know how to fix it, so if you do, - please help. + please help. [CANCELLED - not much to be done] * contrib/hbwin/win_prn2.c * Formatting. @@ -23990,7 +24031,7 @@ % hb_WNetErrorHandler() static function merged into NETREDIR(). ; TOFIX: Above hidden extension in NETREDIR() very much looks like a debugging feature, so I left a TOFIX to convert it to - HB_TRACE() call. + HB_TRACE() call. [DONE - differently] ; Please test them. * contrib/hbsqlit3/hbsqlit3.c @@ -26427,7 +26468,7 @@ * src/vm/extrap.c % Marked exception filter callback as 'static' - ; TOCHECK: Please verify that OS/2 still works this way. + ; TOCHECK: Please verify that OS/2 still works this way. [DONE] * src/rtl/oemansi.c ! Fixed two tabs. @@ -27284,7 +27325,7 @@ * contrib/hbqt/qth/QApplication.qth * Minor optimizations. % One static var deleted. - ; TOFIX/TOCHECK: argv/argc usage. + ; TOFIX/TOCHECK: argv/argc usage. [DONE] * contrib/hbqt/qtgui/QApplication.cpp * contrib/hbqt/hbqt_garbage.h @@ -27677,7 +27718,7 @@ command prompt, maybe it's a good idea to prefix all public functions with hbide_, otherwise there will be problems when name collision occurs with user code. - If this is not the goal, we can leave it. + If this is not the goal, we can leave it. [CLOSED] 2010-01-02 08:28 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/projects/hbide.hbi @@ -27729,9 +27770,9 @@ ! Deleted .exe extension from output name for portability. ! Fixed -workdir option to also have ${hb_plat} macro for portability. ; Pls remember that hbide is meant to be a portable tool. - ; TOFIX: Delete -workdir option altogether. Not needed. + ; TOFIX: Delete -workdir option altogether. Not needed. [DONE] ; TOFIX: Hard-wired dir C:\qt\2009.01\qt\lib should be stored in - SVN. + SVN. [DONE] 2010-01-02 02:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * harbour.spec diff --git a/harbour/bin/postinst.sh b/harbour/bin/postinst.sh index afabebf1e3..391569b7fb 100755 --- a/harbour/bin/postinst.sh +++ b/harbour/bin/postinst.sh @@ -105,7 +105,7 @@ mk_hblibso() linker_options="-lm" fi linker_mtoptions="" - if echo ${HB_USER_CFLAGS} | grep -q -- -DHB_POSIX_REGEX ; then + if echo ${HB_USER_CFLAGS} | grep -- -DHB_POSIX_REGEX >/dev/null 2>&1 ; then hb_libs="` echo ${hb_libs} | sed 's!hbpcre!!g' `" elif [ -z "${HB_HAS_PCRE_LOCAL}" ]; then linker_options="-lpcre ${linker_options}" diff --git a/harbour/contrib/hbct/ctnet.c b/harbour/contrib/hbct/ctnet.c index c99f1ba559..81b25a803b 100644 --- a/harbour/contrib/hbct/ctnet.c +++ b/harbour/contrib/hbct/ctnet.c @@ -174,72 +174,7 @@ HB_FUNC( NETREDIR ) hb_strfree( hSharedRes ); hb_strfree( hPassword ); - if( dwResult == NO_ERROR ) - hb_retl( HB_TRUE ); - else - { - /* NOTE: Hidden extension (Added by xhb project) */ - - /* TOFIX: Is this really needed? Consider converting it - to HB_TRACE() call or a wrapper to WNetGetLastError() API. - [vszakats] */ - - if( hb_parl( 4 ) /* lShowError */ ) - { - PHB_ITEM pError; - - if( dwResult != ERROR_EXTENDED_ERROR ) - { - char szFunction[ 128 ]; - - hb_snprintf( szFunction, sizeof( szFunction ), "NETREDIR( \"%s\", \"%s\", \"%s\" )", - hb_parcx( 1 ), hb_parcx( 2 ), hb_parcx( 3 ) ); - - pError = hb_errRT_New( ES_ERROR, - "CT", - 9001, - 0, - "Windows Network operation failed", - szFunction, ( HB_ERRCODE ) dwResult, EF_NONE ); - hb_errLaunch( pError ); - hb_itemRelease( pError ); - } - else - { - DWORD dwLastError = 0; - TCHAR lpDescription[ 256 ]; - TCHAR lpProvider[ 256 ]; - - dwResult = WNetGetLastError( &dwLastError, - lpDescription, HB_SIZEOFARRAY( lpDescription ), - lpProvider, HB_SIZEOFARRAY( lpProvider ) ); - - if( dwResult != NO_ERROR ) - { - pError = hb_errRT_New( ES_ERROR, "CT", 9002, 0, - "WNetGetLastError failed", "see OS error", - ( HB_ERRCODE ) dwResult, EF_NONE ); - hb_errLaunch( pError ); - hb_itemRelease( pError ); - } - else - { - char * szDescription = HB_TCHAR_CONVFROM( lpDescription ); - char * szProvider = HB_TCHAR_CONVFROM( lpProvider ); - pError = hb_errRT_New( ES_ERROR, "CT", 9003, 0, - szDescription, szProvider, - ( HB_ERRCODE ) dwLastError, EF_NONE ); - HB_TCHAR_FREE( szDescription ); - HB_TCHAR_FREE( szProvider ); - - hb_errLaunch( pError ); - hb_itemRelease( pError ); - } - } - } - - hb_retl( HB_FALSE ); - } + hb_retl( dwResult == NO_ERROR ); #else hb_retl( HB_FALSE ); #endif diff --git a/harbour/contrib/hbcurl/hbcurl.c b/harbour/contrib/hbcurl/hbcurl.c index 2b3da43715..08b7b9a5aa 100644 --- a/harbour/contrib/hbcurl/hbcurl.c +++ b/harbour/contrib/hbcurl/hbcurl.c @@ -6,7 +6,7 @@ * Harbour Project source code: * libcurl 'easy' API - Harbour interface. * - * Copyright 2008 Viktor Szakats (harbour.01 syenar.hu) + * Copyright 2008-2010 Viktor Szakats (harbour.01 syenar.hu) * originally based on: * Copyright 2005 Luiz Rafael Culik Guimaraes * www - http://harbour-project.org @@ -99,6 +99,7 @@ typedef struct _HB_CURL struct curl_slist * pPOSTQUOTE; struct curl_slist * pPREQUOTE; struct curl_slist * pTELNETOPTIONS; + struct curl_slist * pMAIL_RCPT; char * ul_name; HB_FHANDLE ul_handle; @@ -496,6 +497,9 @@ static void PHB_CURL_free( PHB_CURL hb_curl, HB_BOOL bFree ) curl_easy_setopt( hb_curl->curl, CURLOPT_POSTQUOTE, NULL ); curl_easy_setopt( hb_curl->curl, CURLOPT_PREQUOTE, NULL ); curl_easy_setopt( hb_curl->curl, CURLOPT_TELNETOPTIONS, NULL ); +#if LIBCURL_VERSION_NUM >= 0x071400 + curl_easy_setopt( hb_curl->curl, CURLOPT_MAIL_RCPT, NULL ); +#endif hb_curl_form_free( &hb_curl->pHTTPPOST_First ); hb_curl_form_free( &hb_curl->pHTTPPOST_Last ); @@ -505,6 +509,7 @@ static void PHB_CURL_free( PHB_CURL hb_curl, HB_BOOL bFree ) hb_curl_slist_free( &hb_curl->pPOSTQUOTE ); hb_curl_slist_free( &hb_curl->pPREQUOTE ); hb_curl_slist_free( &hb_curl->pTELNETOPTIONS ); + hb_curl_slist_free( &hb_curl->pMAIL_RCPT ); hb_curl_file_ul_free( hb_curl ); hb_curl_file_dl_free( hb_curl ); @@ -772,6 +777,11 @@ HB_FUNC( CURL_EASY_SETOPT ) res = curl_easy_setopt( hb_curl->curl, CURLOPT_NOSIGNAL, HB_CURL_OPT_BOOL( 3 ) ); break; #endif +#if LIBCURL_VERSION_NUM >= 0x071500 + case HB_CURLOPT_WILDCARDMATCH: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_WILDCARDMATCH, HB_CURL_OPT_BOOL( 3 ) ); + break; +#endif /* Callback */ @@ -873,6 +883,23 @@ HB_FUNC( CURL_EASY_SETOPT ) res = curl_easy_setopt( hb_curl->curl, CURLOPT_ADDRESS_SCOPE, hb_parnl( 3 ) ); break; #endif +#if LIBCURL_VERSION_NUM >= 0x071304 + case HB_CURLOPT_PROTOCOLS: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_PROTOCOLS, hb_parnl( 3 ) ); + break; + case HB_CURLOPT_REDIR_PROTOCOLS: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_REDIR_PROTOCOLS, hb_parnl( 3 ) ); + break; + case HB_CURLOPT_NOPROXY: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_NOPROXY, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_SOCKS5_GSSAPI_SERVICE: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_SOCKS5_GSSAPI_SERVICE, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_SOCKS5_GSSAPI_NEC: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_SOCKS5_GSSAPI_NEC, HB_CURL_OPT_BOOL( 3 ) ); + break; +#endif /* Names and passwords options (Authentication) */ @@ -935,7 +962,6 @@ HB_FUNC( CURL_EASY_SETOPT ) res = curl_easy_setopt( hb_curl->curl, CURLOPT_MAXREDIRS, hb_parnl( 3 ) ); break; #if LIBCURL_VERSION_NUM >= 0x071101 - case HB_CURLOPT_POST301: case HB_CURLOPT_POSTREDIR: #if LIBCURL_VERSION_NUM >= 0x071301 res = curl_easy_setopt( hb_curl->curl, CURLOPT_POSTREDIR, HB_CURL_OPT_BOOL( 3 ) ); @@ -1072,6 +1098,41 @@ HB_FUNC( CURL_EASY_SETOPT ) break; #endif + /* SMTP options */ + +#if LIBCURL_VERSION_NUM >= 0x071400 + case HB_CURLOPT_MAIL_FROM: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_MAIL_FROM, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_MAIL_RCPT: + { + PHB_ITEM pArray = hb_param( 3, HB_IT_ARRAY ); + + curl_easy_setopt( hb_curl->curl, CURLOPT_MAIL_RCPT, NULL ); + hb_curl_slist_free( &hb_curl->pMAIL_RCPT ); + + if( pArray ) + { + HB_SIZE ulPos; + HB_SIZE ulArrayLen = hb_arrayLen( pArray ); + + for( ulPos = 0; ulPos < ulArrayLen; ulPos++ ) + hb_curl->pMAIL_RCPT = curl_slist_append( hb_curl->pMAIL_RCPT, hb_arrayGetCPtr( pArray, ulPos + 1 ) ); + + res = curl_easy_setopt( hb_curl->curl, CURLOPT_MAIL_RCPT, hb_curl->pMAIL_RCPT ); + } + } + break; +#endif + + /* TFTP options */ + +#if LIBCURL_VERSION_NUM >= 0x071304 + case HB_CURLOPT_TFTP_BLKSIZE: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_TFTP_BLKSIZE, hb_parnl( 3 ) ); + break; +#endif + /* FTP options */ case HB_CURLOPT_FTPPORT: @@ -1156,6 +1217,11 @@ HB_FUNC( CURL_EASY_SETOPT ) case HB_CURLOPT_FTP_USE_EPSV: res = curl_easy_setopt( hb_curl->curl, CURLOPT_FTP_USE_EPSV, HB_CURL_OPT_BOOL( 3 ) ); break; +#if LIBCURL_VERSION_NUM >= 0x071400 + case HB_CURLOPT_FTP_USE_PRET: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_FTP_USE_PRET, HB_CURL_OPT_BOOL( 3 ) ); + break; +#endif #if LIBCURL_VERSION_NUM >= 0x070A07 case HB_CURLOPT_FTP_CREATE_MISSING_DIRS: res = curl_easy_setopt( hb_curl->curl, CURLOPT_FTP_CREATE_MISSING_DIRS, HB_CURL_OPT_BOOL( 3 ) ); @@ -1204,6 +1270,29 @@ HB_FUNC( CURL_EASY_SETOPT ) break; #endif + /* RTSP */ + +#if LIBCURL_VERSION_NUM >= 0x071400 + case HB_CURLOPT_RTSP_REQUEST: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_REQUEST, hb_parnl( 3 ) ); + break; + case HB_CURLOPT_RTSP_SESSION_ID: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_SESSION_ID, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_RTSP_STREAM_URI: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_STREAM_URI, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_RTSP_TRANSPORT: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_TRANSPORT, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; + case HB_CURLOPT_RTSP_CLIENT_CSEQ: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_CLIENT_CSEQ, hb_parnl( 3 ) ); + break; + case HB_CURLOPT_RTSP_SERVER_CSEQ: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_RTSP_SERVER_CSEQ, hb_parnl( 3 ) ); + break; +#endif + /* Protocol */ case HB_CURLOPT_TRANSFERTEXT: @@ -1422,6 +1511,11 @@ HB_FUNC( CURL_EASY_SETOPT ) res = curl_easy_setopt( hb_curl->curl, CURLOPT_SSH_PRIVATE_KEYFILE, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); break; #endif +#if LIBCURL_VERSION_NUM >= 0x071306 + case HB_CURLOPT_SSH_KNOWNHOSTS: + res = curl_easy_setopt( hb_curl->curl, CURLOPT_SSH_KNOWNHOSTS, hb_curl_StrHash( hb_curl, hb_parc( 3 ) ) ); + break; +#endif /* Other options */ @@ -1833,6 +1927,54 @@ HB_FUNC( CURL_EASY_GETINFO ) #endif type = HB_CURL_INFO_TYPE_SLIST; break; + case HB_CURLINFO_CONDITION_UNMET: +#if LIBCURL_VERSION_NUM >= 0x071304 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CONDITION_UNMET, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; + case HB_CURLINFO_RTSP_SESSION_ID: +#if LIBCURL_VERSION_NUM >= 0x071400 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_RTSP_SESSION_ID, &ret_string ); +#endif + type = HB_CURL_INFO_TYPE_STR; + break; + case HB_CURLINFO_RTSP_CLIENT_CSEQ: +#if LIBCURL_VERSION_NUM >= 0x071400 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_RTSP_CLIENT_CSEQ, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; + case HB_CURLINFO_RTSP_SERVER_CSEQ: +#if LIBCURL_VERSION_NUM >= 0x071400 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_RTSP_SERVER_CSEQ, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; + case HB_CURLINFO_RTSP_CSEQ_RECV: +#if LIBCURL_VERSION_NUM >= 0x071400 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_RTSP_CSEQ_RECV, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; + case HB_CURLINFO_PRIMARY_PORT: +#if LIBCURL_VERSION_NUM >= 0x071500 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_PRIMARY_PORT, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; + case HB_CURLINFO_LOCAL_IP: +#if LIBCURL_VERSION_NUM >= 0x071500 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_LOCAL_IP, &ret_string ); +#endif + type = HB_CURL_INFO_TYPE_STR; + break; + case HB_CURLINFO_LOCAL_PORT: +#if LIBCURL_VERSION_NUM >= 0x071500 + res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_LOCAL_PORT, &ret_long ); +#endif + type = HB_CURL_INFO_TYPE_LONG; + break; } switch( type ) diff --git a/harbour/contrib/hbcurl/hbcurl.ch b/harbour/contrib/hbcurl/hbcurl.ch index 874d210dbc..26de114a51 100644 --- a/harbour/contrib/hbcurl/hbcurl.ch +++ b/harbour/contrib/hbcurl/hbcurl.ch @@ -225,11 +225,29 @@ #define HB_CURLOPT_ISSUERCERT 170 #define HB_CURLOPT_ADDRESS_SCOPE 171 #define HB_CURLOPT_CERTINFO 172 -#define HB_CURLOPT_POSTREDIR 173 -#define HB_CURLOPT_USERNAME 174 -#define HB_CURLOPT_PASSWORD 175 -#define HB_CURLOPT_PROXYUSERNAME 176 -#define HB_CURLOPT_PROXYPASSWORD 177 +#define HB_CURLOPT_POSTREDIR HB_CURLOPT_POST301 +#define HB_CURLOPT_USERNAME 173 +#define HB_CURLOPT_PASSWORD 174 +#define HB_CURLOPT_PROXYUSERNAME 175 +#define HB_CURLOPT_PROXYPASSWORD 176 +#define HB_CURLOPT_NOPROXY 177 +#define HB_CURLOPT_TFTP_BLKSIZE 178 +#define HB_CURLOPT_SOCKS5_GSSAPI_SERVICE 179 +#define HB_CURLOPT_SOCKS5_GSSAPI_NEC 180 +#define HB_CURLOPT_PROTOCOLS 181 +#define HB_CURLOPT_REDIR_PROTOCOLS 182 +#define HB_CURLOPT_SSH_KNOWNHOSTS 183 +#define HB_CURLOPT_MAIL_FROM 186 +#define HB_CURLOPT_MAIL_RCPT 187 +#define HB_CURLOPT_FTP_USE_PRET 188 +#define HB_CURLOPT_RTSP_REQUEST 189 +#define HB_CURLOPT_RTSP_SESSION_ID 190 +#define HB_CURLOPT_RTSP_STREAM_URI 191 +#define HB_CURLOPT_RTSP_TRANSPORT 192 +#define HB_CURLOPT_RTSP_HEADER HB_CURLOPT_HTTPHEADER +#define HB_CURLOPT_RTSP_CLIENT_CSEQ 193 +#define HB_CURLOPT_RTSP_SERVER_CSEQ 194 +#define HB_CURLOPT_WILDCARDMATCH 197 #define HB_CURLOPT_DOWNLOAD 1001 /* Harbour special ones */ #define HB_CURLOPT_PROGRESSBLOCK 1002 #define HB_CURLOPT_UL_FILE_SETUP 1003 @@ -251,6 +269,7 @@ /* HB_CURLOPT_PROXYTYPE option */ #define HB_CURLPROXY_HTTP 0 /* added in 7.10 */ +#define HB_CURLPROXY_HTTP_1_0 1 /* added in 7.19.4, force to use CONNECT HTTP/1.0 */ #define HB_CURLPROXY_SOCKS4 4 /* support added in 7.15.2, enum existed already in 7.10 */ #define HB_CURLPROXY_SOCKS5 5 /* added in 7.10 */ #define HB_CURLPROXY_SOCKS4A 6 /* added in 7.18.0 */ @@ -267,8 +286,9 @@ #define HB_CURLAUTH_DIGEST 2 /* Digest */ #define HB_CURLAUTH_GSSNEGOTIATE 4 /* GSS-Negotiate */ #define HB_CURLAUTH_NTLM 8 /* NTLM */ -#define HB_CURLAUTH_ANY hb_BitNot( 0 ) /* all types set */ -#define HB_CURLAUTH_ANYSAFE hb_BitNot( HB_CURLAUTH_BASIC ) +#define HB_CURLAUTH_DIGEST_IE hb_bitShift( 1, 4 ) /* Digest with IE flavour */ +#define HB_CURLAUTH_ANY hb_bitNot( 0 ) /* all types set */ +#define HB_CURLAUTH_ANYSAFE hb_bitNot( HB_CURLAUTH_BASIC ) /* HB_CURLOPT_HTTP_VERSION option */ #define HB_CURL_HTTP_VERSION_NONE 0 /* setting this means we don't care, and that we'd like the library to choose the best possible for us! */ @@ -297,6 +317,21 @@ #define HB_CURLFTPMETHOD_NOCWD 2 /* no CWD at all */ #define HB_CURLFTPMETHOD_SINGLECWD 3 /* one CWD to full dir, then work on file */ +/* HB_CURLOPT_RTSP_REQUEST option */ +#define HB_CURL_RTSPREQ_NONE 0 +#define HB_CURL_RTSPREQ_OPTIONS 1 +#define HB_CURL_RTSPREQ_DESCRIBE 2 +#define HB_CURL_RTSPREQ_ANNOUNCE 3 +#define HB_CURL_RTSPREQ_SETUP 4 +#define HB_CURL_RTSPREQ_PLAY 5 +#define HB_CURL_RTSPREQ_PAUSE 6 +#define HB_CURL_RTSPREQ_TEARDOWN 7 +#define HB_CURL_RTSPREQ_GET_PARAMETER 8 +#define HB_CURL_RTSPREQ_SET_PARAMETER 9 +#define HB_CURL_RTSPREQ_RECORD 10 +#define HB_CURL_RTSPREQ_RECEIVE 11 +#define HB_CURL_RTSPREQ_LAST 12 + /* HB_CURLOPT_TIMECONDITION option */ #define HB_CURL_TIMECOND_NONE 0 #define HB_CURL_TIMECOND_IFMODSINCE 1 @@ -315,7 +350,7 @@ #define HB_CURL_SSLVERSION_SSLv3 3 /* HB_CURLOPT_SSH_AUTH_TYPES option */ -#define HB_CURL_CURLSSH_AUTH_ANY hb_BitNot( 0 ) /* all types supported by the server */ +#define HB_CURL_CURLSSH_AUTH_ANY hb_bitNot( 0 ) /* all types supported by the server */ #define HB_CURL_CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ #define HB_CURL_CURLSSH_AUTH_PUBLICKEY 1 /* public/private key files */ #define HB_CURL_CURLSSH_AUTH_PASSWORD 2 /* password */ @@ -323,18 +358,46 @@ #define HB_CURL_CURLSSH_AUTH_KEYBOARD 8 /* keyboard interactive */ #define HB_CURL_CURLSSH_AUTH_DEFAULT HB_CURLSSH_AUTH_ANY -/* curl_easy_pause() parameters. They can be combined with hb_BitOr(). */ +/* CURLOPT_*PROTOCOLS options */ +#define HB_CURLPROTO_HTTP hb_bitShift( 1, 0 ) +#define HB_CURLPROTO_HTTPS hb_bitShift( 1, 1 ) +#define HB_CURLPROTO_FTP hb_bitShift( 1, 2 ) +#define HB_CURLPROTO_FTPS hb_bitShift( 1, 3 ) +#define HB_CURLPROTO_SCP hb_bitShift( 1, 4 ) +#define HB_CURLPROTO_SFTP hb_bitShift( 1, 5 ) +#define HB_CURLPROTO_TELNET hb_bitShift( 1, 6 ) +#define HB_CURLPROTO_LDAP hb_bitShift( 1, 7 ) +#define HB_CURLPROTO_LDAPS hb_bitShift( 1, 8 ) +#define HB_CURLPROTO_DICT hb_bitShift( 1, 9 ) +#define HB_CURLPROTO_FILE hb_bitShift( 1, 10 ) +#define HB_CURLPROTO_TFTP hb_bitShift( 1, 11 ) +#define HB_CURLPROTO_IMAP hb_bitShift( 1, 12 ) +#define HB_CURLPROTO_IMAPS hb_bitShift( 1, 13 ) +#define HB_CURLPROTO_POP3 hb_bitShift( 1, 14 ) +#define HB_CURLPROTO_POP3S hb_bitShift( 1, 15 ) +#define HB_CURLPROTO_SMTP hb_bitShift( 1, 16 ) +#define HB_CURLPROTO_SMTPS hb_bitShift( 1, 17 ) +#define HB_CURLPROTO_RTSP hb_bitShift( 1, 18 ) +#define HB_CURLPROTO_RTMP hb_bitShift( 1, 19 ) +#define HB_CURLPROTO_RTMPT hb_bitShift( 1, 20 ) +#define HB_CURLPROTO_RTMPE hb_bitShift( 1, 21 ) +#define HB_CURLPROTO_RTMPTE hb_bitShift( 1, 22 ) +#define HB_CURLPROTO_RTMPS hb_bitShift( 1, 23 ) +#define HB_CURLPROTO_RTMPTS hb_bitShift( 1, 24 ) +#define HB_CURLPROTO_ALL hb_bitNot( 0 ) + +/* curl_easy_pause() parameters. They can be combined with hb_bitOr(). */ #define HB_CURLPAUSE_RECV 1 #define HB_CURLPAUSE_RECV_CONT 0 #define HB_CURLPAUSE_SEND 4 #define HB_CURLPAUSE_SEND_CONT 0 -#define HB_CURLPAUSE_ALL hb_BitOr( HB_CURLPAUSE_RECV, HB_CURLPAUSE_SEND ) -#define HB_CURLPAUSE_CONT hb_BitOr( HB_CURLPAUSE_RECV_CONT, HB_CURLPAUSE_SEND_CONT ) +#define HB_CURLPAUSE_ALL hb_bitOr( HB_CURLPAUSE_RECV, HB_CURLPAUSE_SEND ) +#define HB_CURLPAUSE_CONT hb_bitOr( HB_CURLPAUSE_RECV_CONT, HB_CURLPAUSE_SEND_CONT ) /* curl_global_init() parameters. */ #define HB_CURL_GLOBAL_SSL 1 #define HB_CURL_GLOBAL_WIN32 2 -#define HB_CURL_GLOBAL_ALL hb_BitOr( HB_CURL_GLOBAL_SSL, HB_CURL_GLOBAL_WIN32 ) +#define HB_CURL_GLOBAL_ALL hb_bitOr( HB_CURL_GLOBAL_SSL, HB_CURL_GLOBAL_WIN32 ) #define HB_CURL_GLOBAL_NOTHING 0 #define HB_CURL_GLOBAL_DEFAULT HB_CURL_GLOBAL_ALL @@ -375,6 +438,14 @@ #define HB_CURLINFO_PRIMARY_IP 32 #define HB_CURLINFO_APPCONNECT_TIME 33 #define HB_CURLINFO_CERTINFO 34 +#define HB_CURLINFO_CONDITION_UNMET 35 +#define HB_CURLINFO_RTSP_SESSION_ID 36 +#define HB_CURLINFO_RTSP_CLIENT_CSEQ 37 +#define HB_CURLINFO_RTSP_SERVER_CSEQ 38 +#define HB_CURLINFO_RTSP_CSEQ_RECV 39 +#define HB_CURLINFO_PRIMARY_PORT 40 +#define HB_CURLINFO_LOCAL_IP 41 +#define HB_CURLINFO_LOCAL_PORT 42 /* curl result codes. */ @@ -463,5 +534,10 @@ #define HB_CURLE_AGAIN 81 /* socket is not ready for send/recv, wait till it's ready and try again */ #define HB_CURLE_SSL_CRL_BADFILE 82 /* could not load CRL file, missing or wrong format (Added in 7.19.0) */ #define HB_CURLE_SSL_ISSUER_ERROR 83 /* Issuer check failed. (Added in 7.19.0) */ +#define HB_CURLE_FTP_PRET_FAILED 84 /* a PRET command failed */ +#define HB_CURLE_RTSP_CSEQ_ERROR 85 /* mismatch of RTSP CSeq numbers */ +#define HB_CURLE_RTSP_SESSION_ERROR 86 /* mismatch of RTSP Session Identifiers */ +#define HB_CURLE_FTP_BAD_FILE_LIST 87 /* unable to parse FTP file list */ +#define HB_CURLE_CHUNK_FAILED 88 /* chunk callback reported error */ #endif /* HBCURL_CH_ */ diff --git a/harbour/contrib/hbide/hbide.prg b/harbour/contrib/hbide/hbide.prg index 6568066273..58a76e6fe8 100644 --- a/harbour/contrib/hbide/hbide.prg +++ b/harbour/contrib/hbide/hbide.prg @@ -100,7 +100,7 @@ PROCEDURE Main( ... ) LOCAL cBse := hb_dirBase() + ".." /* Set the path env variable to Qt's run-time which is used to compile Harbour binaries */ - hb_setEnv( "PATH", cBse + cSep + "Qt" + cSep + "4.6.2" + cSep + "lib" + ; + hb_setEnv( "PATH", cBse + cSep + "qt" + cSep + "lib" + ; hb_osPathListSeparator() + hb_getEnv( "PATH" ) ) /* Variable is used in hbide.env */ diff --git a/harbour/contrib/hbwin/Makefile b/harbour/contrib/hbwin/Makefile index 2d201eee5d..91e5501c7e 100644 --- a/harbour/contrib/hbwin/Makefile +++ b/harbour/contrib/hbwin/Makefile @@ -26,6 +26,7 @@ C_SOURCES := \ wapi_winbase_mutex.c \ wapi_wingdi.c \ wapi_wingdi_font.c \ + wapi_winnetwk.c \ wapi_winnls.c \ wapi_winuser.c \ wce_simc.c \ diff --git a/harbour/contrib/hbwin/hbwin.hbp b/harbour/contrib/hbwin/hbwin.hbp index 91278f61fe..ae81cf883d 100644 --- a/harbour/contrib/hbwin/hbwin.hbp +++ b/harbour/contrib/hbwin/hbwin.hbp @@ -36,6 +36,7 @@ wapi_winbase.c wapi_winbase_mutex.c wapi_wingdi.c wapi_wingdi_font.c +wapi_winnetwk.c wapi_winnls.c wapi_winuser.c wce_simc.c diff --git a/harbour/contrib/hbwin/wapi_winnetwk.c b/harbour/contrib/hbwin/wapi_winnetwk.c new file mode 100644 index 0000000000..f472ff6e10 --- /dev/null +++ b/harbour/contrib/hbwin/wapi_winnetwk.c @@ -0,0 +1,79 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Windows API functions (winnetwk.h - mpr.dll) + * + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) + * www - http://harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#include "hbwapi.h" + +#if ! defined( HB_OS_WIN_CE ) +# include +#endif + +HB_FUNC( WAPI_WNETGETLASTERROR ) +{ +#if ! defined( HB_OS_WIN_CE ) + DWORD dwLastError = 0; + TCHAR lpDescription[ 256 ]; + TCHAR lpProvider[ 256 ]; + + hb_retnl( ( long ) WNetGetLastError( &dwLastError, + lpDescription, HB_SIZEOFARRAY( lpDescription ), + lpProvider, HB_SIZEOFARRAY( lpProvider ) ) ); + + hb_stornl( ( long ) dwLastError, 1 ); + HB_STORSTR( lpDescription, 2 ); + HB_STORSTR( lpProvider, 3 ); +#else + hb_retnl( 0 ); + hb_stornl( 0, 1 ); + hb_storc( NULL, 2 ); + hb_storc( NULL, 3 ); +#endif +} diff --git a/harbour/src/rtl/hbcom.c b/harbour/src/rtl/hbcom.c index feeb2efa81..bbfdd8dfb6 100644 --- a/harbour/src/rtl/hbcom.c +++ b/harbour/src/rtl/hbcom.c @@ -62,7 +62,7 @@ #include "hbinit.h" #include "hbdate.h" -#if defined( HB_OS_UNIX ) /* || defined( __DJGPP__ ) */ +#if defined( HB_OS_UNIX ) && !defined( __WATCOMC__) /* || defined( __DJGPP__ ) */ # if !defined( HB_HAS_TERMIOS ) # define HB_HAS_TERMIOS # endif diff --git a/harbour/src/rtl/memvarhb.prg b/harbour/src/rtl/memvarhb.prg index 61f925adeb..a0c423c7f8 100644 --- a/harbour/src/rtl/memvarhb.prg +++ b/harbour/src/rtl/memvarhb.prg @@ -56,15 +56,17 @@ #include "fileio.ch" /* - * 'H', 'B', 'V' followed two-byte version number in network byte order (BE). + * 0xC0, 'H', 'B', 'V' followed two-byte version number in Little Endian order. * Corresponding magic(5) rule: - * 0 string \xC0HBV - * 0x04 beshort x Harbour memory file version %d + * + * 0 string \xc0HBV Harbour memory file + * >4 leshort x version %d + * * Until such time that the serialized format changes, and handling of * previously-saved files is required, only a naive approach of using - * version 0 is taken. + * version 1 is taken. */ -#define _HBMEM_SIGNATURE e"\xC0HBV" + Chr( 0 ) + Chr( 0 ) +#define _HBMEM_SIGNATURE e"\xC0HBV" + Chr( 1 ) + Chr( 0 ) #define _HBMEM_EXT ".hbv"