From 71dca700b4a1cb6db7738c6567e3d70a2756ccc0 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Fri, 20 Apr 2001 08:55:10 +0000 Subject: [PATCH] *** empty log message *** --- harbour/ChangeLog | 35 ++++ harbour/contrib/libct/Makefile | 5 +- harbour/contrib/libct/addascii.c | 2 +- harbour/contrib/libct/atadjust.c | 2 +- harbour/contrib/libct/atnum.c | 4 +- harbour/contrib/libct/charevod.c | 201 +++++++++++++++++++++++ harbour/contrib/libct/ctchrevn.c | 55 ------- harbour/contrib/libct/ctchrodd.c | 55 ------- harbour/contrib/libct/ctset.c | 6 +- harbour/contrib/libct/makefile.bc | 17 +- harbour/contrib/libct/makefile.vc | 8 +- harbour/contrib/libct/tests/Makefile | 2 + harbour/contrib/libct/tests/chareven.prg | 77 +++++++++ harbour/contrib/libct/tests/charodd.prg | 76 +++++++++ 14 files changed, 409 insertions(+), 136 deletions(-) create mode 100644 harbour/contrib/libct/charevod.c delete mode 100644 harbour/contrib/libct/ctchrevn.c delete mode 100644 harbour/contrib/libct/ctchrodd.c create mode 100644 harbour/contrib/libct/tests/chareven.prg create mode 100644 harbour/contrib/libct/tests/charodd.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1ece716f63..8914c536a8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,38 @@ +2001-04-20 10:50 CET Martin Vogel + + + contrib/libct/charevod.c + - contrib/libct/ctchrevn.c + - contrib/libct/ctchrodd.c + ! CHAREVEN() & CHARODD() functions merged to one file, some corrections + + * contrib/libct/Makefile + * changed lib name to "ct3" again (sorry !) + + added contrib/libct/charevod.c + - removed contrib/libct/ctchrevn.c + - removed contrib/libct/ctchrodd.c + + * contrib/libct/makefile.bc + * changed lib name to "ct3" again (sorry !) + + added contrib/libct/charevod.c + - removed contrib/libct/ctchrevn.c + - removed contrib/libct/ctchrodd.c + + * contrib/libct/makefile.vc + * changed lib name to "ct3" again (sorry !) + + added contrib/libct/charevod.c + - removed contrib/libct/ctchrevn.c + - removed contrib/libct/ctchrodd.c + + + contrib/libct/tests/chareven.prg + ! Small test program for chareven() + + + contrib/libct/tests/charodd.prg + ! Small test program for charodd() + + * contrib/libct/tests/Makefile + + added contrib/libct/tests/chareven.prg + + added contrib/libct/tests/charodd.prg + 2001-04-20 01:35 UTC-0800 Ron Pinkas * hb_slex.bc * Synched with makefile.bc diff --git a/harbour/contrib/libct/Makefile b/harbour/contrib/libct/Makefile index 2524667626..4acab09a9d 100644 --- a/harbour/contrib/libct/Makefile +++ b/harbour/contrib/libct/Makefile @@ -8,12 +8,11 @@ C_SOURCES=\ addascii.c \ atadjust.c \ atnum.c \ + charevod.c \ ctset.c \ ctstr.c \ ctchksum.c \ - ctchrevn.c \ ctchrmix.c \ - ctchrodd.c \ ctcolton.c \ ctcrypt.c \ ctposupp.c \ @@ -22,6 +21,6 @@ PRG_SOURCES=\ ctmisc.prg \ cttoken.prg \ -LIBNAME=libct +LIBNAME=ct3 include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/contrib/libct/addascii.c b/harbour/contrib/libct/addascii.c index 8d751d4950..f83fc83f46 100644 --- a/harbour/contrib/libct/addascii.c +++ b/harbour/contrib/libct/addascii.c @@ -114,7 +114,7 @@ * $PLATFORMS$ * All * $FILES$ - * Source is addascii.c, library is libct. + * Source is addascii.c, library is ct3. * $SEEALSO$ * CSETREF() * $END$ diff --git a/harbour/contrib/libct/atadjust.c b/harbour/contrib/libct/atadjust.c index 33cef04da1..87d12370e9 100644 --- a/harbour/contrib/libct/atadjust.c +++ b/harbour/contrib/libct/atadjust.c @@ -92,7 +92,7 @@ * $PLATFORMS$ * All * $FILES$ - * Source is atadjust.c, library is libct. + * Source is atadjust.c, library is ct3. * $SEEALSO$ * SETATLIKE() CSETATMUPA() * $END$ diff --git a/harbour/contrib/libct/atnum.c b/harbour/contrib/libct/atnum.c index 124da19fbc..2bdb5ba620 100644 --- a/harbour/contrib/libct/atnum.c +++ b/harbour/contrib/libct/atnum.c @@ -340,7 +340,7 @@ static void do_atnum (int iSwitch) * $PLATFORMS$ * All * $FILES$ - * Source is atnum.c, library is libct. + * Source is atnum.c, library is ct3. * $SEEALSO$ * ATNUM() BEFORATNUM() CSETATMUPA() SETATLIKE() * $END$ @@ -405,7 +405,7 @@ HB_FUNC (AFTERATNUM) * $PLATFORMS$ * All * $FILES$ - * Source is atnum.c, library is libct. + * Source is atnum.c, library is ct3. * $SEEALSO$ * ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE() * $END$ diff --git a/harbour/contrib/libct/charevod.c b/harbour/contrib/libct/charevod.c new file mode 100644 index 0000000000..437a466cbc --- /dev/null +++ b/harbour/contrib/libct/charevod.c @@ -0,0 +1,201 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * CT3 string functions + * - CHAREVEN() + * - CHARODD() + * + * Copyright 2000 Victor Szakats + * + * Merged into one file for optimization and some small corrections: + * (c) 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany + * Author: Martin Vogel + * + * 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 "ct.h" + + +#define DO_CHAREVOD_CHAREVEN 0 +#define DO_CHAREVOD_CHARODD 1 + +/* helper function */ +static void do_charevod (int iSwitch) +{ + + if (ISCHAR (1)) + { + + char *pcString = hb_parc (1); + size_t sLen = hb_parclen (1); + char *pcResult; + size_t sPos, sResultPos; + + if (sLen == 0) + { + hb_retc (""); + return; + } + + pcResult = hb_xgrab ((sLen+1)/2); + + if (iSwitch == DO_CHAREVOD_CHAREVEN) + sPos = 1; + else + sPos = 0; + + sResultPos = 0; + for (; sPos < sLen; sPos+=2) + pcResult[sResultPos++] = pcString[sPos]; + + if (sResultPos == 0) + hb_retc (""); + else + hb_retclen (pcResult, sResultPos); + + hb_xfree (pcResult); + + } + else + { + hb_retc (""); + } + +} + + +/* $DOC$ + * $FUNCNAME$ + * CHAREVEN() + * $CATEGORY$ + * CT3 string functions + * $ONELINER$ + * Returns the characters on the even positions in a string + * $SYNTAX$ + * CHAREVEN () --> cEvenString + * $ARGUMENTS$ + * processed string + * $RETURNS$ + * a string containing all character from even positions + * in + * $DESCRIPTION$ + * The CHAREVEN() function looks for the characters on the even positions + * in a given string, collects them and returns them as a string. + * $EXAMPLES$ + * ? CHAREVEN (" H E L L O !") -> "HELLO!" + * $TESTS$ + * CHAREVEN (" 1 2 3 4 5") == "12345" + * CHAREVEN (" 1 2 3 4 ") == "1234" + * CHAREVEN (" ") == "" + * $STATUS$ + * Ready + * $COMPLIANCE$ + * CHAREVEN() is compatible with CT3's CHAREVEN(). + * $PLATFORMS$ + * All + * $FILES$ + * Source is charevod.c, library is ct3. + * $SEEALSO$ + * CHARODD() CHARMIX() + * $END$ + */ + +HB_FUNC (CHAREVEN) +{ + + do_charevod (DO_CHAREVOD_CHAREVEN); + return; + +} + + +/* $DOC$ + * $FUNCNAME$ + * CHARODD() + * $CATEGORY$ + * CT3 string functions + * $ONELINER$ + * Returns the characters on the odd positions in a string + * $SYNTAX$ + * CHARODD () --> cOddString + * $ARGUMENTS$ + * processed string + * $RETURNS$ + * a string containing all character from odd positions + * in + * $DESCRIPTION$ + * The CHARODD() function looks for the characters on the odd positions + * in a given string, collects them and returns them as a string. + * $EXAMPLES$ + * ? CHARODD ("H E L L O ! ") -> "HELLO!" + * $TESTS$ + * CHARODD ("1A2B3C4D5E") == "12345" + * CHARODD ("1A2B3C4D5") == "12345" + * $STATUS$ + * Ready + * $COMPLIANCE$ + * CHARODD() is compatible with CT3's CHARODD(). + * $PLATFORMS$ + * All + * $FILES$ + * Source is charevod.c, library is ct3. + * $SEEALSO$ + * CHAREVEN() CHARMIX() + * $END$ + */ + +HB_FUNC (CHARODD) +{ + + do_charevod (DO_CHAREVOD_CHARODD); + return; + +} + + + diff --git a/harbour/contrib/libct/ctchrevn.c b/harbour/contrib/libct/ctchrevn.c deleted file mode 100644 index 5c7e8bed25..0000000000 --- a/harbour/contrib/libct/ctchrevn.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * CHAREVEN() CA-Tools function - * - * Copyright 2000 Victor 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 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/). - * - */ - -#include "hbapi.h" - -HB_FUNC( CHAREVEN ) -{ - if( ISCHAR( 1 ) ) - { - char * pszSource = hb_parc( 1 ); - ULONG ulLen = hb_parclen( 1 ); - ULONG i; - char * pszResult = ( char * ) hb_xgrab( ulLen / 2 ); - - for( i = 1; i <= ulLen; i += 2 ) - pszResult[ ( i - 1 ) / 2 ] = pszSource[ i ]; - - hb_retclen( pszResult, ulLen ); - hb_xfree( pszResult ); - } - else - hb_retc( "" ); -} diff --git a/harbour/contrib/libct/ctchrodd.c b/harbour/contrib/libct/ctchrodd.c deleted file mode 100644 index 6242387f9f..0000000000 --- a/harbour/contrib/libct/ctchrodd.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * $Id$ - */ - -/* - * Harbour Project source code: - * CHARODD() CA-Tools function - * - * Copyright 2000 Victor 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 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/). - * - */ - -#include "hbapi.h" - -HB_FUNC( CHARODD ) -{ - if( ISCHAR( 1 ) ) - { - char * pszSource = hb_parc( 1 ); - ULONG ulLen = hb_parclen( 1 ); - ULONG i; - char * pszResult = ( char * ) hb_xgrab( ulLen / 2 ); - - for( i = 0; i <= ulLen; i += 2 ) - pszResult[ i / 2 ] = pszSource[ i ]; - - hb_retclen( pszResult, ulLen ); - hb_xfree( pszResult ); - } - else - hb_retc( "" ); -} diff --git a/harbour/contrib/libct/ctset.c b/harbour/contrib/libct/ctset.c index f373d60221..0d6f3968e9 100644 --- a/harbour/contrib/libct/ctset.c +++ b/harbour/contrib/libct/ctset.c @@ -127,7 +127,7 @@ int ct_getref (void) * $PLATFORMS$ * All * $FILES$ - * Source is ctset.c, library is libct. + * Source is ctset.c, library is ct3. * $SEEALSO$ * ADDASCII() BLANK() CHARADD() * CHARAND() CHARMIRR() CHARNOT() @@ -209,7 +209,7 @@ int ct_getatmupa (void) * $PLATFORMS$ * All * $FILES$ - * Source is ctset.c, library is libct. + * Source is ctset.c, library is ct3. * $SEEALSO$ * ATNUM() AFTERATNUM() BEFORATNUM() * ATREPL() NUMAT() ATADJUST() @@ -322,7 +322,7 @@ char ct_getatlikechar (void) * $PLATFORMS$ * All * $FILES$ - * Source is ctset.c, header is ct.ch, library is libct. + * Source is ctset.c, header is ct.ch, library is ct3. * $SEEALSO$ * $END$ */ diff --git a/harbour/contrib/libct/makefile.bc b/harbour/contrib/libct/makefile.bc index c4e1cc41ec..7f2268accc 100644 --- a/harbour/contrib/libct/makefile.bc +++ b/harbour/contrib/libct/makefile.bc @@ -77,7 +77,7 @@ LDFLAGS = $(LDFLAGS) # Macros to access our library names # -TOOLS_LIB = $(LIB_DIR)\libct.lib +TOOLS_LIB = $(LIB_DIR)\ct3.lib HARBOUR_EXE = $(BIN_DIR)\harbour.exe @@ -93,12 +93,11 @@ TOOLS_LIB_OBJS = \ $(OBJ_DIR)\addascii.obj \ $(OBJ_DIR)\atadjust.obj \ $(OBJ_DIR)\atnum.obj \ + $(OBJ_DIR)\charevod.obj \ $(OBJ_DIR)\ctset.obj \ $(OBJ_DIR)\ctstr.obj \ $(OBJ_DIR)\ctchksum.obj \ - $(OBJ_DIR)\ctchrevn.obj \ $(OBJ_DIR)\ctchrmix.obj \ - $(OBJ_DIR)\ctchrodd.obj \ $(OBJ_DIR)\ctcolton.obj \ $(OBJ_DIR)\ctcrypt.obj \ $(OBJ_DIR)\ctposupp.obj \ @@ -135,6 +134,10 @@ $(OBJ_DIR)\atnum.obj : $(TOOLS_DIR)\atnum.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\charevod.obj : $(TOOLS_DIR)\charevod.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\ctset.obj : $(TOOLS_DIR)\ctset.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, @@ -147,18 +150,10 @@ $(OBJ_DIR)\ctchksum.obj : $(TOOLS_DIR)\ctchksum.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, -$(OBJ_DIR)\ctchrevn.obj : $(TOOLS_DIR)\ctchrevn.c - $(CC) $(CLIBFLAGS) -o$@ $** - tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, - $(OBJ_DIR)\ctchrmix.obj : $(TOOLS_DIR)\ctchrmix.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, -$(OBJ_DIR)\ctchrodd.obj : $(TOOLS_DIR)\ctchrodd.c - $(CC) $(CLIBFLAGS) -o$@ $** - tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, - $(OBJ_DIR)\ctcolton.obj : $(TOOLS_DIR)\ctcolton.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/contrib/libct/makefile.vc b/harbour/contrib/libct/makefile.vc index d24615258f..fd768e0c5c 100644 --- a/harbour/contrib/libct/makefile.vc +++ b/harbour/contrib/libct/makefile.vc @@ -76,7 +76,7 @@ LDFLAGS = $(LDFLAGS) # Macros to access our library names # -TOOLS_LIB = $(LIB_DIR)\libct.lib +TOOLS_LIB = $(LIB_DIR)\ct3.lib HARBOUR_EXE = $(BIN_DIR)\harbour.exe @@ -113,12 +113,11 @@ TOOLS_LIB_OBJS = \ $(OBJ_DIR)\addascii.obj \ $(OBJ_DIR)\atadjust.obj \ $(OBJ_DIR)\atnum.obj \ + $(OBJ_DIR)\charevod.obj \ $(OBJ_DIR)\ctset.obj \ $(OBJ_DIR)\ctstr.obj \ $(OBJ_DIR)\ctchksum.obj \ - $(OBJ_DIR)\ctchrevn.obj \ $(OBJ_DIR)\ctchrmix.obj \ - $(OBJ_DIR)\ctchrodd.obj \ $(OBJ_DIR)\ctcolton.obj \ $(OBJ_DIR)\ctcrypt.obj \ $(OBJ_DIR)\ctposupp.obj \ @@ -138,12 +137,11 @@ CLEAN: -@if exist $(OBJ_DIR)\addascii.* del $(OBJ_DIR)\addascii.* -@if exist $(OBJ_DIR)\atadjust.* del $(OBJ_DIR)\atadjust.* -@if exist $(OBJ_DIR)\atnum.* del $(OBJ_DIR)\atnum.* + -@if exist $(OBJ_DIR)\charevod.* del $(OBJ_DIR)\charevod.* -@if exist $(OBJ_DIR)\ctset.* del $(OBJ_DIR)\ctset.* -@if exist $(OBJ_DIR)\ctstr.* del $(OBJ_DIR)\ctstr.* -@if exist $(OBJ_DIR)\ctchksum.* del $(OBJ_DIR)\ctchksum.* - -@if exist $(OBJ_DIR)\ctchrevn.* del $(OBJ_DIR)\ctchrevn.* -@if exist $(OBJ_DIR)\ctchrmix.* del $(OBJ_DIR)\ctchrmix.* - -@if exist $(OBJ_DIR)\ctchrodd.* del $(OBJ_DIR)\ctchrodd.* -@if exist $(OBJ_DIR)\ctcolton.* del $(OBJ_DIR)\ctcolton.* -@if exist $(OBJ_DIR)\ctcrypt.* del $(OBJ_DIR)\ctcrypt.* -@if exist $(OBJ_DIR)\ctposupp.* del $(OBJ_DIR)\ctposupp.* diff --git a/harbour/contrib/libct/tests/Makefile b/harbour/contrib/libct/tests/Makefile index d9e5e828d0..59ecadbcde 100644 --- a/harbour/contrib/libct/tests/Makefile +++ b/harbour/contrib/libct/tests/Makefile @@ -35,6 +35,8 @@ PRG_SOURCES=\ atadjust.prg \ atnum.prg \ beforatn.prg \ + chareven.prg \ + charodd.prg \ csetref.prg \ csetatmu.prg \ setatlik.prg \ diff --git a/harbour/contrib/libct/tests/chareven.prg b/harbour/contrib/libct/tests/chareven.prg new file mode 100644 index 0000000000..59b02db775 --- /dev/null +++ b/harbour/contrib/libct/tests/chareven.prg @@ -0,0 +1,77 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Test CT3 function CHAREVEN() + * + * Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany + * Author: Martin Vogel + * + * 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 "../ct.ch" + + +procedure main + + qout ("Begin test of CHAREVEN()") + qout ("") + + // simple tests + qout ("Simple tests:") + qout ([ chareven (" 1 2 3 4 5") == "12345" ? --> "] + chareven (" 1 2 3 4 5") + ["]) + qout ([ chareven (" 1 2 3 4 ") == "1234" ? --> "] + chareven (" 1 2 3 4 ") + ["]) + qout ([ chareven (" ") == "" ? --> "] + chareven (" ") + ["]) + + qout ("End test of CHAREVEN()") + qout ("") + +return + + + + diff --git a/harbour/contrib/libct/tests/charodd.prg b/harbour/contrib/libct/tests/charodd.prg new file mode 100644 index 0000000000..bff004610a --- /dev/null +++ b/harbour/contrib/libct/tests/charodd.prg @@ -0,0 +1,76 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Test CT3 function CHARODD() + * + * Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany + * Author: Martin Vogel + * + * 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 "../ct.ch" + + +procedure main + + qout ("Begin test of CHARODD()") + qout ("") + + // simple tests + qout ("Simple tests:") + qout ([ charodd ("1A2B3C4D5E") == "12345" ? --> "] + charodd ("1A2B3C4D5E") + ["]) + qout ([ charodd ("1A2B3C4D5") == "12345" ? --> "] + charodd ("1A2B3C4D5") + ["]) + + qout ("End test of CHARODD()") + qout ("") + +return + + + +