From b9e952b6c722286c09cd490a49e83a08c74dc33d Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 18 Apr 2007 22:15:17 +0000 Subject: [PATCH] 2007-04-19 00:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/gd/gdwrp.c * harbour/contrib/libmisc/hb_f.c * harbour/contrib/samples/dbf.c * harbour/contrib/samples/time.c * harbour/doc/es/hb_apiln.txt * harbour/include/hbapicdp.h * harbour/include/hbapilng.h * harbour/source/rdd/dbcmd.c * harbour/source/rdd/dbnubs.c * harbour/source/rdd/hsx/cftsfunc.c * harbour/source/rtl/accept.c * harbour/source/rtl/defpath.c * harbour/source/rtl/oemansi.c * harbour/source/rtl/pad.c * harbour/source/rtl/shadow.c * harbour/source/rtl/trim.c * harbour/source/vm/debug.c * changed HB_FUNCNAME( )() to HB_FUNC_EXEC( ) * harbour/utils/hbrun/Makefile * changed order of linked libraries * harbour/source/rtl/empty.c * changed EMPTY( ) - not it returns .T. when is not a function symbol * harbour/source/rtl/errorapi.c % replaced all hb_dynsym{Find,Get}*() by static variables initialized at HVM startup variables - it reduce the cost of creating and initializing error object about 50% * harbour/include/hbapifs.h * harbour/source/rtl/fssize.c * harbour/source/rtl/filesys.c * harbour/source/rtl/hbffind.c * changed to use 64bit file API + harbour/contrib/libct/ctextern.ch + added list with EXTERN requests for our CT3 function. List generated automatically from final binary CT lib created on Linux. --- harbour/ChangeLog | 41 +++++ harbour/contrib/gd/gdwrp.c | 2 +- harbour/contrib/libct/ctextern.ch | 273 ++++++++++++++++++++++++++++++ harbour/contrib/libmisc/hb_f.c | 2 +- harbour/contrib/samples/dbf.c | 2 +- harbour/contrib/samples/time.c | 10 +- harbour/doc/es/hb_apiln.txt | 2 +- harbour/include/hbapicdp.h | 2 +- harbour/include/hbapifs.h | 2 +- harbour/include/hbapilng.h | 2 +- harbour/source/rdd/dbcmd.c | 4 +- harbour/source/rdd/dbnubs.c | 48 +++--- harbour/source/rdd/hsx/cftsfunc.c | 26 +-- harbour/source/rtl/accept.c | 2 +- harbour/source/rtl/defpath.c | 2 +- harbour/source/rtl/empty.c | 4 +- harbour/source/rtl/errorapi.c | 129 ++++++++++---- harbour/source/rtl/fssize.c | 34 ++-- harbour/source/rtl/hbffind.c | 33 ++-- harbour/source/rtl/oemansi.c | 4 +- harbour/source/rtl/pad.c | 2 +- harbour/source/rtl/shadow.c | 2 +- harbour/source/rtl/trim.c | 2 +- harbour/source/vm/debug.c | 14 +- harbour/utils/hbrun/Makefile | 2 +- 25 files changed, 520 insertions(+), 126 deletions(-) create mode 100644 harbour/contrib/libct/ctextern.ch diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 651ed2c126..46cccee835 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,47 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-04-19 00:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/contrib/gd/gdwrp.c + * harbour/contrib/libmisc/hb_f.c + * harbour/contrib/samples/dbf.c + * harbour/contrib/samples/time.c + * harbour/doc/es/hb_apiln.txt + * harbour/include/hbapicdp.h + * harbour/include/hbapilng.h + * harbour/source/rdd/dbcmd.c + * harbour/source/rdd/dbnubs.c + * harbour/source/rdd/hsx/cftsfunc.c + * harbour/source/rtl/accept.c + * harbour/source/rtl/defpath.c + * harbour/source/rtl/oemansi.c + * harbour/source/rtl/pad.c + * harbour/source/rtl/shadow.c + * harbour/source/rtl/trim.c + * harbour/source/vm/debug.c + * changed HB_FUNCNAME( )() to HB_FUNC_EXEC( ) + + * harbour/utils/hbrun/Makefile + * changed order of linked libraries + + * harbour/source/rtl/empty.c + * changed EMPTY( ) - not it returns .T. when + is not a function symbol + + * harbour/source/rtl/errorapi.c + % replaced all hb_dynsym{Find,Get}*() by static variables initialized + at HVM startup variables - it reduce the cost of creating and + initializing error object about 50% + + * harbour/include/hbapifs.h + * harbour/source/rtl/fssize.c + * harbour/source/rtl/hbffind.c + * changed to use 64bit file API + + + harbour/contrib/libct/ctextern.ch + + added list with EXTERN requests for our CT3 function. List generated + automatically from final binary CT lib created on Linux. + 2007-04-18 10:43 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * harbour/source/codepage/cp_tpl.c + Added NOTE about the fact that hb_Translate() diff --git a/harbour/contrib/gd/gdwrp.c b/harbour/contrib/gd/gdwrp.c index 3f3e2b2f70..d17e7d3a6a 100644 --- a/harbour/contrib/gd/gdwrp.c +++ b/harbour/contrib/gd/gdwrp.c @@ -496,7 +496,7 @@ HB_FUNC( GDIMAGECREATE ) // gdImagePtr gdImageCreate(sx, sy) HB_FUNC( GDIMAGECREATEPALETTE ) // gdImagePtr gdImageCreatePalette(sx, sy) { // Alias of GDCreate() - HB_FUNCNAME( GDIMAGECREATE )(); + HB_FUNC_EXEC( GDIMAGECREATE ); } diff --git a/harbour/contrib/libct/ctextern.ch b/harbour/contrib/libct/ctextern.ch new file mode 100644 index 0000000000..b88ec3246b --- /dev/null +++ b/harbour/contrib/libct/ctextern.ch @@ -0,0 +1,273 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * The declarations for all harbour defined functions/procedures in + * Harbour CT3 compatible library + * + * Copyright 2007 Przemyslaw Czerpak + * www - http://www.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. + * + */ + +#ifndef HB_CTEXTERN_CH_ +#define HB_CTEXTERN_CH_ + +EXTERNAL ACOS +EXTERNAL ADDASCII +EXTERNAL ADDMONTH +EXTERNAL AFTERATNUM +EXTERNAL ASCIISUM +EXTERNAL ASCPOS +EXTERNAL ASIN +EXTERNAL ATADJUST +EXTERNAL ATAN +EXTERNAL ATN2 +EXTERNAL ATNUM +EXTERNAL ATREPL +EXTERNAL ATTOKEN +EXTERNAL BEFORATNUM +EXTERNAL BITTOC +EXTERNAL BOM +EXTERNAL BOQ +EXTERNAL BOY +EXTERNAL CEILING +EXTERNAL CELSIUS +EXTERNAL CENTER +EXTERNAL CHARADD +EXTERNAL CHARAND +EXTERNAL CHAREVEN +EXTERNAL CHARHIST +EXTERNAL CHARLIST +EXTERNAL CHARMIRR +EXTERNAL CHARMIX +EXTERNAL CHARNOLIST +EXTERNAL CHARNOT +EXTERNAL CHARODD +EXTERNAL CHARONE +EXTERNAL CHARONLY +EXTERNAL CHAROR +EXTERNAL CHARRELA +EXTERNAL CHARRELREP +EXTERNAL CHARREM +EXTERNAL CHARREPL +EXTERNAL CHARRLL +EXTERNAL CHARRLR +EXTERNAL CHARSHL +EXTERNAL CHARSHR +EXTERNAL CHARSLIST +EXTERNAL CHARSORT +EXTERNAL CHARSUB +EXTERNAL CHARSWAP +EXTERNAL CHARXOR +EXTERNAL CHECKSUM +EXTERNAL CLEARBIT +EXTERNAL COLORTON +EXTERNAL COS +EXTERNAL COSH +EXTERNAL COT +EXTERNAL COUNTLEFT +EXTERNAL COUNTRIGHT +EXTERNAL CRYPT +EXTERNAL CSETARGERR +EXTERNAL CSETATMUPA +EXTERNAL CSETCENT +EXTERNAL CSETCURS +EXTERNAL CSETKEY +EXTERNAL CSETREF +EXTERNAL CTCEXIT +EXTERNAL CTCINIT +EXTERNAL CTEXIT +EXTERNAL CTINIT +EXTERNAL CTOBIT +EXTERNAL CTODOW +EXTERNAL CTOF +EXTERNAL CTOMONTH +EXTERNAL CTON +EXTERNAL CTWINIT +EXTERNAL DAYSINMONTH +EXTERNAL DAYSTOMONTH +EXTERNAL DMY +EXTERNAL DOY +EXTERNAL DTOR +EXTERNAL ENHANCED +EXTERNAL EOM +EXTERNAL EOQ +EXTERNAL EOY +EXTERNAL EXPONENT +EXTERNAL FACT +EXTERNAL FAHRENHEIT +EXTERNAL FILEATTR +EXTERNAL FILEDATE +EXTERNAL FILESEEK +EXTERNAL FILESIZE +EXTERNAL FILETIME +EXTERNAL FLOOR +EXTERNAL FTOC +EXTERNAL FV +EXTERNAL GETPREC +EXTERNAL HB_GT_CTW +EXTERNAL HB_GT_CTW_DEFAULT +EXTERNAL INFINITY +EXTERNAL INVERTWIN +EXTERNAL ISBIT +EXTERNAL ISLEAP +EXTERNAL JUSTLEFT +EXTERNAL JUSTRIGHT +EXTERNAL LASTDAYOM +EXTERNAL LOG10 +EXTERNAL LTOC +EXTERNAL MANTISSA +EXTERNAL MDY +EXTERNAL NTOC +EXTERNAL NTOCDOW +EXTERNAL NTOCMONTH +EXTERNAL NTOCOLOR +EXTERNAL NUMAND +EXTERNAL NUMAT +EXTERNAL NUMHIGH +EXTERNAL NUMLOW +EXTERNAL NUMMIRR +EXTERNAL NUMNOT +EXTERNAL NUMOR +EXTERNAL NUMROL +EXTERNAL NUMTOKEN +EXTERNAL NUMXOR +EXTERNAL PADLEFT +EXTERNAL PADRIGHT +EXTERNAL PAYMENT +EXTERNAL PERIODS +EXTERNAL PI +EXTERNAL POSALPHA +EXTERNAL POSCHAR +EXTERNAL POSDEL +EXTERNAL POSDIFF +EXTERNAL POSEQUAL +EXTERNAL POSINS +EXTERNAL POSLOWER +EXTERNAL POSRANGE +EXTERNAL POSREPL +EXTERNAL POSUPPER +EXTERNAL PRINTREADY +EXTERNAL PRINTSTAT +EXTERNAL PV +EXTERNAL QUARTER +EXTERNAL RANGEREM +EXTERNAL RANGEREPL +EXTERNAL RATE +EXTERNAL REMALL +EXTERNAL REMLEFT +EXTERNAL REMRIGHT +EXTERNAL REPLALL +EXTERNAL REPLLEFT +EXTERNAL REPLRIGHT +EXTERNAL RESTGETS +EXTERNAL RESTTOKEN +EXTERNAL RTOD +EXTERNAL SAVEGETS +EXTERNAL SAVETOKEN +EXTERNAL SCREENATTR +EXTERNAL SCREENMIX +EXTERNAL SETATLIKE +EXTERNAL SETBIT +EXTERNAL SETCLEARA +EXTERNAL SETCLEARB +EXTERNAL SETFATTR +EXTERNAL SETLASTKEY +EXTERNAL SETPREC +EXTERNAL SIGN +EXTERNAL SIN +EXTERNAL SINH +EXTERNAL STANDARD +EXTERNAL STRDIFF +EXTERNAL STRSWAP +EXTERNAL TABEXPAND +EXTERNAL TABPACK +EXTERNAL TAN +EXTERNAL TANH +EXTERNAL TOKEN +EXTERNAL TOKENAT +EXTERNAL TOKENEND +EXTERNAL TOKENEXIT +EXTERNAL TOKENINIT +EXTERNAL TOKENLOWER +EXTERNAL TOKENNEXT +EXTERNAL TOKENNUM +EXTERNAL TOKENSEP +EXTERNAL TOKENUPPER +EXTERNAL UNSELECTED +EXTERNAL VALPOS +EXTERNAL WACLOSE +EXTERNAL WBOARD +EXTERNAL WBOX +EXTERNAL WCENTER +EXTERNAL WCLOSE +EXTERNAL WCOL +EXTERNAL WEEK +EXTERNAL WFCOL +EXTERNAL WFLASTCOL +EXTERNAL WFLASTROW +EXTERNAL WFORMAT +EXTERNAL WFROW +EXTERNAL WLASTCOL +EXTERNAL WLASTROW +EXTERNAL WMODE +EXTERNAL WMOVE +EXTERNAL WNUM +EXTERNAL WOPEN +EXTERNAL WORDONE +EXTERNAL WORDONLY +EXTERNAL WORDREM +EXTERNAL WORDREPL +EXTERNAL WORDSWAP +EXTERNAL WORDTOCHAR +EXTERNAL WROW +EXTERNAL WSELECT +EXTERNAL WSETMOVE +EXTERNAL WSETSHADOW +EXTERNAL WSTEP +EXTERNAL XTOC + + +#endif /* HB_CTEXTERN_CH_ */ diff --git a/harbour/contrib/libmisc/hb_f.c b/harbour/contrib/libmisc/hb_f.c index 2a9d81de7e..096ec66ec3 100644 --- a/harbour/contrib/libmisc/hb_f.c +++ b/harbour/contrib/libmisc/hb_f.c @@ -303,7 +303,7 @@ HB_FUNC( HB_FLASTREC ) old_offset = offset[area]; bIsEof = isEof[area]; - HB_FUNCNAME( HB_FGOBOTTOM )(); + HB_FUNC_EXEC( HB_FGOBOTTOM ); hb_retnl( last_rec[area] ); recno[area] = old_rec; diff --git a/harbour/contrib/samples/dbf.c b/harbour/contrib/samples/dbf.c index 9d6a79f497..8f589fbdfd 100644 --- a/harbour/contrib/samples/dbf.c +++ b/harbour/contrib/samples/dbf.c @@ -57,5 +57,5 @@ HB_FUNC_EXTERN( ALIAS ); HB_FUNC( DBF ) { - HB_FUNCNAME( ALIAS )(); + HB_FUNC_EXEC( ALIAS ); } diff --git a/harbour/contrib/samples/time.c b/harbour/contrib/samples/time.c index 2843b14adb..0a469e6d3d 100644 --- a/harbour/contrib/samples/time.c +++ b/harbour/contrib/samples/time.c @@ -65,35 +65,35 @@ HB_FUNC_EXTERN( ELAPTIME ); */ HB_FUNC( SECONDSASDAYS ) { - HB_FUNCNAME( DAYS )(); + HB_FUNC_EXEC( DAYS ); } /* TIMEASAMPM( ) --> + " am" / " pm" */ HB_FUNC( TIMEASAMPM ) { - HB_FUNCNAME( AMPM )(); + HB_FUNC_EXEC( AMPM ); } /* TIMEASSECONDS( ) --> */ HB_FUNC( TIMEASSECONDS ) { - HB_FUNCNAME( SECS )(); + HB_FUNC_EXEC( SECS ); } /* TIMEASSTRING( ) --> */ HB_FUNC( TIMEASSTRING ) { - HB_FUNCNAME( TSTRING )(); + HB_FUNC_EXEC( TSTRING ); } /* TIMEDIFF( , ) --> */ HB_FUNC( TIMEDIFF ) { - HB_FUNCNAME( ELAPTIME )(); + HB_FUNC_EXEC( ELAPTIME ); } /* TIMEISVALID( ) --> diff --git a/harbour/doc/es/hb_apiln.txt b/harbour/doc/es/hb_apiln.txt index 0a5e4e0fa6..cb11d487f9 100644 --- a/harbour/doc/es/hb_apiln.txt +++ b/harbour/doc/es/hb_apiln.txt @@ -594,7 +594,7 @@ * #define HB_LANG_REQUEST_( id ) extern HB_FUNC( HB_LANG_##id ); \ * void hb_lang_ForceLink( void ) \ * { \ - * HB_FUNCNAME( HB_LANG_##id )(); \ + * HB_FUNC_EXEC( HB_LANG_##id ); \ * } * * // Macro to publish a specific language module, for both C diff --git a/harbour/include/hbapicdp.h b/harbour/include/hbapicdp.h index 569aa33c2c..8b5ba9783d 100644 --- a/harbour/include/hbapicdp.h +++ b/harbour/include/hbapicdp.h @@ -66,7 +66,7 @@ HB_EXTERN_BEGIN #define HB_CODEPAGE_REQUEST_( id ) HB_FUNC_EXTERN( HB_CODEPAGE_##id ); \ void hb_codepage_ForceLink_##id( void ) \ { \ - HB_FUNCNAME( HB_CODEPAGE_##id )(); \ + HB_FUNC_EXEC( HB_CODEPAGE_##id ); \ } #define HB_CODEPAGE_ANNOUNCE( id ) HB_FUNC( HB_CODEPAGE_##id ) {} diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 6d4858827e..8459dd4da7 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -120,7 +120,7 @@ extern HB_EXPORT BOOL hb_fsEof ( FHANDLE hFileHandle ); /* determine extern HB_EXPORT USHORT hb_fsError ( void ); /* retrieve file system error */ extern HB_EXPORT USHORT hb_fsOsError ( void ); /* retrieve system dependant file system error */ extern HB_EXPORT BOOL hb_fsFile ( BYTE * pszFileName ); /* determine if a file exists */ -extern HB_EXPORT ULONG hb_fsFSize ( BYTE * pszFileName, BOOL bUseDirEntry ); /* determine the size of a file */ +extern HB_EXPORT HB_FOFFSET hb_fsFSize ( BYTE * pszFileName, BOOL bUseDirEntry ); /* determine the size of a file */ extern HB_EXPORT FHANDLE hb_fsExtOpen ( BYTE * pszFileName, BYTE * pDefExt, USHORT uiFlags, BYTE * pPaths, PHB_ITEM pError ); /* open a file using default extension and a list of paths */ extern HB_EXPORT USHORT hb_fsIsDrv ( BYTE nDrive ); /* determine if a drive number is a valid drive */ diff --git a/harbour/include/hbapilng.h b/harbour/include/hbapilng.h index 27f568ac63..a0c5d5ee93 100644 --- a/harbour/include/hbapilng.h +++ b/harbour/include/hbapilng.h @@ -66,7 +66,7 @@ HB_EXTERN_BEGIN #define HB_LANG_REQUEST_( id ) extern HB_FUNC( HB_LANG_##id ); \ void hb_lang_ForceLink( void ) \ { \ - HB_FUNCNAME( HB_LANG_##id )(); \ + HB_FUNC_EXEC( HB_LANG_##id ); \ } /* Macro to publish a specific language module, for both C and Harbour level */ diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index f3edf14664..88362ab4a3 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -164,7 +164,7 @@ static ERRCODE hb_waUnsupported( AREAP pArea ) if( !pArea ) { - HB_FUNCNAME( RDDSYS )(); + HB_FUNC_EXEC( RDDSYS ); } pError = hb_errNew(); @@ -3551,7 +3551,7 @@ HB_FUNC( RDDREGISTER ) /* Same as LASTREC() */ HB_FUNC( RECCOUNT ) { - HB_FUNCNAME( LASTREC )(); + HB_FUNC_EXEC( LASTREC ); } HB_FUNC( RECNO ) diff --git a/harbour/source/rdd/dbnubs.c b/harbour/source/rdd/dbnubs.c index d8edebb3ac..506e2f9c0e 100644 --- a/harbour/source/rdd/dbnubs.c +++ b/harbour/source/rdd/dbnubs.c @@ -80,42 +80,42 @@ HB_FUNC_EXTERN( DBSELECTAREA ); HB_FUNC( __DBSEEK ) { - HB_FUNCNAME( DBSEEK )(); + HB_FUNC_EXEC( DBSEEK ); } HB_FUNC( __DBSKIP ) { - HB_FUNCNAME( DBSKIP )(); + HB_FUNC_EXEC( DBSKIP ); } HB_FUNC( __DBGOTOP ) { - HB_FUNCNAME( DBGOTOP )(); + HB_FUNC_EXEC( DBGOTOP ); } HB_FUNC( __DBGOBOTTOM ) { - HB_FUNCNAME( DBGOBOTTOM )(); + HB_FUNC_EXEC( DBGOBOTTOM ); } HB_FUNC( __DBGOTO ) { - HB_FUNCNAME( DBGOTO )(); + HB_FUNC_EXEC( DBGOTO ); } HB_FUNC( __DBAPPEND ) { - HB_FUNCNAME( DBAPPEND )(); + HB_FUNC_EXEC( DBAPPEND ); } HB_FUNC( __DBDELETE ) { - HB_FUNCNAME( DBDELETE )(); + HB_FUNC_EXEC( DBDELETE ); } HB_FUNC( __DBRECALL ) { - HB_FUNCNAME( DBRECALL )(); + HB_FUNC_EXEC( DBRECALL ); } /* NOTE: Clipper does exactly that, __dbCommit() will call dbCommitAll() @@ -123,82 +123,82 @@ HB_FUNC( __DBRECALL ) HB_FUNC( __DBCOMMIT ) { - HB_FUNCNAME( DBCOMMITALL )(); + HB_FUNC_EXEC( DBCOMMITALL ); } HB_FUNC( __DBCOMMITALL ) { - HB_FUNCNAME( DBCOMMITALL )(); + HB_FUNC_EXEC( DBCOMMITALL ); } HB_FUNC( __DBUNLOCK ) { - HB_FUNCNAME( DBUNLOCK )(); + HB_FUNC_EXEC( DBUNLOCK ); } HB_FUNC( __DBUNLALL ) { - HB_FUNCNAME( DBUNLOCKALL )(); + HB_FUNC_EXEC( DBUNLOCKALL ); } HB_FUNC( __DBSETFILTER ) { - HB_FUNCNAME( DBSETFILTER )(); + HB_FUNC_EXEC( DBSETFILTER ); } HB_FUNC( __DBCLEARRELATION ) { - HB_FUNCNAME( DBCLEARRELATION )(); + HB_FUNC_EXEC( DBCLEARRELATION ); } HB_FUNC( __DBSETRELATION ) { - HB_FUNCNAME( DBSETRELATION )(); + HB_FUNC_EXEC( DBSETRELATION ); } HB_FUNC( __DBREINDEX ) { - HB_FUNCNAME( DBREINDEX )(); + HB_FUNC_EXEC( DBREINDEX ); } HB_FUNC( __DBCREATINDEX ) { - HB_FUNCNAME( DBCREATEINDEX )(); + HB_FUNC_EXEC( DBCREATEINDEX ); } HB_FUNC( __DBCLEARINDEX ) { - HB_FUNCNAME( DBCLEARINDEX )(); + HB_FUNC_EXEC( DBCLEARINDEX ); } HB_FUNC( __DBSETINDEX ) { - HB_FUNCNAME( DBSETINDEX )(); + HB_FUNC_EXEC( DBSETINDEX ); } HB_FUNC( __DBSETORDER ) { - HB_FUNCNAME( DBSETORDER )(); + HB_FUNC_EXEC( DBSETORDER ); } HB_FUNC( __DBCLOSEAREA ) { - HB_FUNCNAME( DBCLOSEALL )(); + HB_FUNC_EXEC( DBCLOSEALL ); } HB_FUNC( __DBCLOSE ) { - HB_FUNCNAME( DBCLOSEAREA )(); + HB_FUNC_EXEC( DBCLOSEAREA ); } HB_FUNC( __DBUSE ) { - HB_FUNCNAME( DBUSEAREA )(); + HB_FUNC_EXEC( DBUSEAREA ); } HB_FUNC( __DBSELECT ) { - HB_FUNCNAME( DBSELECTAREA )(); + HB_FUNC_EXEC( DBSELECTAREA ); } #endif diff --git a/harbour/source/rdd/hsx/cftsfunc.c b/harbour/source/rdd/hsx/cftsfunc.c index 5b7d965dd6..4f556093ac 100644 --- a/harbour/source/rdd/hsx/cftsfunc.c +++ b/harbour/source/rdd/hsx/cftsfunc.c @@ -75,65 +75,65 @@ HB_FUNC_EXTERN( HS_VERSION ); HB_FUNC( CFTSADD ) { - HB_FUNCNAME( HS_ADD )(); + HB_FUNC_EXEC( HS_ADD ); } HB_FUNC( CFTSCLOSE ) { - HB_FUNCNAME( HS_CLOSE )(); + HB_FUNC_EXEC( HS_CLOSE ); } HB_FUNC( CFTSCREA ) { - HB_FUNCNAME( HS_CREATE )(); + HB_FUNC_EXEC( HS_CREATE ); } HB_FUNC( CFTSDELETE ) { - HB_FUNCNAME( HS_DELETE )(); + HB_FUNC_EXEC( HS_DELETE ); } HB_FUNC( CFTSIFDEL ) { - HB_FUNCNAME( HS_IFDEL )(); + HB_FUNC_EXEC( HS_IFDEL ); } HB_FUNC( CFTSNEXT ) { - HB_FUNCNAME( HS_NEXT )(); + HB_FUNC_EXEC( HS_NEXT ); } HB_FUNC( CFTSOPEN ) { - HB_FUNCNAME( HS_OPEN )(); + HB_FUNC_EXEC( HS_OPEN ); } HB_FUNC( CFTSRECN ) { - HB_FUNCNAME( HS_KEYCOUNT )(); + HB_FUNC_EXEC( HS_KEYCOUNT ); } HB_FUNC( CFTSREPLAC ) { - HB_FUNCNAME( HS_REPLACE )(); + HB_FUNC_EXEC( HS_REPLACE ); } HB_FUNC( CFTSSET ) { - HB_FUNCNAME( HS_SET )(); + HB_FUNC_EXEC( HS_SET ); } HB_FUNC( CFTSUNDEL ) { - HB_FUNCNAME( HS_UNDELETE )(); + HB_FUNC_EXEC( HS_UNDELETE ); } HB_FUNC( CFTSVERI ) { - HB_FUNCNAME( HS_VERIFY )(); + HB_FUNC_EXEC( HS_VERIFY ); } HB_FUNC( CFTSVERS ) { - HB_FUNCNAME( HS_VERSION )(); + HB_FUNC_EXEC( HS_VERSION ); } diff --git a/harbour/source/rtl/accept.c b/harbour/source/rtl/accept.c index d289b745e3..a73bd50529 100644 --- a/harbour/source/rtl/accept.c +++ b/harbour/source/rtl/accept.c @@ -89,7 +89,7 @@ HB_FUNC( __ACCEPT ) /* cPrompt(s) passed ? */ if( hb_pcount() >= 1 ) - HB_FUNCNAME( QOUT )(); + HB_FUNC_EXEC( QOUT ); ulLen = 0; input = 0; diff --git a/harbour/source/rtl/defpath.c b/harbour/source/rtl/defpath.c index 9f58cedfdc..b3ae34e788 100644 --- a/harbour/source/rtl/defpath.c +++ b/harbour/source/rtl/defpath.c @@ -93,7 +93,7 @@ HB_FUNC( DEFPATH ) HB_FUNC( __DEFPATH ) { - HB_FUNCNAME( DEFPATH )(); + HB_FUNC_EXEC( DEFPATH ); } #endif diff --git a/harbour/source/rtl/empty.c b/harbour/source/rtl/empty.c index cfe964ceff..dd9b5dd4cc 100644 --- a/harbour/source/rtl/empty.c +++ b/harbour/source/rtl/empty.c @@ -56,6 +56,7 @@ HB_FUNC( EMPTY ) { PHB_ITEM pItem = hb_param( 1, HB_IT_ANY ); + PHB_SYMB pSym; switch( hb_itemType( pItem ) ) { @@ -101,7 +102,8 @@ HB_FUNC( EMPTY ) break; case HB_IT_SYMBOL: - hb_retl( hb_itemGetSymbol( pItem ) == NULL ); + pSym = hb_itemGetSymbol( pItem ); + hb_retl( pSym == NULL || pSym->value.pFunPtr == NULL ); break; default: diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index c8fff808d1..aff56ae9ea 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -93,6 +93,36 @@ static HB_ITEM_PTR s_errorBlock; static int s_iLaunchCount = 0; static USHORT s_uiErrorDOS = 0; /* The value of DOSERROR() */ +static PHB_DYNS s_msgErrorNew; +static PHB_DYNS s_msg_ARGS; +static PHB_DYNS s_msg_CANDEFAULT; +static PHB_DYNS s_msgCANDEFAULT; +static PHB_DYNS s_msg_CANRETRY; +static PHB_DYNS s_msgCANRETRY; +static PHB_DYNS s_msg_CANSUBSTITUTE; +static PHB_DYNS s_msgCANSUBSTITUTE; +static PHB_DYNS s_msg_DESCRIPTION; +static PHB_DYNS s_msgDESCRIPTION; +static PHB_DYNS s_msg_FILENAME; +static PHB_DYNS s_msgFILENAME; +static PHB_DYNS s_msg_GENCODE; +static PHB_DYNS s_msgGENCODE; +static PHB_DYNS s_msg_OPERATION; +static PHB_DYNS s_msgOPERATION; +static PHB_DYNS s_msg_OSCODE; +static PHB_DYNS s_msgOSCODE; +static PHB_DYNS s_msg_SEVERITY; +static PHB_DYNS s_msgSEVERITY; +static PHB_DYNS s_msg_SUBCODE; +static PHB_DYNS s_msgSUBCODE; +static PHB_DYNS s_msg_SUBSYSTEM; +static PHB_DYNS s_msgSUBSYSTEM; +static PHB_DYNS s_msg_TRIES; +static PHB_DYNS s_msgTRIES; + +#define HB_MSGSYM_INIT( s ) s_msg##s = hb_dynsymGetCase( HB_MACRO2STRING( s ) ) + + HB_FUNC_EXTERN( ERRORNEW ); /* NOTE: This is called via its symbol name, so we should make sure @@ -102,7 +132,7 @@ void hb_errForceLink( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_errForceLink()")); - HB_FUNCNAME( ERRORNEW )(); + HB_FUNC_EXEC( ERRORNEW ); } /* There's a similar undocumented, internal functions in CA-Cl*pper named @@ -152,10 +182,37 @@ void hb_errInit( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_errInit()")); - /* initialize an item - * NOTE: hb_itemClear() cannot be used to initialize an item because - * memory occupied by the item can contain garbage bits - */ + /* error function */ + s_msgErrorNew = hb_dynsymGetCase( "ERRORNEW" ); + + /* initialize message symbols */ + HB_MSGSYM_INIT( _ARGS ); + HB_MSGSYM_INIT( _CANDEFAULT ); + HB_MSGSYM_INIT( CANDEFAULT ); + HB_MSGSYM_INIT( _CANRETRY ); + HB_MSGSYM_INIT( CANRETRY ); + HB_MSGSYM_INIT( _CANSUBSTITUTE ); + HB_MSGSYM_INIT( CANSUBSTITUTE ); + HB_MSGSYM_INIT( _DESCRIPTION ); + HB_MSGSYM_INIT( DESCRIPTION ); + HB_MSGSYM_INIT( _FILENAME ); + HB_MSGSYM_INIT( FILENAME ); + HB_MSGSYM_INIT( _GENCODE ); + HB_MSGSYM_INIT( GENCODE ); + HB_MSGSYM_INIT( _OPERATION ); + HB_MSGSYM_INIT( OPERATION ); + HB_MSGSYM_INIT( _OSCODE ); + HB_MSGSYM_INIT( OSCODE ); + HB_MSGSYM_INIT( _SEVERITY ); + HB_MSGSYM_INIT( SEVERITY ); + HB_MSGSYM_INIT( _SUBCODE ); + HB_MSGSYM_INIT( SUBCODE ); + HB_MSGSYM_INIT( _SUBSYSTEM ); + HB_MSGSYM_INIT( SUBSYSTEM ); + HB_MSGSYM_INIT( _TRIES ); + HB_MSGSYM_INIT( TRIES ); + + /* initialize an item for error block */ s_errorBlock = hb_itemNew( NULL ); } @@ -174,7 +231,7 @@ PHB_ITEM hb_errNew( void ) pReturn = hb_itemNew( NULL ); - hb_vmPushSymbol( hb_dynsymGetSymbol( "ERRORNEW" ) ); + hb_vmPushDynSym( s_msgErrorNew ); hb_vmPushNil(); hb_vmDo( 0 ); @@ -361,7 +418,7 @@ char * hb_errGetDescription( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetDescription(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "DESCRIPTION" ) ); + hb_vmPushDynSym( s_msgDESCRIPTION ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -372,7 +429,7 @@ PHB_ITEM hb_errPutDescription( PHB_ITEM pError, const char * szDescription ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutDescription(%p, %s)", pError, szDescription)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_DESCRIPTION" ) ); + hb_vmPushDynSym( s_msg_DESCRIPTION ); hb_vmPush( pError ); hb_vmPushString( ( char * ) szDescription, strlen( szDescription ) ); hb_vmSend( 1 ); @@ -384,7 +441,7 @@ char * hb_errGetFileName( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetFileName(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "FILENAME" ) ); + hb_vmPushDynSym( s_msgFILENAME ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -395,7 +452,7 @@ PHB_ITEM hb_errPutFileName( PHB_ITEM pError, const char * szFileName ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutFileName(%p, %s)", pError, szFileName)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_FILENAME" ) ); + hb_vmPushDynSym( s_msg_FILENAME ); hb_vmPush( pError ); hb_vmPushString( ( char * ) szFileName, strlen( szFileName ) ); hb_vmSend( 1 ); @@ -407,7 +464,7 @@ USHORT hb_errGetGenCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetGenCode(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "GENCODE" ) ); + hb_vmPushDynSym( s_msgGENCODE ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -418,7 +475,7 @@ PHB_ITEM hb_errPutGenCode( PHB_ITEM pError, USHORT uiGenCode ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutGenCode(%p, %hu)", pError, uiGenCode)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_GENCODE" ) ); + hb_vmPushDynSym( s_msg_GENCODE ); hb_vmPush( pError ); hb_vmPushInteger( uiGenCode ); hb_vmSend( 1 ); @@ -430,7 +487,7 @@ char * hb_errGetOperation( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetOperation(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "OPERATION" ) ); + hb_vmPushDynSym( s_msgOPERATION ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -447,7 +504,7 @@ PHB_ITEM hb_errPutOperation( PHB_ITEM pError, const char * szOperation ) if( pSym ) szOperation = pSym->szName; } - hb_vmPushSymbol( hb_dynsymGetSymbol( "_OPERATION" ) ); + hb_vmPushDynSym( s_msg_OPERATION ); hb_vmPush( pError ); hb_vmPushString( ( char * ) szOperation, strlen( szOperation ) ); hb_vmSend( 1 ); @@ -459,7 +516,7 @@ USHORT hb_errGetOsCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetOsCode(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "OSCODE" ) ); + hb_vmPushDynSym( s_msgOSCODE ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -470,7 +527,7 @@ PHB_ITEM hb_errPutOsCode( PHB_ITEM pError, USHORT uiOsCode ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutOsCode(%p, %hu)", pError, uiOsCode)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_OSCODE" ) ); + hb_vmPushDynSym( s_msg_OSCODE ); hb_vmPush( pError ); hb_vmPushInteger( uiOsCode ); hb_vmSend( 1 ); @@ -482,7 +539,7 @@ USHORT hb_errGetSeverity( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetSeverity(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "SEVERITY" ) ); + hb_vmPushDynSym( s_msgSEVERITY ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -493,7 +550,7 @@ PHB_ITEM hb_errPutSeverity( PHB_ITEM pError, USHORT uiSeverity ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutSeverity(%p, %hu)", pError, uiSeverity)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_SEVERITY" ) ); + hb_vmPushDynSym( s_msg_SEVERITY ); hb_vmPush( pError ); hb_vmPushInteger( uiSeverity ); hb_vmSend( 1 ); @@ -505,7 +562,7 @@ USHORT hb_errGetSubCode( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetSubCode(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "SUBCODE" ) ); + hb_vmPushDynSym( s_msgSUBCODE ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -516,7 +573,7 @@ PHB_ITEM hb_errPutSubCode( PHB_ITEM pError, USHORT uiSubCode ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutSubCode(%p, %hu)", pError, uiSubCode)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_SUBCODE" ) ); + hb_vmPushDynSym( s_msg_SUBCODE ); hb_vmPush( pError ); hb_vmPushInteger( uiSubCode ); hb_vmSend( 1 ); @@ -528,7 +585,7 @@ char * hb_errGetSubSystem( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetSubSytem(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "SUBSYSTEM" ) ); + hb_vmPushDynSym( s_msgSUBSYSTEM ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -539,7 +596,7 @@ PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, const char * szSubSystem ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutSubSytem(%p, %s)", pError, szSubSystem)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_SUBSYSTEM" ) ); + hb_vmPushDynSym( s_msg_SUBSYSTEM ); hb_vmPush( pError ); hb_vmPushString( ( char * ) szSubSystem, strlen( szSubSystem ) ); hb_vmSend( 1 ); @@ -551,7 +608,7 @@ USHORT hb_errGetTries( PHB_ITEM pError ) { HB_TRACE(HB_TR_DEBUG, ("hb_errGetTries(%p)", pError)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "TRIES" ) ); + hb_vmPushDynSym( s_msgTRIES ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -562,7 +619,7 @@ PHB_ITEM hb_errPutTries( PHB_ITEM pError, USHORT uiTries ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutTries(%p, %hu)", pError, uiTries)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_TRIES" ) ); + hb_vmPushDynSym( s_msg_TRIES ); hb_vmPush( pError ); hb_vmPushInteger( uiTries ); hb_vmSend( 1 ); @@ -578,7 +635,7 @@ USHORT hb_errGetFlags( PHB_ITEM pError ) /* ; */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "CANRETRY" ) ); + hb_vmPushDynSym( s_msgCANRETRY ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -587,7 +644,7 @@ USHORT hb_errGetFlags( PHB_ITEM pError ) /* ; */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "CANSUBSTITUTE" ) ); + hb_vmPushDynSym( s_msgCANSUBSTITUTE ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -596,7 +653,7 @@ USHORT hb_errGetFlags( PHB_ITEM pError ) /* ; */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "CANDEFAULT" ) ); + hb_vmPushDynSym( s_msgCANDEFAULT ); hb_vmPush( pError ); hb_vmSend( 0 ); @@ -612,21 +669,21 @@ PHB_ITEM hb_errPutFlags( PHB_ITEM pError, USHORT uiFlags ) { HB_TRACE(HB_TR_DEBUG, ("hb_errPutFlags(%p, %hu)", pError, uiFlags)); - hb_vmPushSymbol( hb_dynsymGetSymbol( "_CANRETRY" ) ); + hb_vmPushDynSym( s_msg_CANRETRY ); hb_vmPush( pError ); hb_vmPushLogical( ( uiFlags & EF_CANRETRY ) ? TRUE : FALSE ); hb_vmSend( 1 ); /* ; */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_CANSUBSTITUTE" ) ); + hb_vmPushDynSym( s_msg_CANSUBSTITUTE ); hb_vmPush( pError ); hb_vmPushLogical( ( uiFlags & EF_CANSUBSTITUTE ) ? TRUE : FALSE ); hb_vmSend( 1 ); /* ; */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_CANDEFAULT" ) ); + hb_vmPushDynSym( s_msg_CANDEFAULT ); hb_vmPush( pError ); hb_vmPushLogical( ( uiFlags & EF_CANDEFAULT ) ? TRUE : FALSE ); hb_vmSend( 1 ); @@ -655,7 +712,7 @@ PHB_ITEM hb_errPutArgs( PHB_ITEM pError, ULONG ulArgCount, ... ) /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); @@ -729,7 +786,7 @@ PHB_ITEM hb_errRT_SubstParams( const char *szSubSystem, ULONG ulGenCode, ULONG u pArray = hb_arrayBaseParams(); /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); @@ -809,7 +866,7 @@ USHORT hb_errRT_BASE( ULONG ulGenCode, ULONG ulSubCode, const char * szDescripti if ( pArray ) { /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); @@ -868,7 +925,7 @@ USHORT hb_errRT_BASE_Ext1( ULONG ulGenCode, ULONG ulSubCode, const char * szDesc if ( pArray ) { /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); @@ -926,7 +983,7 @@ PHB_ITEM hb_errRT_BASE_Subst( ULONG ulGenCode, ULONG ulSubCode, const char * szD if ( pArray ) { /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); @@ -983,7 +1040,7 @@ void hb_errRT_BASE_SubstR( ULONG ulGenCode, ULONG ulSubCode, const char * szDesc if ( pArray ) { /* Assign the new array to the object data item. */ - hb_vmPushSymbol( hb_dynsymGetSymbol( "_ARGS" ) ); + hb_vmPushDynSym( s_msg_ARGS ); hb_vmPush( pError ); hb_vmPush( pArray ); hb_vmSend( 1 ); diff --git a/harbour/source/rtl/fssize.c b/harbour/source/rtl/fssize.c index 61d80e4b66..0934ddc51d 100644 --- a/harbour/source/rtl/fssize.c +++ b/harbour/source/rtl/fssize.c @@ -51,6 +51,10 @@ * */ +#if defined(HB_OS_LINUX) +# define _LARGEFILE64_SOURCE +#endif + #include "hbapi.h" #include "hbapifs.h" @@ -58,19 +62,27 @@ #include #include -ULONG hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry ) +HB_FOFFSET hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry ) { if( bUseDirEntry ) { +#if defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64) + /* + * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is + * define and efectively enables lseek64/flock64/ftruncate64 functions + * on 32bit machines. + */ + struct stat64 statbuf; + if( stat64( ( char * ) pszFileName, &statbuf ) == 0 ) +#else struct stat statbuf; - if( stat( ( char * ) pszFileName, &statbuf ) == 0 ) +#endif { - errno = 0; - hb_fsSetError( 0 ); - return ( ULONG ) statbuf.st_size; + return ( HB_FOFFSET ) statbuf.st_size; } + hb_fsSetError( ( USHORT ) FS_ERROR ); } else { @@ -78,19 +90,15 @@ ULONG hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry ) if( hFileHandle != FS_ERROR ) { - ULONG ulPos; + HB_FOFFSET ulPos; - ulPos = hb_fsSeek( hFileHandle, 0, SEEK_END ); + ulPos = hb_fsSeekLarge( hFileHandle, 0, SEEK_END ); hb_fsClose( hFileHandle ); - - errno = 0; - hb_fsSetError( 0 ); return ulPos; } } - hb_fsSetError( ( USHORT ) FS_ERROR ); return 0; } @@ -98,8 +106,8 @@ ULONG hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry ) HB_FUNC( HB_FSIZE ) { - hb_retnl( ISCHAR( 1 ) ? hb_fsFSize( ( BYTE * ) hb_parc( 1 ), - ISLOG( 2 ) ? hb_parl( 2 ) : TRUE ) : 0 ); + hb_retnint( ISCHAR( 1 ) ? hb_fsFSize( ( BYTE * ) hb_parc( 1 ), + ISLOG( 2 ) ? hb_parl( 2 ) : TRUE ) : 0 ); } #endif diff --git a/harbour/source/rtl/hbffind.c b/harbour/source/rtl/hbffind.c index 356b8bb611..ea82029f5c 100644 --- a/harbour/source/rtl/hbffind.c +++ b/harbour/source/rtl/hbffind.c @@ -52,6 +52,10 @@ * */ +#if defined(HB_OS_LINUX) +# define _LARGEFILE64_SOURCE +#endif + #define INCL_DOSFILEMGR #define INCL_DOSERRORS #define HB_OS_WIN_32_USED @@ -61,6 +65,7 @@ #include "hbdate.h" #include "hb_io.h" + HB_FILE_VER( "$Id$" ) /* ------------------------------------------------------------- */ @@ -682,21 +687,29 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind ) if( bFound ) { - struct stat sStat; - hb_strncpy( dirname, info->path, sizeof( dirname ) - 1 ); hb_strncat( dirname, info->entry->d_name, sizeof( dirname ) - 1 ); - if( stat( dirname, &sStat ) != 0 ) - printf("\n%s (%i)", dirname, errno ); - - strncpy( ffind->szName, info->entry->d_name, _POSIX_PATH_MAX ); - ffind->size = sStat.st_size; - - raw_attr = sStat.st_mode; - { time_t ftime; struct tm * ft; +#if defined(HB_OS_LINUX) && defined(__USE_LARGEFILE64) + /* + * The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is + * define and efectively enables lseek64/flock64/ftruncate64 functions + * on 32bit machines. + */ + struct stat64 sStat; + if( stat64( dirname, &sStat ) != 0 ) +#else + struct stat sStat; + if( stat( dirname, &sStat ) != 0 ) +#endif + printf("\n%s (%i)", dirname, errno ); + + strncpy( ffind->szName, info->entry->d_name, _POSIX_PATH_MAX ); + ffind->size = sStat.st_size; + + raw_attr = sStat.st_mode; ftime = sStat.st_mtime; ft = localtime( &ftime ); diff --git a/harbour/source/rtl/oemansi.c b/harbour/source/rtl/oemansi.c index 87aeb55cfe..07ca879e19 100644 --- a/harbour/source/rtl/oemansi.c +++ b/harbour/source/rtl/oemansi.c @@ -110,14 +110,14 @@ HB_FUNC( HB_OEMTOANSI ) HB_FUNC( CONVTOOEMCP ) { - HB_FUNCNAME( HB_ANSITOOEM )(); + HB_FUNC_EXEC( HB_ANSITOOEM ); } /* NOTE: Xbase++ compatible function */ HB_FUNC( CONVTOANSICP ) { - HB_FUNCNAME( HB_OEMTOANSI )(); + HB_FUNC_EXEC( HB_OEMTOANSI ); } #endif diff --git a/harbour/source/rtl/pad.c b/harbour/source/rtl/pad.c index 19d0fcd648..6e734d8461 100644 --- a/harbour/source/rtl/pad.c +++ b/harbour/source/rtl/pad.c @@ -57,5 +57,5 @@ HB_FUNC_EXTERN( PADR ); /* synonymn for PADR */ HB_FUNC( PAD ) { - HB_FUNCNAME( PADR )(); + HB_FUNC_EXEC( PADR ); } diff --git a/harbour/source/rtl/shadow.c b/harbour/source/rtl/shadow.c index 0282201e0d..678e515000 100644 --- a/harbour/source/rtl/shadow.c +++ b/harbour/source/rtl/shadow.c @@ -81,7 +81,7 @@ HB_FUNC( HB_CLRAREA ) HB_FUNC( DBGSHADOW ) { - HB_FUNCNAME( HB_SHADOW )(); + HB_FUNC_EXEC( HB_SHADOW ); } #endif diff --git a/harbour/source/rtl/trim.c b/harbour/source/rtl/trim.c index 9856fc343c..4be08edf2d 100644 --- a/harbour/source/rtl/trim.c +++ b/harbour/source/rtl/trim.c @@ -132,7 +132,7 @@ HB_FUNC( RTRIM ) /* synonymn for RTRIM */ HB_FUNC( TRIM ) { - HB_FUNCNAME( RTRIM )(); + HB_FUNC_EXEC( RTRIM ); } /* trims leading and trailing spaces from a string */ diff --git a/harbour/source/vm/debug.c b/harbour/source/vm/debug.c index 99c916c4d0..f3049bb5e5 100644 --- a/harbour/source/vm/debug.c +++ b/harbour/source/vm/debug.c @@ -255,35 +255,35 @@ HB_FUNC( HB_DBG_VMVARLSET ) HB_FUNC( __VMSTKLCOUNT ) { - HB_FUNCNAME(HB_DBG_VMSTKLCOUNT)(); + HB_FUNC_EXEC(HB_DBG_VMSTKLCOUNT); } HB_FUNC( __VMPARLLIST ) { - HB_FUNCNAME(HB_DBG_VMPARLLIST)(); + HB_FUNC_EXEC(HB_DBG_VMPARLLIST); } HB_FUNC( __VMSTKLLIST ) { - HB_FUNCNAME(HB_DBG_VMSTKLLIST)(); + HB_FUNC_EXEC(HB_DBG_VMSTKLLIST); } HB_FUNC( __VMVARLGET ) { - HB_FUNCNAME(HB_DBG_VMVARLGET)(); + HB_FUNC_EXEC(HB_DBG_VMVARLGET); } HB_FUNC( __VMVARLSET ) { - HB_FUNCNAME(HB_DBG_VMVARLSET)(); + HB_FUNC_EXEC(HB_DBG_VMVARLSET); } HB_FUNC( __VMSTKGLIST ) { - HB_FUNCNAME(HB_DBG_VMSTKGLIST)(); + HB_FUNC_EXEC(HB_DBG_VMSTKGLIST); } HB_FUNC( __VMSTKGCOUNT ) { - HB_FUNCNAME(HB_DBG_VMSTKGCOUNT)(); + HB_FUNC_EXEC(HB_DBG_VMSTKGCOUNT); } diff --git a/harbour/utils/hbrun/Makefile b/harbour/utils/hbrun/Makefile index 146ae72e0b..f61976060a 100644 --- a/harbour/utils/hbrun/Makefile +++ b/harbour/utils/hbrun/Makefile @@ -24,7 +24,7 @@ LIBS=\ vm \ macro \ pp \ - common \ compiler \ + common \ include $(TOP)$(ROOT)config/bin.cf