From a1e6f03ea0f01d3951db4f4857cc125bec348768 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Jul 2000 20:16:31 +0000 Subject: [PATCH] 2000-07-24 22:12 UTC+0100 Victor Szakats --- harbour/ChangeLog | 20 +++ harbour/include/hbextern.ch | 2 +- harbour/makefile.bc | 5 + harbour/makefile.vc | 1 + harbour/source/lang/Makefile | 1 + harbour/source/lang/msgko.c | 260 +++++++++++++++++++++++---------- harbour/source/rtl/errorapi.c | 10 ++ harbour/source/rtl/tobject.prg | 16 +- harbour/source/vm/classes.c | 35 ----- harbour/tests/test.frm | Bin 1990 -> 0 bytes 10 files changed, 228 insertions(+), 122 deletions(-) delete mode 100644 harbour/tests/test.frm diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1b21ea082d..2a6e89f0ac 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,23 @@ +2000-07-24 22:12 UTC+0100 Victor Szakats + + * include/hbextern.ch + * source/rtl/errorapi.c + * source/rtl/tobject.prg + * source/vm/classes.c + * TOBJECT_ERROR() implemented in Clipper/Harbour instead of C to keep it + clean. + + __errRT_SBASE() internal function added to throw a substitutable (?) + runtime error. + + * source/lang/msgko.c + * source/lang/Makefile + * makefile.bc + * makefile.vc + + Korean language module updated. Thanks to Kwon Oh-Chul. + + - tests/test.frm + - Removed since it was corrupted. + 2000-07-22 23:30 UTC+0800 Ron Pinkas * source/compiler/harbour.slx ! Optimized handling of Hex Numbers. diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 37ade92c85..c3e3300908 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -84,7 +84,6 @@ EXTERNAL __GETMESSAGE EXTERNAL __CLS_PARAM EXTERNAL __CLSPARENT EXTERNAL __SENDER -EXTERNAL TOBJECT_ER // //symbols from file: vm\cmdarg.c // @@ -287,6 +286,7 @@ EXTERNAL __ERRINHANDLER EXTERNAL ERRORBLOCK EXTERNAL DOSERROR EXTERNAL __ERRRT_BASE +EXTERNAL __ERRRT_SBASE // //symbols from file: rtl\filesys.c // diff --git a/harbour/makefile.bc b/harbour/makefile.bc index b573c37bb6..611271dff6 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -337,6 +337,7 @@ LANG_LIB_OBJS = \ $(OBJ_DIR)\msghuwin.obj \ $(OBJ_DIR)\msgis850.obj \ $(OBJ_DIR)\msgit.obj \ + $(OBJ_DIR)\msgko.obj \ $(OBJ_DIR)\msgpt.obj \ $(OBJ_DIR)\msgro.obj \ $(OBJ_DIR)\msgsr852.obj \ @@ -1763,6 +1764,10 @@ $(OBJ_DIR)\msgit.obj : $(LANG_DIR)\msgit.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(LANG_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\msgko.obj : $(LANG_DIR)\msgko.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(LANG_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\msgpt.obj : $(LANG_DIR)\msgpt.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(LANG_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 357c5c6e92..5289747f5e 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -365,6 +365,7 @@ LANG_LIB_OBJS = \ $(OBJ_DIR)\msghuwin.obj \ $(OBJ_DIR)\msgis850.obj \ $(OBJ_DIR)\msgit.obj \ + $(OBJ_DIR)\msgko.obj \ $(OBJ_DIR)\msgpt.obj \ $(OBJ_DIR)\msgro.obj \ $(OBJ_DIR)\msgsr852.obj \ diff --git a/harbour/source/lang/Makefile b/harbour/source/lang/Makefile index 5b50d1f159..eedef2b393 100644 --- a/harbour/source/lang/Makefile +++ b/harbour/source/lang/Makefile @@ -25,6 +25,7 @@ C_SOURCES=\ msghuwin.c \ msgis850.c \ msgit.c \ + msgko.c \ msgpt.c \ msgro.c \ msgsr852.c \ diff --git a/harbour/source/lang/msgko.c b/harbour/source/lang/msgko.c index a5a204fbfb..2d9f87d83c 100644 --- a/harbour/source/lang/msgko.c +++ b/harbour/source/lang/msgko.c @@ -2,91 +2,189 @@ * $Id$ */ -/* Language Support Module */ +/* + * Harbour Project source code: + * Language Support Module (KR) + * + * Copyright 2000 Kwon, Oh-Chul + * 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 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) 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 HRL + * and/or HVM code into it. + * + * 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 program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ -/* Language name: Korean */ -/* ISO language code (2 chars): KO */ -/* Codepage: ???? */ +/* Language name: */ +/* ISO language code (2 chars): (please look it up in /doc/lang_id.txt) */ +/* Codepage: */ -#include "hbdefs.h" +#include "hbapilng.h" -char *hb_dateMonthsName[ 12 ] = +static HB_LANG s_lang = { - "1¿ù", - "2¿ù", - "3¿ù", - "4¿ù", - "5¿ù", - "6¿ù", - "7¿ù", - "8¿ù", - "9¿ù", - "10¿ù", - "11¿ù", - "12¿ù" + { + /* Identification */ + + "KR", /* ID */ + "English", /* Name (in English) */ + "Çѱ¹¾î", /* Name (in native language) */ + "KR", /* RFC ID */ + "949", /* Codepage */ + "$Revision$ $Date$", /* Version */ + + /* Month names */ + + "1¿ù", + "2¿ù", + "3¿ù", + "4¿ù", + "5¿ù", + "6¿ù", + "7¿ù", + "8¿ù", + "9¿ù", + "10¿ù", + "11¿ù", + "12¿ù", + + /* Day names */ + + "ÀÏ¿äÀÏ", + "¿ù¿äÀÏ", + "È­¿äÀÏ", + "¼ö" + "¸ñ", + "±Ý", + "Åä", + + /* CA-Cl*pper compatible natmsg items */ + + "µ¥ÀÌÅÍ ÆÄÀÏ s # ·¹ÄÚµå¼ö ÃÖÁ¾ ¼öÁ¤ÀÏ Å©±â", + "´Ù¸¥ ¿¹Á¦¸¦ ¿øÇϽʴϱî?", + "ÆäÀÌÁö ¹øÈ£.", + "** ¼Ò°è **", + "* (Áß°£)¼Ò°è *", + "*** ÃѰè ***", + "»ðÀÔ", + " ", + "À߸øµÈ ³¯Â¥", + "¹üÀ§: ", + " - ", + "Y/N", + "À߸øµÈ Ç¥Çö½Ä", + + /* Error description names */ + + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Zero divisor", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exist", + "Alias does not exist", + "No exported variable", + "Illegal characters in alias", + "Alias already in use", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Operation not supported", + "Limit exceeded", + "Corruption detected", + "Data type error", + "Data width error", + "Workarea not in use", + "Workarea not indexed", + "Exclusive required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock Failure", + "", + "", + "", + "", + "array access", + "array assign", + "array dimension", + "not an array", + "conditional", + + /* Internal error names */ + + "Unrecoverable error %lu: ", + "Error recovery failure", + "No ERRORBLOCK() for error", + "Too many recursive error handler calls", + "RDD invalid or failed to load", + "Invalid method type from %s", + "hb_xgrab can't allocate memory", + "hb_xrealloc called with a NULL pointer", + "hb_xrealloc called with an invalid pointer", + "hb_xrealloc can't reallocate memory", + "hb_xfree called with an invalid pointer", + "hb_xfree called with a NULL pointer", + "Can\'t locate the starting procedure: \'%s\'", + "No starting procedure", + "Unsupported VM opcode", + "Symbol item expected from %s", + "Invalid symbol type for self from %s", + "Codeblock expected from %s", + "Incorrect item type on the stack trying to pop from %s", + "Stack underflow", + "An item was going to be copied to itself from %s", + "Invalid symbol item passed as memvar %s", + + /* Texts */ + + "YYYY-MM-DD", + "Y", + "N" + } }; -char *hb_dateDaysName[ 7 ] = -{ - "ÀÏ¿äÀÏ", - "¿ù¿äÀÏ", - "È­¿äÀÏ", - "¼ö¿äÀÏ", - "¸ñ¿äÀÏ", - "±Ý¿äÀÏ", - "Åä¿äÀÏ" -}; +HB_LANG_ANNOUNCE( TPL ); + +HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_TPL ) + hb_langRegister( &s_lang ); +HB_CALL_ON_STARTUP_END( hb_lang_Init_TPL ) +#if ! defined(__GNUC__) && ! defined(_MSC_VER) + #pragma startup hb_lang_Init_TPL +#endif -char *hb_errorsGeneric[] = -{ - "Unknown error", - "Argument error", - "Bound error", - "String overflow", - "Numeric overflow", - "Zero divisor", - "Numeric error", - "Syntax error", - "Operation too complex", - "", - "", - "Memory low", - "Undefined function", - "No exported method", - "Variable does not exist", - "Alias does not exist", - "No exported variable", - "Illegal characters in alias", - "Alias already in use", - "", - "Create error", - "Open error", - "Close error", - "Read error", - "Write error", - "Print error", - "", - "", - "", - "", - "Operation not supported", - "Limit exceeded", - "Corruption detected", - "Data type error", - "Data width error", - "Workarea not in use", - "Workarea not indexed", - "Exclusive required", - "Lock required", - "Write not allowed", - "Append lock failed", - "Lock Failure", - "", - "", - "", - "Incorrect number of arguments", - "array access", - "array assign", - "not an array", - "conditional" -}; diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index 0f3589888b..e0b6f04db8 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -41,6 +41,7 @@ * DOSERROR() * __ERRINHANDLER() * __ERRRT_BASE() + * __ERRRT_SBASE() * hb_errLaunch() * hb_errLaunchSubst() * hb_errGetFlags() @@ -730,6 +731,15 @@ HB_FUNC( __ERRRT_BASE ) hb_parc( 4 ) ); } +HB_FUNC( __ERRRT_SBASE ) +{ + hb_itemRelease( hb_itemReturn( + hb_errRT_BASE_Subst( ( ULONG ) hb_parnl( 1 ), + ( ULONG ) hb_parnl( 2 ), + ISCHAR( 3 ) ? hb_parc( 3 ) : NULL, + hb_parc( 4 ) ) ) ); +} + USHORT hb_errRT_BASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) { USHORT uiAction; diff --git a/harbour/source/rtl/tobject.prg b/harbour/source/rtl/tobject.prg index c52ed41884..9be89733d0 100644 --- a/harbour/source/rtl/tobject.prg +++ b/harbour/source/rtl/tobject.prg @@ -57,6 +57,7 @@ #include "common.ch" #include "hboo.ch" +#include "error.ch" FUNCTION TObject() STATIC s_oClass @@ -73,7 +74,7 @@ FUNCTION TObject() s_oClass:AddMethod( "NEW" , @TObject_New() , nScope ) s_oClass:AddMethod( "INIT" , @TObject_Init() , nScope ) - s_oClass:AddMethod( "ERROR", @TOBJECT_ER() , nScope ) /* see classes.c */ + s_oClass:AddMethod( "ERROR", @TOBJECT_ERROR() , nScope ) /* see classes.c */ s_oClass:SetOnError( @TObject_DftonError() ) @@ -146,7 +147,12 @@ static function TObject_Dftonerror(xPar0, xPar1, xPar2, xPar3, xPar4, xPar5, xPa return QSelf():MSGNOTFOUND( __GetMessage(), xPar0, xPar1, xPar2, xPar3, xPar4, xPar5, xPar6, xPar7, xPar8, xPar9, ; xPar10,xPar11,xPar12,xPar13,xPar14,xPar15,xPar16,xPar17,xPar18,xPar19 ) -/* This function is stored within classes.c and will generate on runTime error */ -/* -* static function TObject_Er(cMsgErr, cCls, cMsg) -*/ +static function TObject_Error( cDesc, cClass, cMsg, nCode ) + + DEFAULT nCode TO 1004 + + IF nCode == 1005 + RETURN __errRT_SBASE( EG_NOVARMETHOD, 1005, cDesc, cClass + ":" + cMsg ) + ENDIF + + RETURN __errRT_SBASE( EG_NOMETHOD, nCode, cDesc, cClass + ":" + cMsg ) diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 5f46886bea..d10de584ac 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -2162,38 +2162,3 @@ static HARBOUR hb___msgVirtual( void ) ; } - -/* ************** C Function associate to TObject.prg ********************* */ - -/* tObject:Error(cDesc,cClass,cMsg,nCode) */ -HB_FUNC( TOBJECT_ER ) -{ - char * pszDesc = hb_parc( 1 ); - char * pszClass = hb_parc( 2 ); - char * pszMsg = hb_parc( 3 ); - char szTmp[255] ; - USHORT uiCode = 1004 ; - - PHB_ITEM pResult ; - - if (hb_pcount()>3) - uiCode= (USHORT) hb_parni(4); - - strcpy( szTmp, pszClass ); - strcat( szTmp, ":" ); - - if( uiCode==1005 ) - { - strcat( szTmp, pszMsg+1 ); - pResult = hb_errRT_BASE_Subst( EG_NOVARMETHOD, 1005, pszDesc, szTmp ); - } - else - { - strcat( szTmp, pszMsg ); - pResult = hb_errRT_BASE_Subst( EG_NOMETHOD, 1004, pszDesc, szTmp ); - } - - hb_itemReturn( pResult ); - hb_itemRelease( pResult ); - -} diff --git a/harbour/tests/test.frm b/harbour/tests/test.frm deleted file mode 100644 index 8f2fa2640619d46df3760dd2602710126eacefa9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1990 zcmZQ#aAsg+;9=kfLM{eg22KXr14f`d5)8@=x(rsdw=5*JxJ1{^EwiY&gh2^RDOp=v zGeCrW5<#LM5=k()q$o8NC>&Ip2o|Ni8%J#z4S~@R7!83D9s(jD|NAij>mw!x7@L`a jg+UG~&dR_xqC@CE6fiIZ0BcSTU|29S`1$!UGBE%E%SRv2