See ChangeLog entry 19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
This commit is contained in:
@@ -1,3 +1,28 @@
|
||||
19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
* makefile.b31
|
||||
- Added itemapi.h as dependancy for arrays.obj
|
||||
* makefile.icc
|
||||
- Added new GT string modules
|
||||
- Added Harbour include file dependencies to library sources
|
||||
* source/rtl/arrays.c
|
||||
- Added #include <itemapi.h>, which is needed by C++ compilers
|
||||
* source/rtl/console.c
|
||||
- Removed two trailing semicolons from #endif directives
|
||||
* source/rtl/gtapi.c
|
||||
- When adding HARBOUR MaxRow() and MaxCol() earlier, I forgot the
|
||||
rule that Harbour functions may not use any lower case letters
|
||||
- Added end comment for comment block around color tests in order
|
||||
to avoid having nested comments
|
||||
* source/tools/chareven.c
|
||||
- Added (char *) type conversion to _xgrab() function call
|
||||
* source/tools/charmix.c
|
||||
- Added (char *) type conversion to _xgrab() function call
|
||||
* source/tools/charodd.c
|
||||
- Added (char *) type conversion to _xgrab() function call
|
||||
* source/tools/strexpan.c
|
||||
- Added (char *) type conversion to _xgrab() function call
|
||||
|
||||
|
||||
19990602-13:05 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
* makefile.b31
|
||||
- Added the new gt functions (which have nothing to do with the GT API)
|
||||
@@ -45,7 +70,7 @@
|
||||
- source\tools\strpbrk.c
|
||||
- source\tools\strright.c
|
||||
+ doc\vm.txt - description of Harbour Virtual Machine
|
||||
|
||||
|
||||
19990602-12:30 CET Eddie Runia
|
||||
* source/rtl/arrays.c
|
||||
memory leakage in arrayClone plugged
|
||||
|
||||
@@ -40,8 +40,8 @@ console.obj : console.c extend.h types.h ctoharb.h dates.h gtapi.h set.h
|
||||
tlib .\libs\b16\terminal.lib -+$@,,
|
||||
# bcc -c -DWINDOWS $(c_opt) -o$@ source\rtl\console.c
|
||||
# tlib .\libs\win16\terminal.lib -+$@,,
|
||||
|
||||
arrays.obj : arrays.c extend.h types.h ctoharb.h
|
||||
|
||||
arrays.obj : arrays.c extend.h types.h itemapi.h ctoharb.h
|
||||
asort.obj : asort.prg extend.h types.h init.h pcode.h harbour.exe
|
||||
classes.obj : classes.c extend.h types.h itemapi.h
|
||||
codebloc.obj : codebloc.c extend.h types.h
|
||||
|
||||
@@ -42,14 +42,30 @@ $(path_lib)\hbtools.lib: \
|
||||
$(path_obj)\genobj.obj \
|
||||
$(path_obj)\mathx.obj \
|
||||
$(path_obj)\stringsx.obj \
|
||||
#(path_obj)\datesx.obj
|
||||
$(path_obj)\asciisum.obj \
|
||||
$(path_obj)\ascpos.obj \
|
||||
$(path_obj)\atdiff.obj \
|
||||
$(path_obj)\chareven.obj \
|
||||
$(path_obj)\charmix.obj \
|
||||
$(path_obj)\charodd.obj \
|
||||
$(path_obj)\chrcount.obj \
|
||||
$(path_obj)\chrfirst.obj \
|
||||
$(path_obj)\chrtotal.obj \
|
||||
$(path_obj)\strasint.obj \
|
||||
$(path_obj)\strcount.obj \
|
||||
$(path_obj)\strcspn.obj \
|
||||
$(path_obj)\strdiff.obj \
|
||||
$(path_obj)\strexpan.obj \
|
||||
$(path_obj)\strleft.obj \
|
||||
$(path_obj)\strpbrk.obj \
|
||||
$(path_obj)\strright.obj
|
||||
@echo HBtools.lib
|
||||
|
||||
$(path_lib)\terminal.lib :$(path_obj)\console.obj \
|
||||
$(path_obj)\gtos2.obj
|
||||
@echo terminal.lib
|
||||
|
||||
$(path_obj)\console.obj : {$(path_c)}console.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\gtapi.h
|
||||
$(path_obj)\console.obj : {$(path_c)}console.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\gtapi.h $(path_h)\ctoharb.h $(path_h)\dates.h $(path_h)\set.h
|
||||
icc /C+ $(c_opt) /Fo$@ /Tpsource\rtl\console.c
|
||||
ilib .\libs\icc\terminal.lib -+$@,,
|
||||
|
||||
@@ -57,41 +73,59 @@ $(path_obj)\gtos2.obj : {$(path_c)}gtos2.c $(path_h)\extend.h $(path_h)\types.
|
||||
icc /C+ $(c_opt) /Fo$@ /Tpsource\rtl\gt\gtos2.c
|
||||
ilib .\libs\icc\terminal.lib -+$@,,
|
||||
|
||||
$(path_obj)\arrays.obj : {$(path_c)}arrays.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\arrays.obj : {$(path_c)}arrays.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\itemapi.h $(path_h)\ctoharb.h
|
||||
$(path_obj)\classes.obj : {$(path_c)}classes.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\codebloc.obj : {$(path_c)}codebloc.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\dates.obj : {$(path_c)}dates.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\datesx.obj : {$(path_c)}datesx.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\codebloc.obj : {$(path_c)}codebloc.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\itemapi.h
|
||||
$(path_obj)\dates.obj : {$(path_c)}dates.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\dates.h $(path_h)\set.h
|
||||
$(path_obj)\debug.obj : {$(path_c)}debug.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\itemapi.h
|
||||
$(path_obj)\environ.obj : {$(path_c)}environ.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\errorapi.obj : {$(path_c)}errorapi.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\extend.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\errorapi.obj : {$(path_c)}errorapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h
|
||||
$(path_obj)\extend.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\set.h
|
||||
$(path_obj)\files.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\gtapi.obj : {$(path_c)}gtapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\gtapi.h
|
||||
$(path_obj)\initsymb.obj : {$(path_c)}initsymb.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\itemapi.obj : {$(path_c)}itemapi.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\itemapi.obj : {$(path_c)}itemapi.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\itemapi.h $(path_h)\set.h
|
||||
$(path_obj)\math.obj : {$(path_c)}math.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\mathx.obj : {$(path_c)}mathx.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\set.obj : {$(path_c)}set.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strcmp.obj : {$(path_c)}strcmp.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strings.obj : {$(path_c)}strings.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\set.obj : {$(path_c)}set.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\set.h
|
||||
$(path_obj)\strcmp.obj : {$(path_c)}strcmp.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\set.h
|
||||
$(path_obj)\strings.obj : {$(path_c)}strings.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\set.h
|
||||
$(path_obj)\stringsx.obj : {$(path_c)}stringsx.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\transfrm.obj : {$(path_c)}transfrm.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\transfrm.obj : {$(path_c)}transfrm.c $(path_h)\extend.h $(path_h)\types.h $(path_h)\ctoharb.h $(path_h)\set.h
|
||||
|
||||
$(path_obj)\asciisum.obj : {$(path_c)}asciisum.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\ascpos.obj : {$(path_c)}ascpos.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\atdiff.obj : {$(path_c)}atdiff.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\chareven.obj : {$(path_c)}chareven.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\charmix.obj : {$(path_c)}charmix.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\charodd.obj : {$(path_c)}charodd.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\chrcount.obj : {$(path_c)}chrcount.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\chrfirst.obj : {$(path_c)}chrfirst.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\chrtotal.obj : {$(path_c)}chrtotal.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strasint.obj : {$(path_c)}strasint.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strcount.obj : {$(path_c)}strcount.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strcspn.obj : {$(path_c)}strcspn.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strdiff.obj : {$(path_c)}strdiff.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strexpan.obj : {$(path_c)}strexpan.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strleft.obj : {$(path_c)}strleft.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strpbrk.obj : {$(path_c)}strpbrk.c $(path_h)\extend.h $(path_h)\types.h
|
||||
$(path_obj)\strright.obj : {$(path_c)}strright.c $(path_h)\extend.h $(path_h)\types.h
|
||||
|
||||
$(path_obj)\dynsym.obj : source\vm\dynsym.c $(path_h)\extend.h $(path_h)\types.h
|
||||
icc /C+ $(c_opt) /Fo$@ /Tpsource\vm\dynsym.c
|
||||
icc /C+ $(c_opt) /Fo$@ /Tpsource\vm\dynsym.c
|
||||
ilib .\libs\icc\harbour.lib -+$@,,
|
||||
|
||||
$(path_obj)\error.obj : $(path_prg)\error.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_obj)\error.obj : $(path_prg)\error.prg $(path_h)\pcode.h $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_exe)\harbour $(path_prg)\error /n /osource\rtl
|
||||
icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\error.c
|
||||
ilib .\libs\icc\harbour.lib -+$@,,
|
||||
|
||||
$(path_obj)\errorsys.obj : $(path_prg)\errorsys.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_obj)\errorsys.obj : $(path_prg)\errorsys.prg $(path_h)\pcode.h $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_exe)\harbour $(path_prg)\errorsys /n /osource\rtl
|
||||
icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\errorsys.c
|
||||
ilib .\libs\icc\harbour.lib -+$@,,
|
||||
|
||||
$(path_obj)\tclass.obj : $(path_prg)\tclass.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_obj)\tclass.obj : $(path_prg)\tclass.prg $(path_h)\pcode.h $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe
|
||||
$(path_exe)\harbour $(path_prg)\tclass /n /osource\rtl
|
||||
icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\tclass.c
|
||||
ilib .\libs\icc\harbour.lib -+$@,,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <itemapi.h>
|
||||
#include <extend.h>
|
||||
#include <ctoharb.h>
|
||||
|
||||
@@ -28,9 +29,9 @@ void hb_arrayNew( PITEM pItem, ULONG ulLen ) /* creates a new array */
|
||||
pItem->wType = IT_ARRAY;
|
||||
|
||||
if( ulLen )
|
||||
pBaseArray->pItems = ( PITEM ) _xgrab( sizeof( ITEM ) * ulLen );
|
||||
pBaseArray->pItems = ( PITEM ) _xgrab( sizeof( ITEM ) * ulLen );
|
||||
else
|
||||
pBaseArray->pItems = 0;
|
||||
pBaseArray->pItems = 0;
|
||||
|
||||
pBaseArray->ulLen = ulLen;
|
||||
pBaseArray->wHolders = 1;
|
||||
@@ -55,14 +56,14 @@ void hb_arrayGet( PITEM pArray, ULONG ulIndex, PITEM pItem )
|
||||
if( IS_ARRAY( pArray ) )
|
||||
{
|
||||
if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) )
|
||||
ItemCopy( pItem, ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ( ulIndex - 1 ) );
|
||||
ItemCopy( pItem, ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ( ulIndex - 1 ) );
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -78,21 +79,21 @@ char *hb_arrayGetString( PITEM pArray, ULONG ulIndex )
|
||||
if( IS_ARRAY( pArray ) )
|
||||
{
|
||||
if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) )
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
|
||||
if( IS_STRING( pItem ) )
|
||||
return pItem->value.szText;
|
||||
else
|
||||
return "";
|
||||
}
|
||||
if( IS_STRING( pItem ) )
|
||||
return pItem->value.szText;
|
||||
else
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,21 +110,21 @@ ULONG hb_arrayGetStringLen( PITEM pArray, ULONG ulIndex )
|
||||
if( IS_ARRAY( pArray ) )
|
||||
{
|
||||
if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) )
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
|
||||
if( IS_STRING( pItem ) )
|
||||
return pItem->wLength;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
if( IS_STRING( pItem ) )
|
||||
return pItem->wLength;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -140,17 +141,17 @@ int hb_arrayGetType( PITEM pArray, ULONG ulIndex )
|
||||
if( IS_ARRAY( pArray ) )
|
||||
{
|
||||
if( ulIndex <= ( unsigned ) hb_arrayLen( pArray ) )
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
return pItem->wType;
|
||||
}
|
||||
{
|
||||
PITEM pItem = ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ulIndex - 1;
|
||||
return pItem->wType;
|
||||
}
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, "Bound error: Array access" );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, "Bound error: Array access" );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -159,7 +160,7 @@ void hb_arrayLast( PITEM pArray, PITEM pResult )
|
||||
{
|
||||
if ( ( ( PBASEARRAY ) pArray->value.pBaseArray )->ulLen )
|
||||
ItemCopy( pResult, ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems +
|
||||
( ( ( PBASEARRAY ) pArray->value.pBaseArray )->ulLen - 1 ) );
|
||||
( ( ( PBASEARRAY ) pArray->value.pBaseArray )->ulLen - 1 ) );
|
||||
else
|
||||
ItemRelease( pResult );
|
||||
}
|
||||
@@ -183,14 +184,14 @@ void hb_arraySet( PITEM pArray, ULONG ulIndex, PITEM pItem )
|
||||
if( IS_ARRAY( pArray ) )
|
||||
{
|
||||
if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) )
|
||||
ItemCopy( ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ( ulIndex - 1 ), pItem );
|
||||
ItemCopy( ( ( PBASEARRAY ) pArray->value.pBaseArray )->pItems + ( ulIndex - 1 ), pItem );
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -209,30 +210,30 @@ void hb_arraySize( PITEM pArray, ULONG ulLen )
|
||||
ULONG ul;
|
||||
|
||||
if( ! pBaseArray->ulLen )
|
||||
{
|
||||
pBaseArray->pItems = ( PITEM ) _xgrab( ulLen * sizeof( ITEM ) );
|
||||
for ( ul = 0; ul < ulLen; ul ++ )
|
||||
( pBaseArray->pItems + ul )->wType = IT_NIL;
|
||||
}
|
||||
{
|
||||
pBaseArray->pItems = ( PITEM ) _xgrab( ulLen * sizeof( ITEM ) );
|
||||
for ( ul = 0; ul < ulLen; ul ++ )
|
||||
( pBaseArray->pItems + ul )->wType = IT_NIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pBaseArray->ulLen < ulLen )
|
||||
{
|
||||
pBaseArray->pItems = ( PITEM )_xrealloc( pBaseArray->pItems, sizeof( ITEM ) * ulLen );
|
||||
{
|
||||
if( pBaseArray->ulLen < ulLen )
|
||||
{
|
||||
pBaseArray->pItems = ( PITEM )_xrealloc( pBaseArray->pItems, sizeof( ITEM ) * ulLen );
|
||||
|
||||
/* set value for new items */
|
||||
for( ul = pBaseArray->ulLen; ul < ulLen; ul++ )
|
||||
( pBaseArray->pItems + ul )->wType = IT_NIL;
|
||||
}
|
||||
else if( pBaseArray->ulLen > ulLen )
|
||||
{
|
||||
/* release old items */
|
||||
for( ul = ulLen; ul < pBaseArray->ulLen; ul++ )
|
||||
ItemRelease( pBaseArray->pItems + ul );
|
||||
/* set value for new items */
|
||||
for( ul = pBaseArray->ulLen; ul < ulLen; ul++ )
|
||||
( pBaseArray->pItems + ul )->wType = IT_NIL;
|
||||
}
|
||||
else if( pBaseArray->ulLen > ulLen )
|
||||
{
|
||||
/* release old items */
|
||||
for( ul = ulLen; ul < pBaseArray->ulLen; ul++ )
|
||||
ItemRelease( pBaseArray->pItems + ul );
|
||||
|
||||
pBaseArray->pItems = ( PITEM )_xrealloc( pBaseArray->pItems, sizeof( ITEM ) * ulLen );
|
||||
}
|
||||
}
|
||||
pBaseArray->pItems = ( PITEM )_xrealloc( pBaseArray->pItems, sizeof( ITEM ) * ulLen );
|
||||
}
|
||||
}
|
||||
pBaseArray->ulLen = ulLen;
|
||||
}
|
||||
else
|
||||
@@ -252,18 +253,18 @@ void hb_arrayFill( PITEM pArray, PITEM pValue, ULONG ulStart, ULONG ulCount )
|
||||
ULONG ulLen = hb_arrayLen( pArray );
|
||||
|
||||
if ( ulStart == 0 ) /* if parameter is missing */
|
||||
ulStart = 1;
|
||||
ulStart = 1;
|
||||
|
||||
if ( ulCount == 0 ) /* if parameter is missing */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
if ( ulStart + ulCount > ulLen ) /* check range */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
for ( ; ulCount > 0; ulCount --, ulStart ++ ) /* set value items */
|
||||
ItemCopy( pBaseArray->pItems + ( ulStart - 1 ), pValue );
|
||||
ItemCopy( pBaseArray->pItems + ( ulStart - 1 ), pValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -281,23 +282,23 @@ void hb_arrayDel( PITEM pArray, ULONG ulIndex )
|
||||
ULONG ulLen = hb_arrayLen( pArray );
|
||||
|
||||
if ( ulIndex > 0 && ulIndex <= ulLen )
|
||||
{
|
||||
PBASEARRAY pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
{
|
||||
PBASEARRAY pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
ItemRelease( pBaseArray->pItems + ( ulIndex - 1 ) );
|
||||
ItemRelease( pBaseArray->pItems + ( ulIndex - 1 ) );
|
||||
|
||||
for ( ulIndex --; ulIndex < ulLen; ulIndex ++ ) /* move items */
|
||||
ItemCopy( pBaseArray->pItems + ulIndex, pBaseArray->pItems + ( ulIndex + 1 ) );
|
||||
for ( ulIndex --; ulIndex < ulLen; ulIndex ++ ) /* move items */
|
||||
ItemCopy( pBaseArray->pItems + ulIndex, pBaseArray->pItems + ( ulIndex + 1 ) );
|
||||
|
||||
ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
}
|
||||
ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -315,23 +316,23 @@ void hb_arrayIns( PITEM pArray, ULONG ulIndex )
|
||||
ULONG ulLen = hb_arrayLen( pArray );
|
||||
|
||||
if ( ulIndex > 0 && ulIndex <= ulLen )
|
||||
{
|
||||
PBASEARRAY pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
{
|
||||
PBASEARRAY pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
|
||||
for ( ulLen --; ulLen >= ulIndex; ulLen -- ) /* move items */
|
||||
ItemCopy( pBaseArray->pItems + ulLen, pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
for ( ulLen --; ulLen >= ulIndex; ulLen -- ) /* move items */
|
||||
ItemCopy( pBaseArray->pItems + ulLen, pBaseArray->pItems + ( ulLen - 1 ) );
|
||||
|
||||
ItemRelease( pBaseArray->pItems + ulLen );
|
||||
}
|
||||
ItemRelease( pBaseArray->pItems + ulLen );
|
||||
}
|
||||
else
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
{
|
||||
PITEM pError = _errNew();
|
||||
_errPutDescription( pError, szBoundError );
|
||||
_errLaunch( pError );
|
||||
_errRelease( pError );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -351,64 +352,64 @@ int hb_arrayScan( PITEM pArray, PITEM pValue, ULONG ulStart, ULONG ulCount )
|
||||
ULONG ulLen = hb_arrayLen( pArray );
|
||||
|
||||
if ( ulStart == 0 ) /* if parameter is missing */
|
||||
ulStart = 1;
|
||||
ulStart = 1;
|
||||
|
||||
if ( ulCount == 0 ) /* if parameter is missing */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
if ( ulStart + ulCount > ulLen ) /* check range */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
for ( ulStart --; ulCount > 0; ulCount --, ulStart ++ )
|
||||
{
|
||||
PITEM pItem = pBaseArray->pItems + ulStart;
|
||||
{
|
||||
PITEM pItem = pBaseArray->pItems + ulStart;
|
||||
|
||||
if ( pValue->wType == IT_BLOCK )
|
||||
{
|
||||
PushSymbol( &symEval );
|
||||
Push( pValue );
|
||||
Push( pItem );
|
||||
Do( 1 );
|
||||
if ( stack.Return.value.iLogical )
|
||||
iRet = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( pValue->wType == pItem->wType )
|
||||
{
|
||||
switch( pItem->wType )
|
||||
{
|
||||
case IT_INTEGER :
|
||||
iRet = ( pValue->value.iNumber == pItem->value.iNumber );
|
||||
break;
|
||||
if ( pValue->wType == IT_BLOCK )
|
||||
{
|
||||
PushSymbol( &symEval );
|
||||
Push( pValue );
|
||||
Push( pItem );
|
||||
Do( 1 );
|
||||
if ( stack.Return.value.iLogical )
|
||||
iRet = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( pValue->wType == pItem->wType )
|
||||
{
|
||||
switch( pItem->wType )
|
||||
{
|
||||
case IT_INTEGER :
|
||||
iRet = ( pValue->value.iNumber == pItem->value.iNumber );
|
||||
break;
|
||||
|
||||
case IT_LONG :
|
||||
iRet = ( pValue->value.lNumber == pItem->value.lNumber );
|
||||
break;
|
||||
case IT_LONG :
|
||||
iRet = ( pValue->value.lNumber == pItem->value.lNumber );
|
||||
break;
|
||||
|
||||
case IT_DOUBLE :
|
||||
iRet = ( pValue->value.dNumber == pItem->value.dNumber );
|
||||
break;
|
||||
case IT_DOUBLE :
|
||||
iRet = ( pValue->value.dNumber == pItem->value.dNumber );
|
||||
break;
|
||||
|
||||
case IT_DATE :
|
||||
iRet = ( pValue->value.lDate == pItem->value.lDate );
|
||||
break;
|
||||
case IT_DATE :
|
||||
iRet = ( pValue->value.lDate == pItem->value.lDate );
|
||||
break;
|
||||
|
||||
case IT_LOGICAL :
|
||||
iRet = ( pValue->value.iLogical == pItem->value.iLogical );
|
||||
break;
|
||||
case IT_LOGICAL :
|
||||
iRet = ( pValue->value.iLogical == pItem->value.iLogical );
|
||||
break;
|
||||
|
||||
case IT_STRING :
|
||||
case IT_STRING :
|
||||
iRet = ( hb_itemStrCmp( pValue, pItem, FALSE ) == 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( iRet )
|
||||
return ulStart + 1; /* arrays start from 1 */
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( iRet )
|
||||
return ulStart + 1; /* arrays start from 1 */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -428,25 +429,25 @@ void hb_arrayEval( PITEM pArray, PITEM bBlock, ULONG ulStart, ULONG ulCount )
|
||||
ULONG ulLen = hb_arrayLen( pArray );
|
||||
|
||||
if ( ulStart == 0 ) /* if parameter is missing */
|
||||
ulStart = 1;
|
||||
ulStart = 1;
|
||||
|
||||
if ( ulCount == 0 ) /* if parameter is missing */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
if ( ulStart + ulCount > ulLen ) /* check range */
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
ulCount = ulLen - ulStart + 1;
|
||||
|
||||
pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
for ( ulStart --; ulCount > 0; ulCount --, ulStart ++ )
|
||||
{
|
||||
PITEM pItem = pBaseArray->pItems + ulStart;
|
||||
{
|
||||
PITEM pItem = pBaseArray->pItems + ulStart;
|
||||
|
||||
PushSymbol( &symEval );
|
||||
Push( bBlock );
|
||||
Push( pItem );
|
||||
Do( 1 );
|
||||
}
|
||||
PushSymbol( &symEval );
|
||||
Push( bBlock );
|
||||
Push( pItem );
|
||||
Do( 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -465,10 +466,10 @@ void hb_arrayRelease( PITEM pArray )
|
||||
PBASEARRAY pBaseArray = ( PBASEARRAY )pArray->value.pBaseArray;
|
||||
|
||||
for ( ul = 0; ul < ulLen; ul ++ )
|
||||
ItemRelease( pBaseArray->pItems + ul );
|
||||
ItemRelease( pBaseArray->pItems + ul );
|
||||
|
||||
if( pBaseArray->pItems )
|
||||
_xfree( pBaseArray->pItems );
|
||||
_xfree( pBaseArray->pItems );
|
||||
_xfree( pBaseArray );
|
||||
|
||||
pArray->wType = IT_NIL;
|
||||
@@ -484,7 +485,7 @@ void hb_arrayRelease( PITEM pArray )
|
||||
}
|
||||
|
||||
void hb_arrayCopy( PITEM pSrcArray, PITEM pDstArray, ULONG ulStart,
|
||||
ULONG ulCount, ULONG ulTarget )
|
||||
ULONG ulCount, ULONG ulTarget )
|
||||
{
|
||||
if ( IS_ARRAY( pSrcArray ) && IS_ARRAY( pDstArray ) )
|
||||
{
|
||||
@@ -493,27 +494,27 @@ void hb_arrayCopy( PITEM pSrcArray, PITEM pDstArray, ULONG ulStart,
|
||||
ULONG ulDstLen = hb_arrayLen( pDstArray );
|
||||
|
||||
if ( ulStart == 0 ) /* if parameter is missing */
|
||||
ulStart = 1;
|
||||
ulStart = 1;
|
||||
|
||||
if ( ulTarget == 0 ) /* if parameter is missing */
|
||||
ulTarget = 1;
|
||||
ulTarget = 1;
|
||||
|
||||
if ( ulCount == 0 ) /* if parameter is missing */
|
||||
ulCount = ulSrcLen - ulStart + 1;
|
||||
ulCount = ulSrcLen - ulStart + 1;
|
||||
|
||||
if ( ulStart + ulCount > ulSrcLen ) /* check range */
|
||||
ulCount = ulSrcLen - ulStart + 1;
|
||||
ulCount = ulSrcLen - ulStart + 1;
|
||||
|
||||
if ( ulCount > ulDstLen )
|
||||
ulCount = ulDstLen;
|
||||
ulCount = ulDstLen;
|
||||
|
||||
pSrcBaseArray = ( PBASEARRAY )pSrcArray->value.pBaseArray;
|
||||
pDstBaseArray = ( PBASEARRAY )pDstArray->value.pBaseArray;
|
||||
|
||||
for ( ulTarget --, ulStart --; ulCount > 0; ulCount --, ulStart ++ )
|
||||
{
|
||||
ItemCopy( pDstBaseArray->pItems + ( ulTarget + ulStart ), pSrcBaseArray->pItems + ulStart );
|
||||
}
|
||||
{
|
||||
ItemCopy( pDstBaseArray->pItems + ( ulTarget + ulStart ), pSrcBaseArray->pItems + ulStart );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ static void hb_outstd( char * fpStr, WORD uiLen )
|
||||
dev_col = gtWhereX();
|
||||
_gtSetPos( dev_row, dev_col );
|
||||
}
|
||||
#endif;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Output an item to STDERR */
|
||||
@@ -135,7 +135,7 @@ static void hb_outerr( char * fpStr, WORD uiLen )
|
||||
dev_col = gtWhereX();
|
||||
_gtSetPos( dev_row, dev_col );
|
||||
}
|
||||
#endif;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Output an item to the screen and/or printer and/or alternate */
|
||||
@@ -325,9 +325,9 @@ HARBOUR SETPRC( void ) /* Sets the current printer row and column positions */
|
||||
HARBOUR SCROLL( void ) /* Scrolls a screen region (requires the GT API) */
|
||||
{
|
||||
#ifdef USE_GTAPI
|
||||
int top = 0, left = 0, bottom = _gtMaxRow(), right = _gtMaxCol(),
|
||||
int top = 0, left = 0, bottom = _gtMaxRow(), right = _gtMaxCol(),
|
||||
v_scroll = 0, h_scroll = 0;
|
||||
|
||||
|
||||
if( _pcount() > 0 && _param( 1, IT_NUMERIC ) )
|
||||
top = _parni( 1 );
|
||||
if( _pcount() > 1 && _param( 2, IT_NUMERIC ) )
|
||||
|
||||
@@ -69,11 +69,11 @@ int _gtBox(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char *
|
||||
/* left and right sides */
|
||||
for(iCount = uiTop + 1; iCount<uiBottom; iCount++)
|
||||
{
|
||||
_gtSetPos(iCount, uiLeft);
|
||||
_gtWrite(&fpBoxString[3], 1);
|
||||
_gtSetPos(iCount, uiLeft);
|
||||
_gtWrite(&fpBoxString[3], 1);
|
||||
|
||||
_gtSetPos(iCount, uiRight);
|
||||
_gtWrite(&fpBoxString[3], 1);
|
||||
_gtSetPos(iCount, uiRight);
|
||||
_gtWrite(&fpBoxString[3], 1);
|
||||
}
|
||||
|
||||
/* left bottom corner */
|
||||
@@ -110,7 +110,7 @@ int _gtColorSelect(USHORT uiColorIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
s_uiColorIndex = uiColorIndex;
|
||||
s_uiColorIndex = uiColorIndex;
|
||||
}
|
||||
|
||||
return(0);
|
||||
@@ -206,10 +206,10 @@ int _gtPreExt(void)
|
||||
int _gtRectSize(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, USHORT * uipBuffSize)
|
||||
{
|
||||
if(uiTop > _gtMaxRow() || uiBottom > _gtMaxRow() ||
|
||||
uiLeft > _gtMaxCol() || uiRight > _gtMaxCol() ||
|
||||
uiTop > uiBottom || uiLeft > uiRight)
|
||||
uiLeft > _gtMaxCol() || uiRight > _gtMaxCol() ||
|
||||
uiTop > uiBottom || uiLeft > uiRight)
|
||||
{
|
||||
return(1);
|
||||
return(1);
|
||||
}
|
||||
|
||||
*uipBuffSize = (uiBottom - uiTop) * (uiRight - uiLeft) * 2;
|
||||
@@ -226,7 +226,7 @@ int _gtRepChar(USHORT uiRow, USHORT uiCol, USHORT uiChar, USHORT uiCount)
|
||||
buff[uiCount] = 0x0;
|
||||
rc=_gtSetPos(uiRow, uiCol);
|
||||
if(rc != 0)
|
||||
return(rc);
|
||||
return(rc);
|
||||
rc=_gtWrite(buff, uiCount);
|
||||
|
||||
return(rc);
|
||||
@@ -297,7 +297,7 @@ int _gtSetMode(USHORT uiRows, USHORT uiCols)
|
||||
int _gtSetPos(USHORT uiRow, USHORT uiCol)
|
||||
{
|
||||
if(uiRow > _gtMaxRow() || uiCol > _gtMaxCol())
|
||||
return(1);
|
||||
return(1);
|
||||
|
||||
s_uiCurrentRow = uiRow;
|
||||
s_uiCurrentCol = uiCol;
|
||||
@@ -492,12 +492,12 @@ int _gtScroll(USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHOR
|
||||
return(0);
|
||||
}
|
||||
|
||||
HARBOUR MaxRow( void ) /* Return the maximum screen row number (zero origin) */
|
||||
HARBOUR MAXROW( void ) /* Return the maximum screen row number (zero origin) */
|
||||
{
|
||||
_retni( _gtMaxRow () );
|
||||
}
|
||||
|
||||
HARBOUR MaxCol( void ) /* Return the maximum screen column number (zero origin) */
|
||||
HARBOUR MAXCOL( void ) /* Return the maximum screen column number (zero origin) */
|
||||
{
|
||||
_retni( _gtMaxCol () );
|
||||
}
|
||||
@@ -540,6 +540,7 @@ void main(void)
|
||||
_gtSetPos(22, 62);
|
||||
_gtColorSelect(_CLR_ENHANCED);
|
||||
_gtWrite( "Standard Color (W+/B)", 21 );
|
||||
*/
|
||||
|
||||
/* boxes */
|
||||
_gtBoxS(10, 10, 20, 20);
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
* ---------------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/06/02 19:53:28 dholm
|
||||
* See ChangeLog entry 19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
*
|
||||
* Revision 1.1 1999/06/02 06:32:42 ajahja
|
||||
* Adding GT Library
|
||||
*
|
||||
@@ -61,7 +64,7 @@ gt_charEven()
|
||||
s1 = _parc(1);
|
||||
len = _parclen(1);
|
||||
|
||||
s2 = _xgrab(len / 2); // grab us some mem to work with
|
||||
s2 = (char *)_xgrab(len / 2); // grab us some mem to work with
|
||||
|
||||
for (i = 1; i <= len; i += 2)
|
||||
s2[(i - 1)/2] = s1[i] & 0x7f;
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
* ---------------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/06/02 19:53:28 dholm
|
||||
* See ChangeLog entry 19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
*
|
||||
* Revision 1.1 1999/06/02 06:49:38 ajahja
|
||||
* Adding GT Library
|
||||
*
|
||||
@@ -68,7 +71,7 @@ gt_charMix()
|
||||
l2 = _parclen(2);
|
||||
pos = 0;
|
||||
|
||||
s3 = _xgrab(l1 + l2); // grab us some mem to work with
|
||||
s3 = (char*)_xgrab(l1 + l2); // grab us some mem to work with
|
||||
|
||||
for (i = 0; i < l1; i++) {
|
||||
s3[pos++] = s1[i];
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
* ---------------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/06/02 19:53:28 dholm
|
||||
* See ChangeLog entry 19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
*
|
||||
* Revision 1.1 1999/06/02 06:32:42 ajahja
|
||||
* Adding GT Library
|
||||
*
|
||||
@@ -61,7 +64,7 @@ GT_charOdd()
|
||||
s1 = _parc(1);
|
||||
len = _parclen(1);
|
||||
|
||||
s2 = _xgrab(len / 2); // grab us some mem to work with
|
||||
s2 = (char *)_xgrab(len / 2); // grab us some mem to work with
|
||||
|
||||
for (i = 0; i <= len; i += 2)
|
||||
s2[i/2] = s1[i] & 0x7f;
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
* ---------------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/06/02 19:53:28 dholm
|
||||
* See ChangeLog entry 19990602-14:50 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
*
|
||||
* Revision 1.1 1999/06/02 06:49:39 ajahja
|
||||
* Adding GT Library
|
||||
*
|
||||
@@ -75,7 +78,7 @@ gt_strexpand()
|
||||
if (ISCHAR(3))
|
||||
insert = _parc(3);
|
||||
|
||||
out = _xgrab(len * (nIns + 1)); // alloc us some memory
|
||||
out = (char *)_xgrab(len * (nIns + 1)); // alloc us some memory
|
||||
|
||||
for (i = 0, p = 0; i < len; i++) { // loop thru input
|
||||
out[p++] = in[i]; // insert a character from input
|
||||
|
||||
Reference in New Issue
Block a user