2002-11-15 14:30 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
This commit is contained in:
@@ -8,6 +8,25 @@
|
||||
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2002-11-15 14:30 UTC+0300 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* include/hbcdpapi.c
|
||||
* source/rtl/cdpapi.c
|
||||
* source/codepage/cdpru866.c
|
||||
* source/codepage/cdprukoi.c
|
||||
* source/codepage/cdpruwin.c
|
||||
* Some fixes and enhancements
|
||||
+ source/codepage/cdp_tpl.c
|
||||
+ Template file for codepages is added
|
||||
+ source/codepage/cdppl852.c
|
||||
+ source/codepage/cdppliso.c
|
||||
+ source/codepage/cdpplmaz.c
|
||||
+ Codepages for Polish language, provided by Jacek Kubica <kubica@wssk.wroc.pl>
|
||||
* source/codepage/Makefile
|
||||
* makefile.bc
|
||||
* makefile.nt
|
||||
* makefile.vc
|
||||
* Changed to compile new Polish codepages
|
||||
|
||||
2002-11-13 15:50 UTC-0300 Horacio Roldan <harbour_ar@yahoo.com.ar>
|
||||
* include/hbrddcdx.h
|
||||
* source/rdd/dbfcdx/dbfcdx1.c
|
||||
|
||||
@@ -67,16 +67,28 @@
|
||||
|
||||
#define HB_CODEPAGE_ANNOUNCE( id ) HB_FUNC( HB_CODEPAGE_##id ) {}
|
||||
|
||||
typedef struct _HB_MULTICHAR
|
||||
{
|
||||
char cLast[2];
|
||||
char cFirst[2];
|
||||
int nCode;
|
||||
} HB_MULTICHAR, * PHB_MULTICHAR;
|
||||
|
||||
typedef struct _HB_CODEPAGE
|
||||
{
|
||||
char *id;
|
||||
int nChars;
|
||||
char *CharsUpper;
|
||||
char *CharsLower;
|
||||
BOOL lAccEqual;
|
||||
BOOL lAccInterleave;
|
||||
BOOL lSort;
|
||||
BYTE *s_chars;
|
||||
BYTE *s_upper;
|
||||
BYTE *s_lower;
|
||||
BYTE *s_accent;
|
||||
int nMulti;
|
||||
PHB_MULTICHAR multi;
|
||||
} HB_CODEPAGE, * PHB_CODEPAGE;
|
||||
|
||||
extern BOOL hb_cdpRegister( PHB_CODEPAGE );
|
||||
|
||||
@@ -421,6 +421,9 @@ LANG_LIB_OBJS = \
|
||||
$(OBJ_DIR)\msgzhb5.obj
|
||||
|
||||
CODEPAGE_LIB_OBJS = \
|
||||
$(OBJ_DIR)\cdppl852.obj \
|
||||
$(OBJ_DIR)\cdppliso.obj \
|
||||
$(OBJ_DIR)\cdpplmaz.obj \
|
||||
$(OBJ_DIR)\cdpru866.obj \
|
||||
$(OBJ_DIR)\cdpruwin.obj \
|
||||
$(OBJ_DIR)\cdprukoi.obj
|
||||
@@ -2154,6 +2157,18 @@ $(OBJ_DIR)\msgzhgb.obj : $(LANG_DIR)\msgzhgb.c
|
||||
# CODEPAGE.LIB dependencies
|
||||
#
|
||||
|
||||
$(OBJ_DIR)\cdppl852.obj : $(CODEPAGE_DIR)\cdppl852.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\cdppliso.obj : $(CODEPAGE_DIR)\cdppliso.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\cdpplmaz.obj : $(CODEPAGE_DIR)\cdpplmaz.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\cdpru866.obj : $(CODEPAGE_DIR)\cdpru866.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(CODEPAGE_LIB) $(ARFLAGS) -+$@,,
|
||||
|
||||
@@ -482,6 +482,9 @@ LANG_LIB_OBJS = \
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<
|
||||
|
||||
CODEPAGE_LIB_OBJS = \
|
||||
$(OBJ_DIR)\cdppl852.obj \
|
||||
$(OBJ_DIR)\cdppliso.obj \
|
||||
$(OBJ_DIR)\cdpplmaz.obj \
|
||||
$(OBJ_DIR)\cdpru866.obj \
|
||||
$(OBJ_DIR)\cdprukoi.obj \
|
||||
$(OBJ_DIR)\cdpruwin.obj
|
||||
|
||||
@@ -446,6 +446,9 @@ LANG_LIB_OBJS = \
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<
|
||||
|
||||
CODEPAGE_LIB_OBJS = \
|
||||
$(OBJ_DIR)\cdppl852.obj \
|
||||
$(OBJ_DIR)\cdppliso.obj \
|
||||
$(OBJ_DIR)\cdpplmaz.obj \
|
||||
$(OBJ_DIR)\cdpru866.obj \
|
||||
$(OBJ_DIR)\cdprukoi.obj \
|
||||
$(OBJ_DIR)\cdpruwin.obj
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
ROOT = ../../
|
||||
|
||||
C_SOURCES=\
|
||||
cdppl852.c \
|
||||
cdppliso.c \
|
||||
cdpplmaz.c \
|
||||
cdpru866.c \
|
||||
cdprukoi.c \
|
||||
cdpruwin.c
|
||||
|
||||
96
harbour/source/codepage/cdp_tpl.c
Normal file
96
harbour/source/codepage/cdp_tpl.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* National Collation Support Module ( template )
|
||||
*
|
||||
* Copyright 2002 Alexander S.Kresin <alex@belacy.belgorod.su>
|
||||
* 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: <Your language> */
|
||||
/* ISO language code (2 chars): (please look it up in /doc/lang_id.txt) */
|
||||
/* Codepage: <Your codepage> */
|
||||
|
||||
#include <ctype.h>
|
||||
#include "hbapi.h"
|
||||
#include "hbapicdp.h"
|
||||
|
||||
#define NUMBER_OF_CHARACTERS 26 /* The number of single characters in the
|
||||
alphabet, two-as-one aren't considered
|
||||
here, accented - are considered. */
|
||||
#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 = { "EN",NUMBER_OF_CHARACTERS,
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz",
|
||||
ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( EN );
|
||||
|
||||
HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_EN )
|
||||
hb_cdpRegister( &s_codepage );
|
||||
HB_CALL_ON_STARTUP_END( hb_codepage_Init_EN )
|
||||
#if ! defined(__GNUC__) && ! defined(_MSC_VER)
|
||||
#pragma startup hb_codepage_Init_EN
|
||||
#endif
|
||||
|
||||
97
harbour/source/codepage/cdppl852.c
Normal file
97
harbour/source/codepage/cdppl852.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* National Collation Support Module ( PL852 )
|
||||
*
|
||||
* Copyright 2002 Alexander S.Kresin <alex@belacy.belgorod.su>
|
||||
* www - http://www.harbour-project.org
|
||||
* Polish collating sequence (PL852) CP852 done by Jacek Kubica <kubica@wssk.wroc.pl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Polish CP852 PL852
|
||||
*
|
||||
/* Language name: Polish */
|
||||
/* ISO language code (2 chars): PL */
|
||||
/* Codepage: 852 */
|
||||
|
||||
#include <ctype.h>
|
||||
#include "hbapi.h"
|
||||
#include "hbapicdp.h"
|
||||
|
||||
#define NUMBER_OF_CHARACTERS 34 /* The number of single characters in the
|
||||
alphabet, two-as-one aren't considered
|
||||
here, accented - are considered. */
|
||||
#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 = { "PL852",NUMBER_OF_CHARACTERS,
|
||||
"A¤BC<EFBFBD>DE¨FGHIJKL<EFBFBD>MNãOàPQRS—TUWXYZ<EFBFBD>½","a¥bc†de©fghijklˆmnäo¢pqrs˜tuwxyz«¾",
|
||||
ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( PL852 );
|
||||
|
||||
HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_PL852 )
|
||||
hb_cdpRegister( &s_codepage );
|
||||
HB_CALL_ON_STARTUP_END( hb_codepage_Init_PL852 )
|
||||
#if ! defined(__GNUC__) && ! defined(_MSC_VER)
|
||||
#pragma startup hb_codepage_Init_PL852
|
||||
#endif
|
||||
|
||||
97
harbour/source/codepage/cdppliso.c
Normal file
97
harbour/source/codepage/cdppliso.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* National Collation Support Module ( PLISO )
|
||||
*
|
||||
* Copyright 2002 Alexander S.Kresin <alex@belacy.belgorod.su>
|
||||
* www - http://www.harbour-project.org
|
||||
* Polish collating sequence (PLISO) done by Jacek Kubica <kubica@wssk.wroc.pl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Polish ISO-8859-1 PLISO
|
||||
*
|
||||
/* Language name: Polish */
|
||||
/* ISO language code (2 chars): PL */
|
||||
/* Codepage: ISO */
|
||||
|
||||
#include <ctype.h>
|
||||
#include "hbapi.h"
|
||||
#include "hbapicdp.h"
|
||||
|
||||
#define NUMBER_OF_CHARACTERS 34 /* The number of single characters in the
|
||||
alphabet, two-as-one aren't considered
|
||||
here, accented - are considered. */
|
||||
#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 = { "PLISO",NUMBER_OF_CHARACTERS,
|
||||
"A¡BCÆDEÊFGHIJKL£MNÑOÓPQRS¦TUWXYZ¬¯","a±bcædeêfghijkl³mnñoópqrs¶tuwxyz¼¿",
|
||||
ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( PLISO );
|
||||
|
||||
HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_PLISO )
|
||||
hb_cdpRegister( &s_codepage );
|
||||
HB_CALL_ON_STARTUP_END( hb_codepage_Init_PLISO )
|
||||
#if ! defined(__GNUC__) && ! defined(_MSC_VER)
|
||||
#pragma startup hb_codepage_Init_PLISO
|
||||
#endif
|
||||
|
||||
97
harbour/source/codepage/cdpplmaz.c
Normal file
97
harbour/source/codepage/cdpplmaz.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* National Collation Support Module ( PLMAZ )
|
||||
*
|
||||
* Copyright 2002 Alexander S.Kresin <alex@belacy.belgorod.su>
|
||||
* www - http://www.harbour-project.org
|
||||
* Polish collating sequence (PLMAZ) Mazovia done by Jacek Kubica <kubica@wssk.wroc.pl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Polish Mazovia PLMAZ
|
||||
*
|
||||
/* Language name: Polish */
|
||||
/* ISO language code (2 chars): PL */
|
||||
/* Codepage: MAZ */
|
||||
|
||||
#include <ctype.h>
|
||||
#include "hbapi.h"
|
||||
#include "hbapicdp.h"
|
||||
|
||||
#define NUMBER_OF_CHARACTERS 34 /* The number of single characters in the
|
||||
alphabet, two-as-one aren't considered
|
||||
here, accented - are considered. */
|
||||
#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 = { "PLMAZ",NUMBER_OF_CHARACTERS,
|
||||
"A<EFBFBD>BC•DE<EFBFBD>FGHIJKLœMN¥O£PQRS˜TUWXYZ ¡","a†bc<EFBFBD>de‘fghijkl’mnäo¢pqrsžtuwxyz¦§",
|
||||
ACCENTED_EQUAL,ACCENTED_INTERLEAVED,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( PLMAZ );
|
||||
|
||||
HB_CALL_ON_STARTUP_BEGIN( hb_codepage_Init_PLMAZ )
|
||||
hb_cdpRegister( &s_codepage );
|
||||
HB_CALL_ON_STARTUP_END( hb_codepage_Init_PLMAZ )
|
||||
#if ! defined(__GNUC__) && ! defined(_MSC_VER)
|
||||
#pragma startup hb_codepage_Init_PLMAZ
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
static HB_CODEPAGE s_codepage = { "RU866",32,
|
||||
"€<EFBFBD>‚ƒ„…†‡ˆ‰Š‹Œ<EFBFBD>Ž<EFBFBD><EFBFBD>‘’“”•–—˜™š›œ<EFBFBD>žŸ"," ¡¢£¤¥¦§¨©ª«¬®¯àáâãäåæçèéêëìíîï",
|
||||
0,NULL,NULL,NULL };
|
||||
0,0,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( RU866 );
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
#include "hbapicdp.h"
|
||||
|
||||
static HB_CODEPAGE s_codepage = { "RUKOI8",32,
|
||||
"áâ÷çäåöúéêëìíîïðòóôõæèãþûýÿùøüàñ","ÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ",
|
||||
0,NULL,NULL,NULL };
|
||||
"áâ÷çäåöúéêë.öú.ìíîïðòóôõæèãþûýÿùøüàñ","ÁÂ×ÇÄÅÖÚÉÊË.ÖÚ.ÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ",
|
||||
0,0,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( RUKOI8 );
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
static HB_CODEPAGE s_codepage = { "RU1251",32,
|
||||
"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß","àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ",
|
||||
0,NULL,NULL,NULL };
|
||||
0,0,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
|
||||
HB_CODEPAGE_ANNOUNCE( RU1251 );
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
#define HB_CDP_MAX_ 64
|
||||
|
||||
static HB_CODEPAGE s_en_codepage = { "EN",0,NULL,NULL,0,NULL,NULL,NULL };
|
||||
static HB_CODEPAGE s_en_codepage = { "EN",0,NULL,NULL,0,0,0,NULL,NULL,NULL,NULL,0,NULL };
|
||||
static PHB_CODEPAGE s_cdpList[ HB_CDP_MAX_ ];
|
||||
PHB_CODEPAGE s_cdpage = &s_en_codepage;
|
||||
|
||||
@@ -93,6 +93,8 @@ BOOL hb_cdpRegister( PHB_CODEPAGE cdpage )
|
||||
char *ptrUpper = cdpage->CharsUpper;
|
||||
char *ptrLower = cdpage->CharsLower;
|
||||
char *ptr;
|
||||
HB_MULTICHAR multi[12];
|
||||
int nMulti = 0;
|
||||
|
||||
s_cdpList[ iPos ] = cdpage;
|
||||
|
||||
@@ -100,17 +102,25 @@ BOOL hb_cdpRegister( PHB_CODEPAGE cdpage )
|
||||
if( cdpage->nChars )
|
||||
{
|
||||
cdpage->s_chars = (BYTE*) hb_xgrab(256);
|
||||
memset( cdpage->s_chars,'\0',256 );
|
||||
cdpage->s_upper = (BYTE*) hb_xgrab(256);
|
||||
cdpage->s_lower = (BYTE*) hb_xgrab(256);
|
||||
if( cdpage->lAccInterleave )
|
||||
{
|
||||
cdpage->s_accent = (BYTE*) hb_xgrab(256);
|
||||
memset( cdpage->s_accent,'\0',256 );
|
||||
}
|
||||
else
|
||||
cdpage->s_accent = NULL;
|
||||
|
||||
for( i=0; i<256; i++ )
|
||||
{
|
||||
cdpage->s_chars[i] = 0;
|
||||
cdpage->s_upper[i] = toupper( (BYTE) i&255 );
|
||||
cdpage->s_lower[i] = tolower( (BYTE) i&255 );
|
||||
}
|
||||
for( i=1; *ptrUpper; i++,ptrUpper++,ptrLower++ )
|
||||
{
|
||||
if( *ptrUpper == '=' )
|
||||
if( *ptrUpper == '~' )
|
||||
{
|
||||
for( ptr=ptrUpper+1; *ptr; ptr++ )
|
||||
*(ptr-1) = *ptr;
|
||||
@@ -118,10 +128,43 @@ BOOL hb_cdpRegister( PHB_CODEPAGE cdpage )
|
||||
for( ptr=ptrLower+1; *ptr; ptr++ )
|
||||
*(ptr-1) = *ptr;
|
||||
*(ptr-1) = '\0';
|
||||
i--;
|
||||
if( cdpage->lAccEqual )
|
||||
i--;
|
||||
if( cdpage->lAccInterleave )
|
||||
{
|
||||
char *ptrtmp;
|
||||
|
||||
ptrtmp = ptrUpper-1;
|
||||
while( cdpage->s_accent[ (((int)*ptrtmp)&255) ] )
|
||||
ptrtmp --;
|
||||
iu = (((int)*ptrUpper)&255);
|
||||
cdpage->s_accent[ iu ] = *ptrtmp;
|
||||
|
||||
ptrtmp = ptrLower-1;
|
||||
while( cdpage->s_accent[ (((int)*ptrtmp)&255) ] )
|
||||
ptrtmp --;
|
||||
il = (((int)*ptrLower)&255);
|
||||
cdpage->s_accent[ il ] = *ptrtmp;
|
||||
}
|
||||
}
|
||||
else if( *ptrUpper == '.' )
|
||||
{
|
||||
multi[nMulti].cFirst[0] = *(ptrLower+1);
|
||||
multi[nMulti].cFirst[1] = *(ptrUpper+1);
|
||||
multi[nMulti].cLast[0] = *(ptrLower+2);
|
||||
multi[nMulti].cLast[1] = *(ptrUpper+2);
|
||||
multi[nMulti].nCode = i;
|
||||
|
||||
for( ptr=ptrUpper+4; *ptr; ptr++ )
|
||||
*(ptr-4) = *ptr;
|
||||
*(ptr-4) = '\0';
|
||||
for( ptr=ptrLower+4; *ptr; ptr++ )
|
||||
*(ptr-4) = *ptr;
|
||||
*(ptr-4) = '\0';
|
||||
|
||||
nMulti ++;
|
||||
ptrUpper --; ptrLower --;
|
||||
continue;
|
||||
}
|
||||
iu = (((int)*ptrUpper)&255);
|
||||
cdpage->s_chars[ iu ] = i;
|
||||
@@ -136,6 +179,14 @@ BOOL hb_cdpRegister( PHB_CODEPAGE cdpage )
|
||||
il = ((int)(*ptrUpper))&255;
|
||||
cdpage->s_lower[il] = *ptrLower;
|
||||
}
|
||||
if( nMulti )
|
||||
{
|
||||
cdpage->multi = (PHB_MULTICHAR) hb_xgrab( sizeof(HB_MULTICHAR)*nMulti );
|
||||
memcpy( (BYTE*)cdpage->multi,(BYTE*)multi,sizeof(HB_MULTICHAR)*nMulti );
|
||||
cdpage->nMulti = nMulti;
|
||||
}
|
||||
else
|
||||
cdpage->multi = NULL;
|
||||
}
|
||||
// printf( "\n%s %d",s_cdpage->id,s_cdpage->lSort );
|
||||
return TRUE;
|
||||
@@ -165,7 +216,12 @@ PHB_CODEPAGE hb_cdpSelect( PHB_CODEPAGE cdpage )
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_langSelect(%p)", cdpage));
|
||||
|
||||
if( cdpage )
|
||||
{
|
||||
s_cdpage = cdpage;
|
||||
printf("Codepage - Yes");
|
||||
}
|
||||
else
|
||||
printf("Codepage - No");
|
||||
|
||||
return cdpOld;
|
||||
}
|
||||
@@ -219,18 +275,81 @@ void hb_cdpnTranslate( char* psz, PHB_CODEPAGE cdpIn, PHB_CODEPAGE cdpOut, unsig
|
||||
int hb_cdpcmp( char* szFirst, char* szSecond, int iLen, PHB_CODEPAGE cdpage )
|
||||
{
|
||||
int i, iRet = 0, n1, n2;
|
||||
int lAcc1 = 0, lAcc2 = 0;
|
||||
// printf( "\nhb_cdpcmp-0 %s %s",szFirst,szSecond );
|
||||
for( i=0; i<iLen; i++,szFirst++,szSecond++ )
|
||||
if( *szFirst != *szSecond )
|
||||
{
|
||||
if( ( n1 = (int)cdpage->s_chars[ ((int)*szFirst)&255 ] ) == 0 ||
|
||||
( n2 = (int)cdpage->s_chars[ ((int)*szSecond)&255 ] ) == 0 )
|
||||
iRet = ( *szFirst < *szSecond )? -1 : 1;
|
||||
{
|
||||
/* One of characters doesn't belong to the national characters */
|
||||
iRet = ( (((int)*szFirst)&255) < (((int)*szSecond)&255) )? -1 : 1;
|
||||
// printf( "\n|%c|%c|%d %d %d",*szFirst,*szSecond,((int)*szFirst)&255,((int)*szSecond)&255,iRet );
|
||||
break;
|
||||
}
|
||||
if( cdpage->nMulti && i )
|
||||
{
|
||||
int j, nd1 = 0, nd2 = 0;
|
||||
PHB_MULTICHAR pmulti = cdpage->multi;
|
||||
// printf( "\nhb_cdpcmp-1 %c %c",*szFirst,*szSecond );
|
||||
for( j=0; j<cdpage->nMulti; j++,pmulti++ )
|
||||
{
|
||||
if( ( *szFirst == pmulti->cLast[0] ||
|
||||
*szFirst == pmulti->cLast[1] ) &&
|
||||
( *(szFirst-1) == pmulti->cFirst[0] ||
|
||||
*(szFirst-1) == pmulti->cFirst[1] ) )
|
||||
nd1 = pmulti->nCode;
|
||||
if( ( *szSecond == pmulti->cLast[0] ||
|
||||
*szSecond == pmulti->cLast[1] ) &&
|
||||
( *(szSecond-1) == pmulti->cFirst[0] ||
|
||||
*(szSecond-1) == pmulti->cFirst[1] ) )
|
||||
nd2 = pmulti->nCode;
|
||||
}
|
||||
// printf( "\nhb_cdpcmp-2 %d %d",nd1,nd2 );
|
||||
if( nd1 && !nd2 )
|
||||
{
|
||||
n2 = (int)cdpage->s_chars[ ((int)*(szSecond-1))&255 ];
|
||||
iRet = ( nd1 < n2 )? -1 : 1;
|
||||
break;
|
||||
}
|
||||
else if( !nd1 && nd2 )
|
||||
{
|
||||
n1 = (int)cdpage->s_chars[ ((int)*(szFirst-1))&255 ];
|
||||
iRet = ( n1 < nd2 )? -1 : 1;
|
||||
// printf( "\nhb_cdpcmp-3 %d %d %d",iRet,n1,nd2 );
|
||||
break;
|
||||
}
|
||||
else if( nd1 && nd2 )
|
||||
{
|
||||
iRet = ( nd1 < nd2 )? -1 : 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( cdpage->lAccInterleave && !lAcc1 && !lAcc2 )
|
||||
{
|
||||
if( cdpage->s_accent[ ((int)*(szFirst))&255 ] == *((BYTE*)szSecond) )
|
||||
lAcc1 = TRUE;
|
||||
else if( cdpage->s_accent[ ((int)*(szSecond))&255 ] == *((BYTE*)szFirst) )
|
||||
lAcc2 = TRUE;
|
||||
else
|
||||
{
|
||||
iRet = ( n1 < n2 )? -1 : 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iRet = ( n1 < n2 )? -1 : 1;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// printf( " : %d",iRet );
|
||||
|
||||
if( !iRet && lAcc1 )
|
||||
return 1;
|
||||
else if( !iRet && lAcc2 )
|
||||
return -1;
|
||||
return iRet;
|
||||
}
|
||||
|
||||
@@ -246,6 +365,10 @@ void hb_cdpReleaseAll( void )
|
||||
hb_xfree( s_cdpList[ iPos ]->s_upper );
|
||||
if( s_cdpList[ iPos ]->s_lower )
|
||||
hb_xfree( s_cdpList[ iPos ]->s_lower );
|
||||
if( s_cdpList[ iPos ]->s_accent )
|
||||
hb_xfree( s_cdpList[ iPos ]->s_accent );
|
||||
if( s_cdpList[ iPos ]->multi )
|
||||
hb_xfree( s_cdpList[ iPos ]->multi );
|
||||
iPos ++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user