diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5573157d08..9518f887b4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,23 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-02-13 23:57 UTC+0100 Viktor Szakats + + + source/codepage/cdphu852.c + + source/codepage/cdphuwin.c + * source/codepage/Makefile + + Added Hungarian 852 and Windows sorting codepages. + + * source/rtl/errorapi.c + + source/rtl/errorint.c + * source/rtl/Makefile + * makefile.bc + * makefile.nt + * makefile.vc + + hb_errInternal() put in a separate source file, to ease + replacing/override it in link-time, this may be useful + for GUI apps, logging or something like this. + 2004-02-13 23:36 UTC+0100 Viktor Szakats * source/vm/hvm.c diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 4d604ef4db..f98920ba28 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -243,6 +243,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\do.obj \ $(OBJ_DIR)\empty.obj \ $(OBJ_DIR)\errorapi.obj \ + $(OBJ_DIR)\errorint.obj \ $(OBJ_DIR)\file.obj \ $(OBJ_DIR)\filehb.obj \ $(OBJ_DIR)\filesys.obj \ @@ -440,6 +441,8 @@ CODEPAGE_LIB_OBJS = \ $(OBJ_DIR)\cdpeswin.obj \ $(OBJ_DIR)\cdpgedos.obj \ $(OBJ_DIR)\cdpgewin.obj \ + $(OBJ_DIR)\cdphu852.obj \ + $(OBJ_DIR)\cdphuwin.obj \ $(OBJ_DIR)\cdppt850.obj \ $(OBJ_DIR)\cdpptiso.obj \ $(OBJ_DIR)\cdppl852.obj \ @@ -1447,6 +1450,10 @@ $(OBJ_DIR)\errorapi.obj : $(RTL_DIR)\errorapi.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\errorint.obj : $(RTL_DIR)\errorint.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(RTL_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\errorsys.c : $(RTL_DIR)\errorsys.prg $(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@ @@ -2275,6 +2282,14 @@ $(OBJ_DIR)\cdpgewin.obj : $(CODEPAGE_DIR)\cdpgewin.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\cdphu852.obj : $(CODEPAGE_DIR)\cdphu852.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,, + +$(OBJ_DIR)\cdphuwin.obj : $(CODEPAGE_DIR)\cdphuwin.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\cdppt850.obj : $(CODEPAGE_DIR)\cdppt850.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.nt b/harbour/makefile.nt index 514f62728f..1d2575b648 100644 --- a/harbour/makefile.nt +++ b/harbour/makefile.nt @@ -296,6 +296,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\do.obj \ $(OBJ_DIR)\empty.obj \ $(OBJ_DIR)\errorapi.obj \ + $(OBJ_DIR)\errorint.obj \ $(OBJ_DIR)\file.obj \ $(OBJ_DIR)\filehb.obj \ $(OBJ_DIR)\filesys.obj \ @@ -502,6 +503,8 @@ CODEPAGE_LIB_OBJS = \ $(OBJ_DIR)\cdpeswin.obj \ $(OBJ_DIR)\cdpgedos.obj \ $(OBJ_DIR)\cdpgewin.obj \ + $(OBJ_DIR)\cdphu852.obj \ + $(OBJ_DIR)\cdphuwin.obj \ $(OBJ_DIR)\cdppt850.obj \ $(OBJ_DIR)\cdpptiso.obj \ $(OBJ_DIR)\cdppl852.obj \ diff --git a/harbour/makefile.vc b/harbour/makefile.vc index f890008953..5906f0d8a9 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -260,6 +260,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\do.obj \ $(OBJ_DIR)\empty.obj \ $(OBJ_DIR)\errorapi.obj \ + $(OBJ_DIR)\errorint.obj \ $(OBJ_DIR)\file.obj \ $(OBJ_DIR)\filehb.obj \ $(OBJ_DIR)\filesys.obj \ @@ -467,6 +468,8 @@ CODEPAGE_LIB_OBJS = \ $(OBJ_DIR)\cdpeswin.obj \ $(OBJ_DIR)\cdpgedos.obj \ $(OBJ_DIR)\cdpgewin.obj \ + $(OBJ_DIR)\cdphu852.obj \ + $(OBJ_DIR)\cdphuwin.obj \ $(OBJ_DIR)\cdppt850.obj \ $(OBJ_DIR)\cdpptiso.obj \ $(OBJ_DIR)\cdppl852.obj \ diff --git a/harbour/source/codepage/Makefile b/harbour/source/codepage/Makefile index d3402be2ba..df658b9018 100644 --- a/harbour/source/codepage/Makefile +++ b/harbour/source/codepage/Makefile @@ -9,6 +9,8 @@ C_SOURCES=\ cdpeswin.c \ cdpgedos.c \ cdpgewin.c \ + cdphu852.c \ + cdphuwin.c \ cdppl852.c \ cdppliso.c \ cdpplmaz.c \ diff --git a/harbour/source/codepage/cdphu852.c b/harbour/source/codepage/cdphu852.c new file mode 100644 index 0000000000..1a0533b57a --- /dev/null +++ b/harbour/source/codepage/cdphu852.c @@ -0,0 +1,98 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * National Collation Support Module (HU852) + * + * Copyright 1999-2004 Viktor Szakats + * 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. + * + */ + +/* Language name: */ +/* ISO language code (2 chars): (please look it up in /doc/lang_id.txt) */ +/* Codepage: */ + +#include +#include "hbapi.h" +#include "hbapicdp.h" + +#define NUMBER_OF_CHARACTERS 35 /* The number of single characters in the + alphabet, two-as-one aren't considered + here, accented - are considered. */ +#define IS_LATIN 1 /* Should be 1, if the national alphabet + is based on Latin */ +#define ACCENTED_EQUAL 0 /* Should be 1, if accented character + has the same weight as appropriate + unaccented. */ +#define ACCENTED_INTERLEAVED 0 /* Should be 1, if accented characters + sort after their unaccented counterparts + only if the unaccented versions of all + characters being compared are the same + ( interleaving ) */ + +/* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the + accented characters with the symbol '~' before each of them, for example: + a~€ + If there is two-character sequence, which is considered as one, it should + be marked with '.' before and after it, for example: + ... h.ch.i ... + + The Upper case string and the Lower case string should be absolutely the + same excepting the characters case, of course. + */ + +static HB_CODEPAGE s_codepage = { "HU852", NUMBER_OF_CHARACTERS, + "AµBCDEFGHIÖJKLMNOà™ŠPQRSTUéšëVWXYZ","a bcde‚fghiĦjklmno˘”‹pqrstu£ûvwxyz", + IS_LATIN,ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL }; + +HB_CODEPAGE_ANNOUNCE( HU852 ); + +HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_HU852 ) + hb_cdpRegister( &s_codepage ); +HB_CALL_ON_STARTUP_END( hb_codepage_Init_HU852 ) +#if ! defined(__GNUC__) && ! defined(_MSC_VER) + #pragma startup hb_codepage_Init_HU852 +#endif + diff --git a/harbour/source/codepage/cdphuwin.c b/harbour/source/codepage/cdphuwin.c new file mode 100644 index 0000000000..4479fd50d3 --- /dev/null +++ b/harbour/source/codepage/cdphuwin.c @@ -0,0 +1,98 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * National Collation Support Module (HUWIN) + * + * Copyright 1999-2004 Viktor Szakats + * 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. + * + */ + +/* Language name: */ +/* ISO language code (2 chars): (please look it up in /doc/lang_id.txt) */ +/* Codepage: */ + +#include +#include "hbapi.h" +#include "hbapicdp.h" + +#define NUMBER_OF_CHARACTERS 35 /* The number of single characters in the + alphabet, two-as-one aren't considered + here, accented - are considered. */ +#define IS_LATIN 1 /* Should be 1, if the national alphabet + is based on Latin */ +#define ACCENTED_EQUAL 0 /* Should be 1, if accented character + has the same weight as appropriate + unaccented. */ +#define ACCENTED_INTERLEAVED 0 /* Should be 1, if accented characters + sort after their unaccented counterparts + only if the unaccented versions of all + characters being compared are the same + ( interleaving ) */ + +/* If ACCENTED_EQUAL or ACCENTED_INTERLEAVED is 1, you need to mark the + accented characters with the symbol '~' before each of them, for example: + a~€ + If there is two-character sequence, which is considered as one, it should + be marked with '.' before and after it, for example: + ... h.ch.i ... + + The Upper case string and the Lower case string should be absolutely the + same excepting the characters case, of course. + */ + +static HB_CODEPAGE s_codepage = { "HUWIN", NUMBER_OF_CHARACTERS, + "AÁBCDEÉFGHIÍJKLMNOÓÖĠPQRSTUÚÜÛVWXYZ","aábcdeéfghiíjklmnoóöġpqrstuúüûvwxyz", + IS_LATIN,ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL }; + +HB_CODEPAGE_ANNOUNCE( HUWIN ); + +HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_HUWIN ) + hb_cdpRegister( &s_codepage ); +HB_CALL_ON_STARTUP_END( hb_codepage_Init_HUWIN ) +#if ! defined(__GNUC__) && ! defined(_MSC_VER) + #pragma startup hb_codepage_Init_HUWIN +#endif + diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 598cdd0f0c..4f54af4418 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -30,6 +30,7 @@ C_SOURCES=\ do.c \ empty.c \ errorapi.c \ + errorint.c \ file.c \ filehb.c \ filesys.c \ diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index f0f5c3f67e..9ffb201e28 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -68,7 +68,6 @@ * hb_errRT_BASE() * hb_errRT_BASE_Ext1() * hb_errRT_BASE_Subst() - * hb_errInternal() * * See doc/license.txt for licensing terms. * @@ -723,7 +722,7 @@ PHB_ITEM hb_errRT_New_Subst( hb_errPutOsCode( pError, uiOsCode ); hb_errPutFlags( pError, uiFlags | EF_CANSUBSTITUTE ); - return( pError ); + return pError; } HB_FUNC( __ERRRT_BASE ) @@ -973,25 +972,3 @@ USHORT hb_errRT_TOOLS( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, c return uiAction; } - -/* NOTE: Use as minimal calls from here, as possible. - Don't allocate memory from this function. [vszakats] */ - -void hb_errInternal( ULONG ulIntCode, char * szText, char * szPar1, char * szPar2 ) -{ - char buffer[ 128 ]; - - HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2)); - - hb_conOutErr( hb_conNewLine(), 0 ); - sprintf( buffer, ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ), ulIntCode ); - hb_conOutErr( buffer, 0 ); - sprintf( buffer, szText != NULL ? szText : ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 ); - hb_conOutErr( buffer, 0 ); - hb_conOutErr( hb_conNewLine(), 0 ); - - hb_stackDispCall(); - - exit( EXIT_FAILURE ); -} - diff --git a/harbour/source/rtl/errorint.c b/harbour/source/rtl/errorint.c new file mode 100644 index 0000000000..8fc1e117af --- /dev/null +++ b/harbour/source/rtl/errorint.c @@ -0,0 +1,78 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * The Error API (internal error) + * + * Copyright 1999-2004 Viktor Szakats + * 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. + * + */ + +#include "hbapi.h" +#include "hbapierr.h" +#include "hbapilng.h" +#include "hbstack.h" + +/* NOTE: Use as minimal calls from here, as possible. + Don't allocate memory from this function. [vszakats] */ + +void hb_errInternal( ULONG ulIntCode, char * szText, char * szPar1, char * szPar2 ) +{ + char buffer[ 128 ]; + + HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2)); + + hb_conOutErr( hb_conNewLine(), 0 ); + sprintf( buffer, ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ), ulIntCode ); + hb_conOutErr( buffer, 0 ); + sprintf( buffer, szText != NULL ? szText : ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 ); + hb_conOutErr( buffer, 0 ); + hb_conOutErr( hb_conNewLine(), 0 ); + + hb_stackDispCall(); + + exit( EXIT_FAILURE ); +} +