diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 42feee6cc0..c896c1201b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,46 @@ +2001-11-07 00:11 UTC+0100 Viktor Szakats + + * include/hbapifs.h + * source/rtl/filesys.c + + Added hb_fsCreateEx() function which is similar to hb_fsCreate() + with the plus that the opening mode can be also specified. + + * include/hbextern.ch + * source/rtl/philes.c + + Added HB_FCREATE() where you can specifiy the opening mode using + the FO_* contants. + + * source/lang/Makefile + * makefile.bc + * makefile.vc + + Added some new language files. + + * include/Makefile + ! Synced with the actual list of header files. This fixes the + installation with the GNU-make system. + + * source/rtl/fstemp.c + * include/hbapifs.h + * Changed to make use of hb_fsCreateEx(), and open the temp file + in exclusive mode. + + * source/rdd/hbdbsort.c + * Now uses hb_fsCreateTemp() + + * make_gnu.bat + * bin/bld.bat + ! MinGW name change. + + * include/hbapigt.h + + Added some functions which have incompatible prototypes with + CA-Clipper Extend System. + + * source/vm/extend.c + * Some formatting. + + * source/vm/mainlgtk.c + ! Fixed CVS header. + 2001-11-06 19:28 GMT-3 Horacio Roldan * source/rdd/dbfcdx/dbfcdx2.h * source/rdd/dbfcdx/dbfcdx1.c @@ -8,7 +51,7 @@ * tests/Makefile * testprof.prg was missing. Added. -2001-11-06 06:20 GMT -3 Luiz Rafael Culik +2001-11-06 06:20 GMT -3 Luiz Rafael Culik * source/debug/dbgtarr.prg * Some enhacementes . Now you can use Page up/Page Down keys for movement * source/rtl/gtwin/gtwin.c diff --git a/harbour/bin/bld.bat b/harbour/bin/bld.bat index 7844edb06c..d3f4d68438 100644 --- a/harbour/bin/bld.bat +++ b/harbour/bin/bld.bat @@ -66,7 +66,7 @@ if "%HB_INC_INSTALL%" == "" set HB_INC_INSTALL=..\include\ echo - When HB_ARCHITECTURE=w32 echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit) echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit) - echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit) + echo - mingw32 (Cygnus/MinGW GNU C, Windows 32-bit) echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit) echo - icc (IBM Visual Age C++, Windows 32-bit) echo - msvc (Microsoft Visual C++, Windows 32-bit) diff --git a/harbour/include/Makefile b/harbour/include/Makefile index 51d8ae9efb..fce228cd3b 100644 --- a/harbour/include/Makefile +++ b/harbour/include/Makefile @@ -16,6 +16,7 @@ C_HEADERS=\ hbapirdd.h \ hbcomp.h \ hbdate.h \ + hbdbf.h \ hbdbsort.h \ hbdefs.h \ hberrors.h \ @@ -23,14 +24,19 @@ C_HEADERS=\ hbhash.h \ hbinit.h \ hbmacro.h \ + hbmath.h \ + hbmsetup.h \ hbpcode.h \ hbpp.h \ + hbrddcdx.h \ hbrdddbf.h \ hbrdddel.h \ + hbrddntx.h \ hbrddsdf.h \ hbrddwrk.h \ hbset.h \ hbsetup.h \ + hbstack.h \ hbtrace.h \ hbver.h \ hbvm.h \ @@ -41,6 +47,7 @@ PRG_HEADERS=\ achoice.ch \ assert.ch \ box.ch \ + button.ch \ color.ch \ common.ch \ dbedit.ch \ @@ -49,15 +56,18 @@ PRG_HEADERS=\ error.ch \ fileio.ch \ getexit.ch \ - harbour.ch \ - hboo.ch \ hbclass.ch \ hbextern.ch \ + hbgetcmt.ch \ + hbinkey.ch \ hbmemory.ch \ hbmemvar.ch \ + hboo.ch \ + hbpers.ch \ hbsetup.ch \ inkey.ch \ memoedit.ch \ + ord.ch \ rddsys.ch \ reserved.ch \ set.ch \ diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 435bc1724b..2ffab92b90 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -83,8 +83,9 @@ extern BOOL hb_fsChDir ( BYTE * pszDirName ); /* change working directo extern USHORT hb_fsChDrv ( BYTE nDrive ); /* change working drive */ extern void hb_fsClose ( FHANDLE hFileHandle ); /* close a file */ extern void hb_fsCommit ( FHANDLE hFileHandle ); /* commit updates of a file */ -extern FHANDLE hb_fsCreate ( BYTE * pszFileName, USHORT uiAttribute ); /* create a file */ -extern FHANDLE hb_fsCreateTemp ( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiAttribute ); /* create a temporary file from components */ +extern FHANDLE hb_fsCreate ( BYTE * pszFileName, USHORT uiAttr ); /* create a file */ +extern FHANDLE hb_fsCreateEx ( BYTE * pszFilename, USHORT uiAttr, USHORT uiFlags ); /* create a file, with specific open mode */ +extern FHANDLE hb_fsCreateTemp ( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiAttr, BYTE * pszName ); /* create a temporary file from components */ extern BYTE * hb_fsCurDir ( USHORT uiDrive ); /* retrieve a static pointer containing current directory for specified drive */ extern USHORT hb_fsCurDirBuff ( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen ); /* copy current directory for given drive into a buffer */ extern BYTE hb_fsCurDrv ( void ); /* retrieve current drive number */ diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index b5e1850113..4f2aa527d4 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -76,8 +76,9 @@ extern "C" { #endif /* NOTE: The declaration of hb_gtSetPos(), hb_gtGetPos(), hb_gtWrite(), - hb_gtWriteAt(), hb_gtRepChar() differs in parameter types from the - original CA-Cl*pper versions. [vszakats] */ + hb_gtWriteAt(), hb_gtRepChar(), hb_gtBox(), hb_gtBoxS(), hb_gtBoxD() + hb_gtInit() differs in parameter types from the original CA-Cl*pper + versions. [vszakats] */ /* maximum length of color string */ #define CLR_STRLEN 64 @@ -106,14 +107,14 @@ extern "C" { #define HB_B_DOUBLE_V 'º' #define HB_B_DOUBLE_H 'Í' */ -#define _B_SINGLE "\xda\xc4\xbf\xb3\xd9\xc4\xc0\xb3" -#define _B_DOUBLE "\xc9\xcd\xbb\xba\xbc\xcd\xc8\xba" -#define _B_SINGLE_DOUBLE "\xd6\xc4\xb7\xba\xbd\xc4\xd3\xba" -#define _B_DOUBLE_SINGLE "\xd5\xcd\xb8\xb3\xbe\xcd\xd4\xb3" -#define HB_B_SINGLE_V '\xb3' -#define HB_B_SINGLE_H '\xc4' -#define HB_B_DOUBLE_V '\xb3' -#define HB_B_DOUBLE_H '\xc4' +#define _B_SINGLE "\xDA\xC4\xBF\xB3\xD9\xC4\xC0\xB3" +#define _B_DOUBLE "\xC9\xCD\xBB\xBA\xBC\xCD\xC8\xBA" +#define _B_SINGLE_DOUBLE "\xD6\xC4\xB7\xBA\xBD\xC4\xD3\xBA" +#define _B_DOUBLE_SINGLE "\xD5\xCD\xB8\xB3\xBE\xCD\xD4\xB3" +#define HB_B_SINGLE_V '\xB3' +#define HB_B_SINGLE_H '\xC4' +#define HB_B_DOUBLE_V '\xB3' +#define HB_B_DOUBLE_H '\xC4' /* Used to tell hb_gt_SetPos() when the cursor position is being set. Before or after text is or was displayed. diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index b3bd29c20f..f6a04d4b66 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -307,6 +307,9 @@ EXTERNAL __ERRRT_SBASE // EXTERNAL FOPEN EXTERNAL FCREATE +#ifdef HB_EXTENSION +EXTERNAL HB_FCREATE +#endif EXTERNAL FREAD EXTERNAL FWRITE EXTERNAL FERROR diff --git a/harbour/make_gnu.bat b/harbour/make_gnu.bat index b0f7bae4f3..645990c5fa 100644 --- a/harbour/make_gnu.bat +++ b/harbour/make_gnu.bat @@ -74,7 +74,7 @@ if "%HB_INC_INSTALL%" == "" set HB_INC_INSTALL=%HARBOURDIR%/include echo - When HB_ARCHITECTURE=w32 echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit) echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit) - echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit) + echo - mingw32 (Cygnus/MinGW GNU C, Windows 32-bit) echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit) echo - icc (IBM Visual Age C++, Windows 32-bit) echo - msvc (Microsoft Visual C++, Windows 32-bit) diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 3eb6cc2fd7..4903cca422 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -372,6 +372,7 @@ LANG_LIB_OBJS = \ $(OBJ_DIR)\msgcswin.obj \ $(OBJ_DIR)\msgde.obj \ $(OBJ_DIR)\msgen.obj \ + $(OBJ_DIR)\msgeo.obj \ $(OBJ_DIR)\msges.obj \ $(OBJ_DIR)\msgeu.obj \ $(OBJ_DIR)\msgfr.obj \ @@ -1977,6 +1978,10 @@ $(OBJ_DIR)\msgen.obj : $(LANG_DIR)\msgen.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(LANG_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\msgeo.obj : $(LANG_DIR)\msgeo.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(LANG_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\msges.obj : $(LANG_DIR)\msges.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(LANG_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 78f780baef..1793067514 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -411,6 +411,7 @@ LANG_LIB_OBJS = \ $(OBJ_DIR)\msgcswin.obj \ $(OBJ_DIR)\msgde.obj \ $(OBJ_DIR)\msgen.obj \ + $(OBJ_DIR)\msgeo.obj \ $(OBJ_DIR)\msges.obj \ $(OBJ_DIR)\msgeu.obj \ $(OBJ_DIR)\msgfr.obj \ diff --git a/harbour/source/lang/Makefile b/harbour/source/lang/Makefile index b84b55ad7c..57cac459ff 100644 --- a/harbour/source/lang/Makefile +++ b/harbour/source/lang/Makefile @@ -12,6 +12,7 @@ C_SOURCES=\ msgcswin.c \ msgde.c \ msgen.c \ + msgeo.c \ msges.c \ msgeu.c \ msgfr.c \ @@ -27,11 +28,14 @@ C_SOURCES=\ msgis850.c \ msgit.c \ msgko.c \ + msgpl852.c \ + msgpliso.c \ + msgplmaz.c \ msgpt.c \ msgro.c \ msgsr852.c \ msgsriso.c \ - + LIBNAME=lang include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/source/rdd/hbdbsort.c b/harbour/source/rdd/hbdbsort.c index ee15d98db7..8d59e8019b 100644 --- a/harbour/source/rdd/hbdbsort.c +++ b/harbour/source/rdd/hbdbsort.c @@ -55,8 +55,7 @@ BOOL hb_dbQSortInit( LPDBQUICKSORT pQuickSort, LPDBSORTINFO pSortInfo, USHORT uiRecordLen ) { /* Create temp file */ - hb_fsTempName( pQuickSort->szTempName, NULL, NULL ); - pQuickSort->hFile = hb_fsCreate( ( BYTE * ) pQuickSort->szTempName, FC_NORMAL ); + pQuickSort->hFile = hb_fsCreateTemp( NULL, NULL, FC_NORMAL, pQuickSort->szTempName ); if( pQuickSort->hFile == FS_ERROR ) return FALSE; diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 92975f7f49..1c682dcd9e 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -250,7 +250,6 @@ static int convert_open_flags( USHORT uiFlags ) HB_TRACE(HB_TR_INFO, ("convert_open_flags: added O_RDONLY\n")); } #else - if( ( uiFlags & ( FO_WRITE | FO_READWRITE ) ) == FO_READ ) { result_flags |= ( O_RDONLY | SH_COMPAT ); @@ -457,13 +456,13 @@ FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags ) return hFileHandle; } -FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags ) +FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiAttr ) { FHANDLE hFileHandle; int oflag; unsigned pmode; - HB_TRACE(HB_TR_DEBUG, ("hb_fsCreate(%p, %hu)", pFilename, uiFlags)); + HB_TRACE(HB_TR_DEBUG, ("hb_fsCreate(%p, %hu)", pFilename, uiAttr)); s_uiErrorLast = 0; @@ -472,13 +471,13 @@ FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags ) { DWORD dwFlags = FILE_ATTRIBUTE_ARCHIVE; HANDLE hFile; - if( uiFlags & FC_READONLY ) + if( uiAttr & FC_READONLY ) dwFlags |= FILE_ATTRIBUTE_READONLY; - if( uiFlags & FC_HIDDEN ) + if( uiAttr & FC_HIDDEN ) dwFlags |= FILE_ATTRIBUTE_HIDDEN; - if( uiFlags & FC_SYSTEM ) + if( uiAttr & FC_SYSTEM ) dwFlags |= FILE_ATTRIBUTE_SYSTEM; errno = 0; @@ -496,7 +495,7 @@ FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags ) #elif defined(HB_FS_FILE_IO) errno = 0; - convert_create_flags( uiFlags, &oflag, &pmode ); + convert_create_flags( uiAttr, &oflag, &pmode ); hFileHandle = open( ( char * ) pFilename, oflag, pmode ); if( hFileHandle == -1 ) { @@ -516,6 +515,45 @@ FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags ) return hFileHandle; } +/* Derived from hb_fsCreate() + + NOTE: The default opening mode differs from the one used in hb_fsCreate() + [vszakats] + */ + +FHANDLE hb_fsCreateEx( BYTE * pFilename, USHORT uiAttr, USHORT uiFlags ) +{ + FHANDLE hFileHandle; + int oflag; + unsigned pmode; + + HB_TRACE(HB_TR_DEBUG, ("hb_fsCreateEx(%p, %hu, %hu)", pFilename, uiAttr, uiFlags)); + + s_uiErrorLast = 0; + +#if defined(HB_FS_FILE_IO) + + errno = 0; + convert_create_flags( uiAttr, &oflag, &pmode ); + hFileHandle = open( ( char * ) pFilename, convert_open_flags( uiFlags ), pmode ); + if( hFileHandle == -1 ) + { + /* This if block is required, because errno will be set + if the file did not exist and had to be created, even + when the create is successful! */ + s_uiErrorLast = errno; + } + +#else + + hFileHandle = FS_ERROR; + s_uiErrorLast = FS_ERROR; + +#endif + + return hFileHandle; +} + void hb_fsClose( FHANDLE hFileHandle ) { HB_TRACE(HB_TR_DEBUG, ("hb_fsClose(%p)", hFileHandle)); diff --git a/harbour/source/rtl/fstemp.c b/harbour/source/rtl/fstemp.c index 043b2bb010..aa648e82ef 100644 --- a/harbour/source/rtl/fstemp.c +++ b/harbour/source/rtl/fstemp.c @@ -72,16 +72,16 @@ void hb_fsTempName( BYTE * pszBuffer, const BYTE * pszDir, const BYTE * pszPrefi tmpnam( ( char * ) pszBuffer ); } -FHANDLE hb_fsCreateTemp( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiAttribute ) -{ - BYTE szName[ _POSIX_PATH_MAX + 1 ]; +/* NOTE: The buffer must be at least _POSIX_PATH_MAX chars long */ - hb_fsTempName( szName, pszDir, pszPrefix ); +FHANDLE hb_fsCreateTemp( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiAttr, BYTE * pszName ) +{ + hb_fsTempName( pszName, pszDir, pszPrefix ); errno = 0; - if( szName[ 0 ] ) - return hb_fsCreate( szName, uiAttribute ); + if( pszName[ 0 ] != '\0' ) + return hb_fsCreateEx( pszName, uiAttr, FO_EXCLUSIVE ); hb_fsSetError( FS_ERROR ); return FS_ERROR; @@ -100,9 +100,12 @@ HB_FUNC( HB_FTEMPNAME ) HB_FUNC( HB_FTEMPCREATE ) { + BYTE szName[ _POSIX_PATH_MAX + 1 ]; + hb_retni( hb_fsCreateTemp( ( BYTE * ) hb_parc( 1 ), ( BYTE * ) hb_parc( 2 ), - ISNUM( 2 ) ? hb_parni( 2 ) : FC_NORMAL ) ); + ISNUM( 2 ) ? hb_parni( 2 ) : FC_NORMAL, + &szName ) ); } #endif diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index c30f7a4dbb..1ab701ead7 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -71,6 +71,20 @@ HB_FUNC( FCREATE ) hb_retni( FS_ERROR ); } +#ifdef HB_EXTENSION + +HB_FUNC( HB_FCREATE ) +{ + if( ISCHAR( 1 ) ) + hb_retni( hb_fsCreateEx( ( BYTE * ) hb_parc( 1 ), + ISNUM( 2 ) ? hb_parni( 2 ) : FC_NORMAL, + ISNUM( 3 ) ? hb_parni( 3 ) : FO_COMPAT ) ); + else + hb_retni( FS_ERROR ); +} + +#endif + HB_FUNC( FREAD ) { ULONG ulRead; diff --git a/harbour/source/vm/extend.c b/harbour/source/vm/extend.c index 16efe9190c..3e7ba2d6dc 100644 --- a/harbour/source/vm/extend.c +++ b/harbour/source/vm/extend.c @@ -1,4 +1,3 @@ - /* * $Id$ */ @@ -65,9 +64,6 @@ * Copyright 2000 Jose Lalin * hb_retd() * - * Modifications to hb_stor functions by Ricardo Ramirez R. - * - * * See doc/license.txt for licensing terms. * */ @@ -105,12 +101,12 @@ PHB_ITEM hb_param( int iParam, int iMask ) PHB_ITEM hb_paramError( int iParam ) { static HB_ITEM s_NIL; - PHB_ITEM pParam = hb_param( iParam, HB_IT_ANY ); - hb_itemClear( &s_NIL ); + PHB_ITEM pParam = hb_param( iParam, HB_IT_ANY ); if( pParam == NULL ) { + hb_itemClear( &s_NIL ); pParam = &s_NIL; } @@ -707,9 +703,7 @@ void hb_storni( int iValue, int iParam, ... ) hb_itemRelease( pItemNew ); } else if( iByRef || iParam == -1 ) - { hb_itemPutNI( pItem, iValue ); - } } } diff --git a/harbour/source/vm/mainlgtk.c b/harbour/source/vm/mainlgtk.c index fbbe0a8f53..c6105141bb 100644 --- a/harbour/source/vm/mainlgtk.c +++ b/harbour/source/vm/mainlgtk.c @@ -1,5 +1,5 @@ /* - * $Id: + * $Id$ */ /* @@ -51,6 +51,7 @@ */ #include + #include "hbapi.h" #include "hbvm.h" @@ -67,9 +68,11 @@ int main( int argc, char * argv[] ) hb_vmQuit(); /* uncoment the next line if hb_vmQuit() returns */ /* return 0; */ - } - else - fprintf( stderr, "%s\n", "Could not initialize GTK++ subsystem" ); + } + else + { + fprintf( stderr, "%s\n", "Could not initialize GTK++ subsystem" ); + } - return( 1 ); -} \ No newline at end of file + return 1; +}