2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* *
* partial sync with the 3.4 fork codebase. These are the things
synces for the most part:
- copyright headers
- grammar/typos in comments and some readmes
- comment/whitespace/decorations
- variable scoping in C files
- DO CASE/SWITCH and some other alternate syntax usage
- minimal amount of human readable text in strings
- minor code updates
- HB_TRACE() void * casts for pointers and few other changes to
avoid C compiler warnings
- various other, minor code cleanups
- only Harbour/C code/headers were touched in src, utils, contrib,
include. No 3rd party code, no make files, and with just a few
exceptions, no 'tests' code was touched.
- certain components were not touched were 3.4 diverged too much
already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
- the goal was that no actual program logic should be altered by
these changes. Except some possible minor exceptions, any such
change is probably a bug in this patch.
It's a massive patch, if you find anything broken after it, please
open an Issue with the details. Build test was done on macOS.
The goal is make it easier to see what actual code/logic was changed
in 3.4 compared to 3.2 and to make patches easier to apply in both
ways.
This commit is contained in:
161
src/vm/arrays.c
161
src/vm/arrays.c
@@ -2,6 +2,10 @@
|
||||
* The Array API (C level)
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* (hb_arrayIsObject(), hb_arrayCopyC(), hb_arrayGetC())
|
||||
* Copyright 2001 Ron Pinkas <ron@profit-master.com>
|
||||
* (hb_arrayClone(), hb_arrayFromStack(), hb_arrayFromParams())
|
||||
*
|
||||
* 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
|
||||
@@ -44,23 +48,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_arrayIsObject()
|
||||
* hb_arrayCopyC()
|
||||
* hb_arrayGetC()
|
||||
*
|
||||
* Copyright 2001 Ron Pinkas <ron@profit-master.com>
|
||||
* hb_arrayClone()
|
||||
* hb_arrayFromStack()
|
||||
* hb_arrayFromParams()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmopt.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -161,9 +148,8 @@ HB_BOOL hb_arrayNew( PHB_ITEM pItem, HB_SIZE nLen ) /* creates a new array */
|
||||
{
|
||||
PHB_BASEARRAY pBaseArray;
|
||||
PHB_ITEM pItems;
|
||||
HB_SIZE nPos;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayNew(%p, %" HB_PFS "u)", pItem, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayNew(%p, %" HB_PFS "u)", ( void * ) pItem, nLen ) );
|
||||
|
||||
if( HB_IS_COMPLEX( pItem ) )
|
||||
hb_itemClear( pItem );
|
||||
@@ -175,6 +161,7 @@ HB_BOOL hb_arrayNew( PHB_ITEM pItem, HB_SIZE nLen ) /* creates a new array */
|
||||
*/
|
||||
if( nLen > 0 )
|
||||
{
|
||||
HB_SIZE nPos;
|
||||
pItems = ( PHB_ITEM ) hb_xgrab( sizeof( HB_ITEM ) * nLen );
|
||||
for( nPos = 0; nPos < nLen; ++nPos )
|
||||
( pItems + nPos )->type = HB_IT_NIL;
|
||||
@@ -196,7 +183,7 @@ HB_BOOL hb_arrayNew( PHB_ITEM pItem, HB_SIZE nLen ) /* creates a new array */
|
||||
|
||||
void hb_arraySwap( PHB_ITEM pArray1, PHB_ITEM pArray2 )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySwap(%p, %p)", pArray1, pArray2 ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySwap(%p, %p)", ( void * ) pArray1, ( void * ) pArray2 ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray1 ) && HB_IS_ARRAY( pArray2 ) )
|
||||
{
|
||||
@@ -210,7 +197,7 @@ void hb_arraySwap( PHB_ITEM pArray1, PHB_ITEM pArray2 )
|
||||
|
||||
HB_BOOL hb_arraySize( PHB_ITEM pArray, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySize(%p, %" HB_PFS "u)", pArray, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySize(%p, %" HB_PFS "u)", ( void * ) pArray, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -240,7 +227,7 @@ HB_BOOL hb_arraySize( PHB_ITEM pArray, HB_SIZE nLen )
|
||||
I've used here a little different formula. ulAllocated is divided by
|
||||
factor 2 ( >> 1 ) and 1 is added to requested size. This algorithm
|
||||
has properties:
|
||||
- reallocation count remains asymptoticaly logarithmic;
|
||||
- reallocation count remains asymptotically logarithmic;
|
||||
- saves memory for large arrays, because reallocation buffer
|
||||
size is not doubled, but multiplied by 1.5;
|
||||
- adding of 1, allows reduce reallocation count for small arrays.
|
||||
@@ -286,7 +273,7 @@ HB_BOOL hb_arraySize( PHB_ITEM pArray, HB_SIZE nLen )
|
||||
|
||||
HB_SIZE hb_arrayLen( PHB_ITEM pArray )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayLen(%p)", pArray ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayLen(%p)", ( void * ) pArray ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
return pArray->item.asArray.value->nLen;
|
||||
@@ -296,7 +283,7 @@ HB_SIZE hb_arrayLen( PHB_ITEM pArray )
|
||||
|
||||
HB_BOOL hb_arrayIsObject( PHB_ITEM pArray )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayIsObject(%p)", pArray ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayIsObject(%p)", ( void * ) pArray ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
return pArray->item.asArray.value->uiClass != 0;
|
||||
@@ -304,7 +291,7 @@ HB_BOOL hb_arrayIsObject( PHB_ITEM pArray )
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
/* retrives the array unique ID */
|
||||
/* retrieves the array unique ID */
|
||||
void * hb_arrayId( PHB_ITEM pArray )
|
||||
{
|
||||
if( pArray && HB_IS_ARRAY( pArray ) )
|
||||
@@ -328,7 +315,7 @@ PHB_ITEM hb_arrayFromId( PHB_ITEM pItem, void * pArrayId )
|
||||
|
||||
HB_BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayAdd(%p, %p)", pArray, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayAdd(%p, %p)", ( void * ) pArray, ( void * ) pValue ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -349,7 +336,7 @@ HB_BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pValue )
|
||||
|
||||
HB_BOOL hb_arrayAddForward( PHB_ITEM pArray, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayAddForward(%p, %p)", pArray, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayAddForward(%p, %p)", ( void * ) pArray, ( void * ) pValue ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -370,7 +357,7 @@ HB_BOOL hb_arrayAddForward( PHB_ITEM pArray, PHB_ITEM pValue )
|
||||
|
||||
HB_BOOL hb_arrayDel( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayDel(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayDel(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -400,7 +387,7 @@ HB_BOOL hb_arrayDel( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_BOOL hb_arrayIns( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayIns(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayIns(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -430,7 +417,7 @@ HB_BOOL hb_arrayIns( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_BOOL hb_arraySet( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySet(%p, %" HB_PFS "u, %p)", pArray, nIndex, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySet(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -443,7 +430,7 @@ HB_BOOL hb_arraySet( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_arraySetForward( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetForward(%p, %" HB_PFS "u, %p)", pArray, nIndex, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetForward(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -459,7 +446,7 @@ HB_BOOL hb_arraySetForward( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_arrayGet( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGet(%p, %" HB_PFS "u, %p)", pArray, nIndex, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGet(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -475,7 +462,7 @@ HB_BOOL hb_arrayGet( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_arrayGetItemRef( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetItemRef(%p, %" HB_PFS "u, %p)", pArray, nIndex, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetItemRef(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -504,7 +491,7 @@ HB_BOOL hb_arrayGetItemRef( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
*/
|
||||
PHB_ITEM hb_arrayGetItemPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetItemPtr(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetItemPtr(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return pArray->item.asArray.value->pItems + nIndex - 1;
|
||||
@@ -514,7 +501,7 @@ PHB_ITEM hb_arrayGetItemPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
char * hb_arrayGetDS( PHB_ITEM pArray, HB_SIZE nIndex, char * szDate )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetDS(%p, %" HB_PFS "u, %s)", pArray, nIndex, szDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetDS(%p, %" HB_PFS "u, %s)", ( void * ) pArray, nIndex, szDate ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetDS( pArray->item.asArray.value->pItems + nIndex - 1, szDate );
|
||||
@@ -526,7 +513,7 @@ char * hb_arrayGetDS( PHB_ITEM pArray, HB_SIZE nIndex, char * szDate )
|
||||
|
||||
long hb_arrayGetDL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetDL(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetDL(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetDL( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -538,7 +525,7 @@ long hb_arrayGetDL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
double hb_arrayGetTD( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetTD(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetTD(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetTD( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -548,7 +535,7 @@ double hb_arrayGetTD( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_BOOL hb_arrayGetTDT( PHB_ITEM pArray, HB_SIZE nIndex, long * plJulian, long * plMilliSec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetTDT(%p, %" HB_PFS "u, %p, %p)", pArray, nIndex, plJulian, plMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetTDT(%p, %" HB_PFS "u, %p, %p)", ( void * ) pArray, nIndex, ( void * ) plJulian, ( void * ) plMilliSec ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetTDT( pArray->item.asArray.value->pItems + nIndex - 1, plJulian, plMilliSec );
|
||||
@@ -561,7 +548,7 @@ HB_BOOL hb_arrayGetTDT( PHB_ITEM pArray, HB_SIZE nIndex, long * plJulian, long *
|
||||
|
||||
HB_BOOL hb_arrayGetL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetL(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetL(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetL( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -571,7 +558,7 @@ HB_BOOL hb_arrayGetL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
int hb_arrayGetNI( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNI(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNI(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetNI( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -581,7 +568,7 @@ int hb_arrayGetNI( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
long hb_arrayGetNL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNL(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNL(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetNL( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -591,7 +578,7 @@ long hb_arrayGetNL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_ISIZ hb_arrayGetNS( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNS(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNS(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetNS( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -602,7 +589,7 @@ HB_ISIZ hb_arrayGetNS( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
#ifndef HB_LONG_LONG_OFF
|
||||
HB_LONGLONG hb_arrayGetNLL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNLL(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNLL(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetNLL( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -613,7 +600,7 @@ HB_LONGLONG hb_arrayGetNLL( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_MAXINT hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNInt(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetNInt(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetNInt( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -623,7 +610,7 @@ HB_MAXINT hb_arrayGetNInt( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
double hb_arrayGetND( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetND(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetND(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetND( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -633,7 +620,7 @@ double hb_arrayGetND( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_SIZE hb_arrayCopyC( PHB_ITEM pArray, HB_SIZE nIndex, char * szBuffer, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCopyC(%p, %" HB_PFS "u, %s, %" HB_PFS "u)", pArray, nIndex, szBuffer, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCopyC(%p, %" HB_PFS "u, %s, %" HB_PFS "u)", ( void * ) pArray, nIndex, szBuffer, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemCopyC( pArray->item.asArray.value->pItems + nIndex - 1, szBuffer, nLen );
|
||||
@@ -643,7 +630,7 @@ HB_SIZE hb_arrayCopyC( PHB_ITEM pArray, HB_SIZE nIndex, char * szBuffer, HB_SIZE
|
||||
|
||||
char * hb_arrayGetC( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetC(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetC(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetC( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -653,7 +640,7 @@ char * hb_arrayGetC( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
const char * hb_arrayGetCPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetCPtr(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetCPtr(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetCPtr( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -663,7 +650,7 @@ const char * hb_arrayGetCPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_SIZE hb_arrayGetCLen( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetCLen(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetCLen(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetCLen( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -673,7 +660,7 @@ HB_SIZE hb_arrayGetCLen( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
void * hb_arrayGetPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetPtr(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetPtr(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetPtr( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -683,7 +670,7 @@ void * hb_arrayGetPtr( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
void * hb_arrayGetPtrGC( PHB_ITEM pArray, HB_SIZE nIndex, const HB_GC_FUNCS * pFuncs )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetPtrGC(%p, %" HB_PFS "u, %p)", pArray, nIndex, pFuncs ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetPtrGC(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( const void * ) pFuncs ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetPtrGC( pArray->item.asArray.value->pItems + nIndex - 1, pFuncs );
|
||||
@@ -693,7 +680,7 @@ void * hb_arrayGetPtrGC( PHB_ITEM pArray, HB_SIZE nIndex, const HB_GC_FUNCS * pF
|
||||
|
||||
PHB_SYMB hb_arrayGetSymbol( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetSymbol(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetSymbol(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetSymbol( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -704,7 +691,7 @@ PHB_SYMB hb_arrayGetSymbol( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_TYPE hb_arrayGetType( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetType(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetType(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemType( pArray->item.asArray.value->pItems + nIndex - 1 );
|
||||
@@ -714,7 +701,7 @@ HB_TYPE hb_arrayGetType( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
HB_BOOL hb_arraySetDS( PHB_ITEM pArray, HB_SIZE nIndex, const char * szDate )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetDS(%p, %" HB_PFS "u, %s)", pArray, nIndex, szDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetDS(%p, %" HB_PFS "u, %s)", ( void * ) pArray, nIndex, szDate ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -727,7 +714,7 @@ HB_BOOL hb_arraySetDS( PHB_ITEM pArray, HB_SIZE nIndex, const char * szDate )
|
||||
|
||||
HB_BOOL hb_arraySetDL( PHB_ITEM pArray, HB_SIZE nIndex, long lDate )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetDL(%p, %" HB_PFS "u, %ld)", pArray, nIndex, lDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetDL(%p, %" HB_PFS "u, %ld)", ( void * ) pArray, nIndex, lDate ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -740,7 +727,7 @@ HB_BOOL hb_arraySetDL( PHB_ITEM pArray, HB_SIZE nIndex, long lDate )
|
||||
|
||||
HB_BOOL hb_arraySetTD( PHB_ITEM pArray, HB_SIZE nIndex, double dTimeStamp )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetTD(%p, %" HB_PFS "u, %lf)", pArray, nIndex, dTimeStamp ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetTD(%p, %" HB_PFS "u, %lf)", ( void * ) pArray, nIndex, dTimeStamp ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -753,7 +740,7 @@ HB_BOOL hb_arraySetTD( PHB_ITEM pArray, HB_SIZE nIndex, double dTimeStamp )
|
||||
|
||||
HB_BOOL hb_arraySetTDT( PHB_ITEM pArray, HB_SIZE nIndex, long lJulian, long lMilliSec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetTDT(%p, %" HB_PFS "u, %lu, %lu)", pArray, nIndex, lJulian, lMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetTDT(%p, %" HB_PFS "u, %lu, %lu)", ( void * ) pArray, nIndex, lJulian, lMilliSec ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -766,7 +753,7 @@ HB_BOOL hb_arraySetTDT( PHB_ITEM pArray, HB_SIZE nIndex, long lJulian, long lMil
|
||||
|
||||
HB_BOOL hb_arraySetL( PHB_ITEM pArray, HB_SIZE nIndex, HB_BOOL fValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetL(%p, %" HB_PFS "u, %d)", pArray, nIndex, fValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetL(%p, %" HB_PFS "u, %d)", ( void * ) pArray, nIndex, fValue ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -779,7 +766,7 @@ HB_BOOL hb_arraySetL( PHB_ITEM pArray, HB_SIZE nIndex, HB_BOOL fValue )
|
||||
|
||||
HB_BOOL hb_arraySetNI( PHB_ITEM pArray, HB_SIZE nIndex, int iNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNI(%p, %" HB_PFS "u, %d)", pArray, nIndex, iNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNI(%p, %" HB_PFS "u, %d)", ( void * ) pArray, nIndex, iNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -792,7 +779,7 @@ HB_BOOL hb_arraySetNI( PHB_ITEM pArray, HB_SIZE nIndex, int iNumber )
|
||||
|
||||
HB_BOOL hb_arraySetNL( PHB_ITEM pArray, HB_SIZE nIndex, long lNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNL(%p, %" HB_PFS "u, %lu)", pArray, nIndex, lNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNL(%p, %" HB_PFS "u, %lu)", ( void * ) pArray, nIndex, lNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -805,7 +792,7 @@ HB_BOOL hb_arraySetNL( PHB_ITEM pArray, HB_SIZE nIndex, long lNumber )
|
||||
|
||||
HB_BOOL hb_arraySetNS( PHB_ITEM pArray, HB_SIZE nIndex, HB_ISIZ nNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNS(%p, %" HB_PFS "u, %" HB_PFS "d)", pArray, nIndex, nNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNS(%p, %" HB_PFS "u, %" HB_PFS "d)", ( void * ) pArray, nIndex, nNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -819,7 +806,7 @@ HB_BOOL hb_arraySetNS( PHB_ITEM pArray, HB_SIZE nIndex, HB_ISIZ nNumber )
|
||||
#ifndef HB_LONG_LONG_OFF
|
||||
HB_BOOL hb_arraySetNLL( PHB_ITEM pArray, HB_SIZE nIndex, HB_LONGLONG llNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNLL(%p, %" HB_PFS "u, %" PFLL "d)", pArray, nIndex, llNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNLL(%p, %" HB_PFS "u, %" PFLL "d)", ( void * ) pArray, nIndex, llNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -833,7 +820,7 @@ HB_BOOL hb_arraySetNLL( PHB_ITEM pArray, HB_SIZE nIndex, HB_LONGLONG llNumber )
|
||||
|
||||
HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE nIndex, HB_MAXINT nNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNInt(%p, %" HB_PFS "u, %" PFHL "d)", pArray, nIndex, nNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetNInt(%p, %" HB_PFS "u, %" PFHL "d)", ( void * ) pArray, nIndex, nNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -846,7 +833,7 @@ HB_BOOL hb_arraySetNInt( PHB_ITEM pArray, HB_SIZE nIndex, HB_MAXINT nNumber )
|
||||
|
||||
HB_BOOL hb_arraySetND( PHB_ITEM pArray, HB_SIZE nIndex, double dNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetND(%p, %" HB_PFS "u, %lf)", pArray, nIndex, dNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetND(%p, %" HB_PFS "u, %lf)", ( void * ) pArray, nIndex, dNumber ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -859,7 +846,7 @@ HB_BOOL hb_arraySetND( PHB_ITEM pArray, HB_SIZE nIndex, double dNumber )
|
||||
|
||||
HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetC(%p, %" HB_PFS "u, %p)", pArray, nIndex, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetC(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( const void * ) szText ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -872,7 +859,7 @@ HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText )
|
||||
|
||||
HB_BOOL hb_arraySetCL( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetC(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", pArray, nIndex, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetC(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", ( void * ) pArray, nIndex, ( const void * ) szText, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -885,7 +872,7 @@ HB_BOOL hb_arraySetCL( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText, HB_
|
||||
|
||||
HB_BOOL hb_arraySetCPtr( PHB_ITEM pArray, HB_SIZE nIndex, char * szText )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCPtr(%p, %" HB_PFS "u, %p)", pArray, nIndex, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCPtr(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) szText ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -898,7 +885,7 @@ HB_BOOL hb_arraySetCPtr( PHB_ITEM pArray, HB_SIZE nIndex, char * szText )
|
||||
|
||||
HB_BOOL hb_arraySetCLPtr( PHB_ITEM pArray, HB_SIZE nIndex, char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCLPtr(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", pArray, nIndex, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCLPtr(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", ( void * ) pArray, nIndex, ( void * ) szText, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -911,7 +898,7 @@ HB_BOOL hb_arraySetCLPtr( PHB_ITEM pArray, HB_SIZE nIndex, char * szText, HB_SIZ
|
||||
|
||||
HB_BOOL hb_arraySetCConst( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCConst(%p, %" HB_PFS "u, %p)", pArray, nIndex, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetCConst(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( const void * ) szText ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -924,7 +911,7 @@ HB_BOOL hb_arraySetCConst( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText
|
||||
|
||||
HB_BOOL hb_arraySetPtr( PHB_ITEM pArray, HB_SIZE nIndex, void * pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetPtr(%p, %" HB_PFS "u, %p)", pArray, nIndex, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetPtr(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, pValue ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -937,7 +924,7 @@ HB_BOOL hb_arraySetPtr( PHB_ITEM pArray, HB_SIZE nIndex, void * pValue )
|
||||
|
||||
HB_BOOL hb_arraySetPtrGC( PHB_ITEM pArray, HB_SIZE nIndex, void * pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetPtrGC(%p, %" HB_PFS "u, %p)", pArray, nIndex, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetPtrGC(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, pValue ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -950,7 +937,7 @@ HB_BOOL hb_arraySetPtrGC( PHB_ITEM pArray, HB_SIZE nIndex, void * pValue )
|
||||
|
||||
HB_BOOL hb_arraySetSymbol( PHB_ITEM pArray, HB_SIZE nIndex, PHB_SYMB pSymbol )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetSymbol(%p, %" HB_PFS "u, %p)", pArray, nIndex, pSymbol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetSymbol(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pSymbol ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -963,7 +950,7 @@ HB_BOOL hb_arraySetSymbol( PHB_ITEM pArray, HB_SIZE nIndex, PHB_SYMB pSymbol )
|
||||
|
||||
HB_BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayLast(%p, %p)", pArray, pResult ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayLast(%p, %p)", ( void * ) pArray, ( void * ) pResult ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -983,14 +970,13 @@ HB_BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult )
|
||||
|
||||
HB_BOOL hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SIZE * pnCount )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayFill(%p, %p, %p, %p)", pArray, pValue, pnStart, pnCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayFill(%p, %p, %p, %p)", ( void * ) pArray, ( void * ) pValue, ( void * ) pnStart, ( void * ) pnCount ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
HB_SIZE nLen = pBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnStart && *pnStart )
|
||||
nStart = *pnStart - 1;
|
||||
@@ -999,7 +985,7 @@ HB_BOOL hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SI
|
||||
|
||||
if( nStart < nLen )
|
||||
{
|
||||
nCount = nLen - nStart;
|
||||
HB_SIZE nCount = nLen - nStart;
|
||||
if( pnCount && *pnCount < nCount )
|
||||
nCount = *pnCount;
|
||||
|
||||
@@ -1028,7 +1014,6 @@ HB_SIZE hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SI
|
||||
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
HB_SIZE nLen = pBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnStart && *pnStart )
|
||||
nStart = *pnStart - 1;
|
||||
@@ -1037,7 +1022,7 @@ HB_SIZE hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SI
|
||||
|
||||
if( nStart < nLen )
|
||||
{
|
||||
nCount = nLen - nStart;
|
||||
HB_SIZE nCount = nLen - nStart;
|
||||
if( pnCount && *pnCount < nCount )
|
||||
nCount = *pnCount;
|
||||
|
||||
@@ -1199,14 +1184,13 @@ HB_SIZE hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SI
|
||||
|
||||
HB_SIZE hb_arrayRevScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB_SIZE * pnCount, HB_BOOL fExact )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayRevScan(%p, %p, %p, %p, %d)", pArray, pValue, pnStart, pnCount, ( int ) fExact ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayRevScan(%p, %p, %p, %p, %d)", ( void * ) pArray, ( void * ) pValue, ( void * ) pnStart, ( void * ) pnCount, ( int ) fExact ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
HB_SIZE nLen = pBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnStart && *pnStart )
|
||||
nStart = *pnStart - 1;
|
||||
@@ -1215,7 +1199,7 @@ HB_SIZE hb_arrayRevScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB
|
||||
|
||||
if( nStart < nLen )
|
||||
{
|
||||
nCount = nStart + 1;
|
||||
HB_SIZE nCount = nStart + 1;
|
||||
if( pnCount && *pnCount < nCount )
|
||||
nCount = *pnCount;
|
||||
|
||||
@@ -1380,14 +1364,13 @@ HB_SIZE hb_arrayRevScan( PHB_ITEM pArray, PHB_ITEM pValue, HB_SIZE * pnStart, HB
|
||||
|
||||
HB_BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, HB_SIZE * pnStart, HB_SIZE * pnCount )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayEval(%p, %p, %p, %p)", pArray, bBlock, pnStart, pnCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayEval(%p, %p, %p, %p)", ( void * ) pArray, ( void * ) bBlock, ( void * ) pnStart, ( void * ) pnCount ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && HB_IS_BLOCK( bBlock ) )
|
||||
{
|
||||
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
HB_SIZE nLen = pBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnStart && *pnStart )
|
||||
nStart = *pnStart - 1;
|
||||
@@ -1396,7 +1379,7 @@ HB_BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, HB_SIZE * pnStart, HB_SI
|
||||
|
||||
if( nStart < nLen )
|
||||
{
|
||||
nCount = nLen - nStart;
|
||||
HB_SIZE nCount = nLen - nStart;
|
||||
if( pnCount && *pnCount < nCount )
|
||||
nCount = *pnCount;
|
||||
|
||||
@@ -1430,7 +1413,7 @@ HB_BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, HB_SIZE * pnStart, HB_SI
|
||||
HB_BOOL hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, HB_SIZE * pnStart,
|
||||
HB_SIZE * pnCount, HB_SIZE * pnTarget )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCopy(%p, %p, %p, %p, %p)", pSrcArray, pDstArray, pnStart, pnCount, pnTarget ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCopy(%p, %p, %p, %p, %p)", ( void * ) pSrcArray, ( void * ) pDstArray, ( void * ) pnStart, ( void * ) pnCount, ( void * ) pnTarget ) );
|
||||
|
||||
if( HB_IS_ARRAY( pSrcArray ) && HB_IS_ARRAY( pDstArray ) )
|
||||
{
|
||||
@@ -1439,7 +1422,6 @@ HB_BOOL hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, HB_SIZE * pnStart,
|
||||
HB_SIZE nSrcLen = pSrcBaseArray->nLen;
|
||||
HB_SIZE nDstLen = pDstBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
HB_SIZE nTarget;
|
||||
|
||||
if( pnStart && ( *pnStart >= 1 ) )
|
||||
@@ -1458,6 +1440,7 @@ HB_BOOL hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, HB_SIZE * pnStart,
|
||||
if( nSrcLen > 0 )
|
||||
#endif
|
||||
{
|
||||
HB_SIZE nCount;
|
||||
#ifndef HB_COMPAT_C53 /* From CA-Cl*pper 5.3a */
|
||||
if( nStart > nSrcLen )
|
||||
nStart = nSrcLen;
|
||||
@@ -1499,7 +1482,7 @@ static void hb_arrayCloneBody( PHB_ITEM pDest, PHB_ITEM pArray, PHB_NESTED_CLONE
|
||||
PHB_ITEM pSrcItem, pDstItem;
|
||||
HB_SIZE nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCloneBody(%p, %p, %p)", pDest, pArray, pClonedList ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCloneBody(%p, %p, %p)", ( void * ) pDest, ( void * ) pArray, ( void * ) pClonedList ) );
|
||||
|
||||
nLen = pArray->item.asArray.value->nLen;
|
||||
hb_arrayNew( pDest, nLen );
|
||||
@@ -1594,7 +1577,7 @@ void hb_nestedCloneDo( PHB_ITEM pDstItem, PHB_ITEM pSrcItem, PHB_NESTED_CLONED p
|
||||
|
||||
PHB_ITEM hb_arrayCloneTo( PHB_ITEM pDest, PHB_ITEM pArray )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCloneTo(%p,%p)", pDest, pArray ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayCloneTo(%p,%p)", ( void * ) pDest, ( void * ) pArray ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
@@ -1609,7 +1592,7 @@ PHB_ITEM hb_arrayCloneTo( PHB_ITEM pDest, PHB_ITEM pArray )
|
||||
|
||||
PHB_ITEM hb_arrayClone( PHB_ITEM pArray )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayClone(%p)", pArray ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayClone(%p)", ( void * ) pArray ) );
|
||||
|
||||
return hb_arrayCloneTo( hb_itemNew( NULL ), pArray );
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ HB_FUNC( AFILL )
|
||||
HB_SIZE nStart, nCount;
|
||||
HB_ISIZ lStart = hb_parns( 3 ), lCount = hb_parns( 4 );
|
||||
|
||||
/* Explicy lCount of 0 - Nothing to do! */
|
||||
/* Explicit lCount of 0 - Nothing to do! */
|
||||
if( HB_ISNUM( 4 ) && lCount == 0 )
|
||||
return;
|
||||
/* Clipper aborts if negative start. */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ASort() function
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* Jose Lalin <dezac@corevia.com>
|
||||
* Copyright 1999-2001 Jose Lalin <dezac@corevia.com>
|
||||
*
|
||||
* 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
|
||||
@@ -45,12 +45,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* TOFIX: The sorting engine requires signed indexes to work, this means
|
||||
/* FIXME: The sorting engine requires signed indexes to work, this means
|
||||
that arrays larger than 2^31 elements cannot be sorted. [vszakats] */
|
||||
|
||||
/* NOTE: Based on PD code found in
|
||||
SORTING AND SEARCHING ALGORITHMS: A COOKBOOK, BY THOMAS NIEMANN
|
||||
http://members.xoom.com/_XMCM/thomasn/s_man.htm */
|
||||
https://www.cs.auckland.ac.nz/~jmor159/PLDS210/niemann/s_man.htm */
|
||||
|
||||
#include "hbvmint.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -91,7 +91,7 @@ static HB_BOOL hb_itemIsLess( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,
|
||||
return hb_itemStrCmp( pItem1, pItem2, HB_FALSE ) < 0;
|
||||
else if( HB_IS_NUMINT( pItem1 ) && HB_IS_NUMINT( pItem2 ) )
|
||||
/* intentionally separate comparison for integer numbers
|
||||
to avoid precision lose in 64bit integer to double conversion */
|
||||
to avoid precision lose in 64-bit integer to double conversion */
|
||||
return hb_itemGetNInt( pItem1 ) < hb_itemGetNInt( pItem2 );
|
||||
else if( HB_IS_NUMERIC( pItem1 ) && HB_IS_NUMERIC( pItem2 ) )
|
||||
return hb_itemGetND( pItem1 ) < hb_itemGetND( pItem2 );
|
||||
@@ -104,7 +104,7 @@ static HB_BOOL hb_itemIsLess( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,
|
||||
return lDate1 == lDate2 ? lTime1 < lTime2 : lDate1 < lDate2;
|
||||
}
|
||||
else if( HB_IS_DATETIME( pItem1 ) && HB_IS_DATETIME( pItem2 ) )
|
||||
/* it's not exact comparison, compare only julian date */
|
||||
/* it's not exact comparison, compare only Julian date */
|
||||
return hb_itemGetDL( pItem1 ) < hb_itemGetDL( pItem2 );
|
||||
else if( HB_IS_LOGICAL( pItem1 ) && HB_IS_LOGICAL( pItem2 ) )
|
||||
return hb_itemGetL( pItem1 ) < hb_itemGetL( pItem2 );
|
||||
@@ -181,10 +181,10 @@ static HB_ISIZ hb_arraySortQuickPartition( PHB_BASEARRAY pBaseArray, HB_ISIZ lb,
|
||||
|
||||
static void hb_arraySortQuick( PHB_BASEARRAY pBaseArray, HB_ISIZ lb, HB_ISIZ ub, PHB_ITEM pBlock )
|
||||
{
|
||||
HB_ISIZ m;
|
||||
|
||||
while( lb < ub )
|
||||
{
|
||||
HB_ISIZ m;
|
||||
|
||||
if( ( HB_SIZE ) ub >= pBaseArray->nLen )
|
||||
{
|
||||
ub = pBaseArray->nLen - 1;
|
||||
@@ -322,14 +322,13 @@ static void hb_arraySortStart( PHB_BASEARRAY pBaseArray, PHB_ITEM pBlock,
|
||||
|
||||
HB_BOOL hb_arraySort( PHB_ITEM pArray, HB_SIZE * pnStart, HB_SIZE * pnCount, PHB_ITEM pBlock )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySort(%p, %p, %p, %p)", pArray, pnStart, pnCount, pBlock ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySort(%p, %p, %p, %p)", ( void * ) pArray, ( void * ) pnStart, ( void * ) pnCount, ( void * ) pBlock ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) )
|
||||
{
|
||||
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
HB_SIZE nLen = pBaseArray->nLen;
|
||||
HB_SIZE nStart;
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnStart && *pnStart >= 1 )
|
||||
nStart = *pnStart;
|
||||
@@ -338,6 +337,8 @@ HB_BOOL hb_arraySort( PHB_ITEM pArray, HB_SIZE * pnStart, HB_SIZE * pnCount, PHB
|
||||
|
||||
if( nStart <= nLen )
|
||||
{
|
||||
HB_SIZE nCount;
|
||||
|
||||
if( pnCount && *pnCount >= 1 && ( *pnCount <= nLen - nStart ) )
|
||||
nCount = *pnCount;
|
||||
else
|
||||
|
||||
525
src/vm/classes.c
525
src/vm/classes.c
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Command line and environment argument management
|
||||
* Command-line and environment argument management
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
*
|
||||
@@ -63,7 +63,7 @@
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
/* Command line argument management */
|
||||
/* Command-line argument management */
|
||||
static int s_argc = 0;
|
||||
static char ** s_argv = NULL;
|
||||
|
||||
@@ -91,12 +91,11 @@ static HB_BOOL s_WinMainParam = HB_FALSE;
|
||||
|
||||
void hb_winmainArgVBuild( void )
|
||||
{
|
||||
LPCTSTR lpCmdLine, lpSrc;
|
||||
LPCTSTR lpCmdLine;
|
||||
LPTSTR * lpArgV;
|
||||
LPTSTR lpDst, lpArg, lpModuleName;
|
||||
HB_SIZE nSize, nModuleName;
|
||||
int iArgC;
|
||||
HB_BOOL fQuoted;
|
||||
|
||||
/* NOTE: MAX_PATH used intentionally instead of HB_MAX_PATH */
|
||||
lpModuleName = ( LPTSTR ) HB_WINARG_ALLOC( ( MAX_PATH + 1 ) * sizeof( TCHAR ) );
|
||||
@@ -112,6 +111,9 @@ void hb_winmainArgVBuild( void )
|
||||
|
||||
while( lpCmdLine && ! lpArgV && iArgC != 0 )
|
||||
{
|
||||
HB_BOOL fQuoted;
|
||||
LPCTSTR lpSrc;
|
||||
|
||||
if( nSize != 0 )
|
||||
{
|
||||
lpArgV = ( LPTSTR * ) HB_WINARG_ALLOC( iArgC * sizeof( LPTSTR ) +
|
||||
@@ -291,7 +293,7 @@ HB_BOOL hb_winmainArgGet( void * phInstance, void * phPrevInstance, int * piCmdS
|
||||
|
||||
void hb_cmdargInit( int argc, char * argv[] )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_cmdargInit(%d, %p)", argc, argv ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_cmdargInit(%d, %p)", argc, ( void * ) argv ) );
|
||||
|
||||
#if defined( HB_OS_WIN )
|
||||
if( s_lpArgV )
|
||||
@@ -459,10 +461,10 @@ int hb_cmdargPushArgs( void )
|
||||
|
||||
HB_BOOL hb_cmdargIsInternal( const char * szArg, int * piLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_cmdargIsInternal(%s, %p)", szArg, piLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_cmdargIsInternal(%s, %p)", szArg, ( void * ) piLen ) );
|
||||
|
||||
/* NOTE: Not checking for '--' here, as it would filter out
|
||||
valid command line options used by applications. [vszakats] */
|
||||
valid command-line options used by applications. [vszakats] */
|
||||
|
||||
if( hb_strnicmp( szArg, "--hb:", 5 ) == 0 ||
|
||||
hb_strnicmp( szArg, "//hb:", 5 ) == 0 )
|
||||
@@ -494,7 +496,7 @@ static char * hb_cmdargGet( const char * pszName, HB_BOOL bRetValue )
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_cmdargGet(%s, %d)", pszName, ( int ) bRetValue ) );
|
||||
|
||||
/* Check the command line first */
|
||||
/* Check the command-line first */
|
||||
|
||||
for( i = 1; i < s_argc; i++ )
|
||||
{
|
||||
@@ -683,7 +685,7 @@ HB_FUNC( HB_ARGSTRING )
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* Returns the number of command line arguments passed to the application, this
|
||||
/* Returns the number of command-line arguments passed to the application, this
|
||||
also includes the internal arguments. */
|
||||
|
||||
HB_FUNC( HB_ARGC )
|
||||
@@ -691,9 +693,9 @@ HB_FUNC( HB_ARGC )
|
||||
hb_retni( s_argc - 1 );
|
||||
}
|
||||
|
||||
/* Returns a command line argument passed to the application. Calling it with
|
||||
/* Returns a command-line argument passed to the application. Calling it with
|
||||
the parameter zero or no parameter, it will return the name of the executable,
|
||||
as written in the command line. */
|
||||
as written in the command-line. */
|
||||
|
||||
HB_FUNC( HB_ARGV )
|
||||
{
|
||||
@@ -815,7 +817,7 @@ HB_FUNC( HB_CMDLINE )
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* Check for command line internal arguments */
|
||||
/* Check for command-line internal arguments */
|
||||
void hb_cmdargProcess( void )
|
||||
{
|
||||
int iHandles;
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* The Harbour implementation of codeblocks */
|
||||
|
||||
#include "hbvmopt.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -56,20 +54,17 @@
|
||||
|
||||
/* Dummy returning NIL for buggy code which may store references
|
||||
to freed by GC codeblock in .prg destructors and then (after
|
||||
catching RT EG_DESTRUCTOR error) try to execute them
|
||||
*/
|
||||
catching RT EG_DESTRUCTOR error) try to execute them */
|
||||
static const HB_BYTE s_pCode[ 2 ] = { HB_P_PUSHNIL, HB_P_ENDBLOCK };
|
||||
|
||||
/* Release all allocated memory when called from the garbage collector
|
||||
*/
|
||||
/* Release all allocated memory when called from the garbage collector */
|
||||
static HB_GARBAGE_FUNC( hb_codeblockGarbageDelete )
|
||||
{
|
||||
PHB_CODEBLOCK pCBlock = ( PHB_CODEBLOCK ) Cargo;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockGarbageDelete(%p)", Cargo ) );
|
||||
|
||||
/* free space allocated for pcodes - if it was a macro-compiled codeblock
|
||||
*/
|
||||
/* free space allocated for pcodes - if it was a macro-compiled codeblock */
|
||||
if( pCBlock->pCode && pCBlock->dynBuffer )
|
||||
{
|
||||
pCBlock->dynBuffer = HB_FALSE;
|
||||
@@ -77,8 +72,7 @@ static HB_GARBAGE_FUNC( hb_codeblockGarbageDelete )
|
||||
}
|
||||
pCBlock->pCode = s_pCode;
|
||||
|
||||
/* free space allocated for local variables
|
||||
*/
|
||||
/* free space allocated for local variables */
|
||||
if( pCBlock->pLocals )
|
||||
{
|
||||
if( hb_xRefDec( pCBlock->pLocals ) )
|
||||
@@ -125,7 +119,6 @@ static const HB_GC_FUNCS s_gcCodeblockFuncs =
|
||||
* pSymbols -> a pointer to the module symbol table
|
||||
*
|
||||
* Note: pLocalPosTable cannot be used if uiLocals is ZERO
|
||||
*
|
||||
*/
|
||||
PHB_CODEBLOCK hb_codeblockNew( const HB_BYTE * pBuffer,
|
||||
HB_USHORT uiLocals,
|
||||
@@ -138,18 +131,16 @@ PHB_CODEBLOCK hb_codeblockNew( const HB_BYTE * pBuffer,
|
||||
PHB_ITEM pLocals, pBase;
|
||||
const HB_BYTE * pCode;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockNew(%p, %hu, %p, %p, %" HB_PFS "u)", pBuffer, uiLocals, pLocalPosTable, pSymbols, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockNew(%p, %hu, %p, %p, %" HB_PFS "u)", ( const void * ) pBuffer, uiLocals, ( const void * ) pLocalPosTable, ( void * ) pSymbols, nLen ) );
|
||||
|
||||
/*
|
||||
* allocate memory for code block body and detach items hb_gcAllocRaw()
|
||||
/* Allocate memory for code block body and detach items hb_gcAllocRaw()
|
||||
* to be safe for automatic GC activation in hb_xgrab() without
|
||||
* calling hb_gcLock()/hb_gcUnlock(). [druzus]
|
||||
*/
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
/*
|
||||
* The codeblock pcode is stored in dynamically allocated memory that
|
||||
/* The codeblock pcode is stored in dynamically allocated memory that
|
||||
* can be deallocated after creation of a codeblock. We have to duplicate
|
||||
* the passed buffer
|
||||
*/
|
||||
@@ -157,8 +148,7 @@ PHB_CODEBLOCK hb_codeblockNew( const HB_BYTE * pBuffer,
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The codeblock pcode is stored in static segment.
|
||||
/* The codeblock pcode is stored in static segment.
|
||||
* The only allowed operation on a codeblock is evaluating it then
|
||||
* there is no need to duplicate its pcode - just store the pointer to it
|
||||
*/
|
||||
@@ -235,7 +225,7 @@ PHB_CODEBLOCK hb_codeblockNew( const HB_BYTE * pBuffer,
|
||||
pCBlock->uiLocals = uiLocals;
|
||||
pCBlock->pLocals = pLocals;
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "codeblock created %p", pCBlock ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "codeblock created %p", ( void * ) pCBlock ) );
|
||||
|
||||
return pCBlock;
|
||||
}
|
||||
@@ -247,15 +237,13 @@ PHB_CODEBLOCK hb_codeblockMacroNew( const HB_BYTE * pBuffer, HB_SIZE nLen )
|
||||
PHB_ITEM pBase;
|
||||
HB_BYTE * pCode;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockMacroNew(%p, %" HB_PFS "u)", pBuffer, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockMacroNew(%p, %" HB_PFS "u)", ( const void * ) pBuffer, nLen ) );
|
||||
|
||||
/*
|
||||
* The codeblock pcode is stored in dynamically allocated memory that
|
||||
/* The codeblock pcode is stored in dynamically allocated memory that
|
||||
* can be deallocated after creation of a codeblock. We have to duplicate
|
||||
* the passed buffer
|
||||
*/
|
||||
/*
|
||||
* allocate memory for code block body and detach items hb_gcAllocRaw()
|
||||
/* allocate memory for code block body and detach items hb_gcAllocRaw()
|
||||
* to be safe for automatic GC activation in hb_xgrab() without
|
||||
* calling hb_gcLock()/hb_gcUnlock(). [druzus]
|
||||
*/
|
||||
@@ -268,39 +256,36 @@ PHB_CODEBLOCK hb_codeblockMacroNew( const HB_BYTE * pBuffer, HB_SIZE nLen )
|
||||
pCBlock->dynBuffer = HB_TRUE;
|
||||
pCBlock->pDefSymb = pBase->item.asSymbol.stackstate->uiClass ?
|
||||
hb_clsMethodSym( pBase ) : pBase->item.asSymbol.value;
|
||||
pCBlock->pSymbols = NULL; /* macro-compiled codeblock cannot acces a local symbol table */
|
||||
pCBlock->pSymbols = NULL; /* macro-compiled codeblock cannot access a local symbol table */
|
||||
pCBlock->pStatics = hb_stackGetStaticsBase();
|
||||
pCBlock->uiLocals = 0;
|
||||
pCBlock->pLocals = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "codeblock created %p", pCBlock ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "codeblock created %p", ( void * ) pCBlock ) );
|
||||
|
||||
return pCBlock;
|
||||
}
|
||||
|
||||
/* Get local variable referenced in a codeblock
|
||||
*/
|
||||
/* Get local variable referenced in a codeblock */
|
||||
PHB_ITEM hb_codeblockGetVar( PHB_ITEM pItem, int iItemPos )
|
||||
{
|
||||
PHB_CODEBLOCK pCBlock = pItem->item.asBlock.value;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockGetVar(%p, %d)", pItem, iItemPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockGetVar(%p, %d)", ( void * ) pItem, iItemPos ) );
|
||||
|
||||
/* local variables accessed in a codeblock are always stored as reference */
|
||||
return hb_itemUnRef( pCBlock->pLocals - iItemPos );
|
||||
}
|
||||
|
||||
/* Get local variable passed by reference
|
||||
*/
|
||||
/* Get local variable passed by reference */
|
||||
PHB_ITEM hb_codeblockGetRef( PHB_CODEBLOCK pCBlock, int iItemPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockGetRef(%p, %d)", pCBlock, iItemPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_codeblockGetRef(%p, %d)", ( void * ) pCBlock, iItemPos ) );
|
||||
|
||||
return pCBlock->pLocals - iItemPos;
|
||||
}
|
||||
|
||||
/* retrieves the codeblock unique ID
|
||||
*/
|
||||
/* retrieves the codeblock unique ID */
|
||||
void * hb_codeblockId( PHB_ITEM pItem )
|
||||
{
|
||||
if( HB_IS_BLOCK( pItem ) )
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
#include "hbapierr.h"
|
||||
#include "hbstack.h"
|
||||
|
||||
|
||||
/* Existing debug functions
|
||||
* from debug.c:
|
||||
* __dbgVMStkGCount()
|
||||
@@ -99,13 +98,12 @@
|
||||
* HB_DBG_VMQUIT
|
||||
*/
|
||||
|
||||
/*
|
||||
/* AddToArray( <pItem>, <pReturn>, <uiPos> )
|
||||
* Add <pItem> to array <pReturn> at pos <uiPos>
|
||||
* AddToArray( <pItem>, <pReturn>, <uiPos> )
|
||||
*/
|
||||
static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, HB_SIZE nPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "AddToArray(%p, %p, %" HB_PFS "u)", pItem, pReturn, nPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "AddToArray(%p, %p, %" HB_PFS "u)", ( void * ) pItem, ( void * ) pReturn, nPos ) );
|
||||
|
||||
if( HB_IS_SYMBOL( pItem ) ) /* Symbol is pushed as text */
|
||||
{
|
||||
@@ -124,9 +122,8 @@ static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, HB_SIZE nPos )
|
||||
hb_itemArrayPut( pReturn, nPos, pItem );
|
||||
}
|
||||
|
||||
/*
|
||||
/* __dbgVMStkGCount() --> <nVars>
|
||||
* Returns the length of the global stack
|
||||
* __dbgVMStkGCount() --> <nVars>
|
||||
*/
|
||||
HB_FUNC( __DBGVMSTKGCOUNT )
|
||||
{
|
||||
@@ -136,9 +133,8 @@ HB_FUNC( __DBGVMSTKGCOUNT )
|
||||
hb_retns( 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
/* __dbgVMStkGList() --> <aStack>
|
||||
* Returns the global stack
|
||||
* __dbgVMStkGList() --> <aStack>
|
||||
*/
|
||||
HB_FUNC( __DBGVMSTKGLIST )
|
||||
{
|
||||
@@ -159,9 +155,8 @@ HB_FUNC( __DBGVMSTKGLIST )
|
||||
hb_reta( 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
/* hb_stackLen( <nProcLevel> ) --> <nVars>
|
||||
* Returns params plus locals amount of the nProcLevel function
|
||||
* hb_stackLen( <nProcLevel> ) --> <nVars>
|
||||
*/
|
||||
static HB_ISIZ hb_stackLen( int iLevel )
|
||||
{
|
||||
@@ -184,9 +179,8 @@ static HB_ISIZ hb_stackLen( int iLevel )
|
||||
return nLen;
|
||||
}
|
||||
|
||||
/*
|
||||
/* __dbgVMStkLCount( <nProcLevel> ) --> <nVars>
|
||||
* Returns params plus locals amount of the nProcLevel function
|
||||
* __dbgVMStkLCount( <nProcLevel> ) --> <nVars>
|
||||
*/
|
||||
HB_FUNC( __DBGVMSTKLCOUNT )
|
||||
{
|
||||
@@ -196,8 +190,7 @@ HB_FUNC( __DBGVMSTKLCOUNT )
|
||||
hb_retns( 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* __dbgVMStkLList() --> <aStack>
|
||||
/* __dbgVMStkLList() --> <aStack>
|
||||
* Returns the stack of the calling function
|
||||
* "[<symbol>]" Means symbol.
|
||||
*
|
||||
@@ -332,7 +325,6 @@ HB_FUNC( __DBGVMVARLSET )
|
||||
int iLevel = hb_parni( 1 ) + 1;
|
||||
int iLocal = hb_parni( 2 );
|
||||
HB_ISIZ nBaseOffset;
|
||||
PHB_ITEM pLocal;
|
||||
|
||||
nBaseOffset = hb_stackBaseOffset();
|
||||
while( iLevel-- > 0 && nBaseOffset > 1 )
|
||||
@@ -340,6 +332,8 @@ HB_FUNC( __DBGVMVARLSET )
|
||||
|
||||
if( iLevel < 0 )
|
||||
{
|
||||
PHB_ITEM pLocal;
|
||||
|
||||
if( iLocal > SHRT_MAX )
|
||||
{
|
||||
iLocal -= USHRT_MAX;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
This is a version (aka dlmalloc) of malloc/free/realloc written by
|
||||
Doug Lea and released to the public domain, as explained at
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ Send questions,
|
||||
https://creativecommons.org/publicdomain/zero/1.0/ Send questions,
|
||||
comments, complaints, performance data, etc to dl@cs.oswego.edu
|
||||
|
||||
* Version 2.8.6 Wed Aug 29 06:57:58 2012 Doug Lea
|
||||
Note: There may be an updated version of this malloc obtainable at
|
||||
ftp://gee.cs.oswego.edu/pub/misc/malloc.c
|
||||
http://gee.cs.oswego.edu/pub/misc/malloc.c
|
||||
Check before installing!
|
||||
|
||||
* Quickstart
|
||||
@@ -18,7 +18,7 @@
|
||||
compile-time and dynamic tuning options.
|
||||
|
||||
For convenience, an include file for code using this malloc is at:
|
||||
ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.h
|
||||
http://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.h
|
||||
You don't really need this .h file unless you call functions not
|
||||
defined in your system include files. The .h file contains only the
|
||||
excerpts from this file needed for using this malloc on ANSI C/C++
|
||||
@@ -3082,7 +3082,7 @@ static size_t traverse_and_check(mstate m);
|
||||
that the mstate controlling malloc/free is intact. This is a
|
||||
streamlined version of the approach described by William Robertson
|
||||
et al in "Run-time Detection of Heap-based Overflows" LISA'03
|
||||
http://www.usenix.org/events/lisa03/tech/robertson.html The footer
|
||||
https://www.usenix.org/events/lisa03/tech/robertson.html The footer
|
||||
of an inuse chunk holds the xor of its mstate and a random seed,
|
||||
that is checked upon calls to free() and realloc(). This is
|
||||
(probabalistically) unguessable from outside the program, but can be
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -70,7 +65,7 @@
|
||||
# include <os2.h>
|
||||
#elif defined( HB_OS_DOS ) && defined( __WATCOMC__ ) && !defined( HB_CAUSEWAY_DLL )
|
||||
/* it's broken in recent OpenWatcom builds so enable it
|
||||
for tests only in harbur.dll [druzus] */
|
||||
for tests only in harbour.dll [druzus] */
|
||||
# if defined( HB_DYNLIB )
|
||||
# define HB_CAUSEWAY_DLL
|
||||
# include <cwdllfnc.h>
|
||||
@@ -273,7 +268,7 @@ HB_FUNC( HB_LIBERROR )
|
||||
}
|
||||
|
||||
/* Get FUNCTION or PROCEDURE symbol from given library.
|
||||
* hb_libGetFunSym( <pLibHandle>, <cFuncName> ) -> <sFuncSym> | NIL
|
||||
* hb_libGetFunSym( <pLibHandle>, <cFuncName> ) --> <sFuncSym> | NIL
|
||||
*/
|
||||
HB_FUNC( HB_LIBGETFUNSYM )
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ static PHB_DYNS hb_dynsymInsert( PHB_SYMB pSymbol, HB_UINT uiPos )
|
||||
{
|
||||
PHB_DYNS pDynSym;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymInsert(%p,%u)", pSymbol, uiPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymInsert(%p, %u)", ( void * ) pSymbol, uiPos ) );
|
||||
|
||||
if( ++s_uiDynSymbols == 0 )
|
||||
{
|
||||
@@ -134,7 +134,7 @@ static PHB_DYNS hb_dynsymPos( const char * szName, HB_UINT * puiPos )
|
||||
{
|
||||
HB_UINT uiFirst, uiLast, uiMiddle;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymPos(%s,%p)", szName, puiPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymPos(%s, %p)", szName, ( void * ) puiPos ) );
|
||||
|
||||
uiFirst = 0;
|
||||
uiLast = s_uiDynSymbols;
|
||||
@@ -240,7 +240,7 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol )
|
||||
PHB_DYNS pDynSym;
|
||||
HB_UINT uiPos;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymNew(%p)", pSymbol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymNew(%p)", ( void * ) pSymbol ) );
|
||||
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
@@ -305,10 +305,10 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol )
|
||||
* decide what to do with them. We can leave it as is or we can
|
||||
* try to overload one symbol so both will point to the same
|
||||
* function. For .prg code such overloading will work but not
|
||||
* for C code which makes sth like: HB_FUNC_EXEC( funcname );
|
||||
* for C code which makes something like: HB_FUNC_EXEC( funcname );
|
||||
* In such case we cannot do anything - we cannot even detect
|
||||
* such situation. In some cases even linker cannot detect it
|
||||
* because C compiler can make autoinlining or some bindings
|
||||
* because C compiler can make auto-inlining or some bindings
|
||||
* which are not visible for linker
|
||||
*/
|
||||
/* Let's try to overload one of the functions. Simple:
|
||||
@@ -450,56 +450,56 @@ PHB_SYMB hb_dynsymFindSymbol( const char * szName )
|
||||
|
||||
PHB_SYMB hb_dynsymSymbol( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSymbol(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSymbol(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return pDynSym->pSymbol;
|
||||
}
|
||||
|
||||
const char * hb_dynsymName( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymName(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymName(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return pDynSym->pSymbol->szName;
|
||||
}
|
||||
|
||||
HB_BOOL hb_dynsymIsFunction( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymIsFunction(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymIsFunction(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return pDynSym->pSymbol->value.pFunPtr != NULL;
|
||||
}
|
||||
|
||||
HB_BOOL hb_dynsymIsMemvar( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymIsMemvar(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymIsMemvar(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return hb_dynsymHandles( pDynSym )->pMemvar != NULL;
|
||||
}
|
||||
|
||||
PHB_ITEM hb_dynsymGetMemvar( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymGetMemvar(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymGetMemvar(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return ( PHB_ITEM ) hb_dynsymHandles( pDynSym )->pMemvar;
|
||||
}
|
||||
|
||||
void hb_dynsymSetMemvar( PHB_DYNS pDynSym, PHB_ITEM pMemvar )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSetMemvar(%p,%p)", pDynSym, pMemvar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSetMemvar(%p, %p)", ( void * ) pDynSym, ( void * ) pMemvar ) );
|
||||
|
||||
hb_dynsymHandles( pDynSym )->pMemvar = ( void * ) pMemvar;
|
||||
}
|
||||
|
||||
int hb_dynsymAreaHandle( PHB_DYNS pDynSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymAreaHandle(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymAreaHandle(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
return hb_dynsymHandles( pDynSym )->uiArea;
|
||||
}
|
||||
|
||||
void hb_dynsymSetAreaHandle( PHB_DYNS pDynSym, int iArea )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSetAreaHandle(%p,%d)", pDynSym, iArea ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymSetAreaHandle(%p, %d)", ( void * ) pDynSym, iArea ) );
|
||||
|
||||
hb_dynsymHandles( pDynSym )->uiArea = ( HB_USHORT ) iArea;
|
||||
}
|
||||
@@ -529,7 +529,7 @@ int hb_dynsymToNum( PHB_DYNS pDynSym )
|
||||
{
|
||||
int iSymNum;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymToNum(%p)", pDynSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymToNum(%p)", ( void * ) pDynSym ) );
|
||||
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
@@ -573,7 +573,7 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
PHB_DYNS pDynSym = NULL;
|
||||
HB_USHORT uiPos = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymEval(%p, %p)", pFunction, Cargo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymEval(%p, %p)", ( void * ) pFunction, Cargo ) );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
@@ -607,7 +607,7 @@ void hb_dynsymProtectEval( PHB_DYNS_FUNC pFunction, void * Cargo )
|
||||
{
|
||||
HB_USHORT uiPos = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymProtectEval(%p, %p)", pFunction, Cargo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dynsymProtectEval(%p, %p)", ( void * ) pFunction, Cargo ) );
|
||||
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
@@ -671,13 +671,12 @@ HB_FUNC( __DYNSGETNAME ) /* Get name of symbol: cSymbol = __dynsymGetName( dsInd
|
||||
HB_FUNC( __DYNSGETINDEX ) /* Gimme index number of symbol: dsIndex = __dynsymGetIndex( cSymbol ) */
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
PHB_DYNS pDynSym;
|
||||
HB_UINT uiPos = 0;
|
||||
const char * szName = hb_parc( 1 );
|
||||
|
||||
if( szName )
|
||||
{
|
||||
pDynSym = hb_dynsymFindName( szName );
|
||||
PHB_DYNS pDynSym = hb_dynsymFindName( szName );
|
||||
if( pDynSym )
|
||||
{
|
||||
HB_DYNSYM_LOCK();
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#include "hbapirdd.h"
|
||||
#include "hbdate.h"
|
||||
|
||||
/* ------------------------------- */
|
||||
/* --- */
|
||||
|
||||
#if ! defined( STACK_INITHB_ITEMS )
|
||||
#define STACK_INITHB_ITEMS 200
|
||||
@@ -69,7 +69,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------------------------- */
|
||||
/* --- */
|
||||
|
||||
#if defined( HB_MT_VM )
|
||||
|
||||
@@ -144,23 +144,23 @@
|
||||
|
||||
#endif /* HB_MT_VM */
|
||||
|
||||
/* ------------------------------- */
|
||||
/* --- */
|
||||
|
||||
static char s_szDirBuffer[ HB_PATH_MAX ];
|
||||
static HB_IOERRORS s_IOErrors;
|
||||
static HB_TRACEINFO s_traceInfo;
|
||||
|
||||
/* ------------------------------- */
|
||||
/* --- */
|
||||
|
||||
static HB_SYMB s_initSymbol = { "hb_stackInit", { HB_FS_STATIC }, { NULL }, NULL };
|
||||
|
||||
/* ------------------------------- */
|
||||
/* --- */
|
||||
|
||||
static void hb_stack_init( PHB_STACK pStack )
|
||||
{
|
||||
HB_ISIZ n;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_init(%p)", pStack ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_init(%p)", ( void * ) pStack ) );
|
||||
|
||||
memset( pStack, 0, sizeof( HB_STACK ) );
|
||||
|
||||
@@ -186,7 +186,7 @@ static void hb_stack_init( PHB_STACK pStack )
|
||||
|
||||
static void hb_stack_destroy_TSD( PHB_STACK pStack )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_destroy_TSD(%p)", pStack ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_destroy_TSD(%p)", ( void * ) pStack ) );
|
||||
|
||||
while( pStack->iTSD )
|
||||
{
|
||||
@@ -212,7 +212,7 @@ static void hb_stack_free( PHB_STACK pStack )
|
||||
{
|
||||
HB_ISIZ n;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_free(%p)", pStack ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stack_free(%p)", ( void * ) pStack ) );
|
||||
|
||||
hb_stack_destroy_TSD( pStack );
|
||||
|
||||
@@ -257,7 +257,7 @@ void * hb_stackGetTSD( PHB_TSD pTSD )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackGetTSD(%p)", pTSD ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackGetTSD(%p)", ( void * ) pTSD ) );
|
||||
|
||||
#if defined( HB_MT_VM )
|
||||
if( pTSD->iHandle == 0 || pTSD->iHandle > hb_stack.iTSD ||
|
||||
@@ -308,7 +308,7 @@ void * hb_stackTestTSD( PHB_TSD pTSD )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackTestTSD(%p)", pTSD ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackTestTSD(%p)", ( void * ) pTSD ) );
|
||||
|
||||
#if defined( HB_MT_VM )
|
||||
return ( pTSD->iHandle && pTSD->iHandle <= hb_stack.iTSD ) ?
|
||||
@@ -322,7 +322,7 @@ void hb_stackReleaseTSD( PHB_TSD pTSD )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackReleaseTSD(%p)", pTSD ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackReleaseTSD(%p)", ( void * ) pTSD ) );
|
||||
|
||||
if( pTSD->iHandle && pTSD->iHandle <= hb_stack.iTSD &&
|
||||
hb_stack.pTSD[ pTSD->iHandle ].value )
|
||||
@@ -335,7 +335,7 @@ void hb_stackReleaseTSD( PHB_TSD pTSD )
|
||||
pTSD->iHandle = 0;
|
||||
/* TODO: add recovery system to not lose TSD handles and
|
||||
* make this functionality more general and public
|
||||
* for 3-rd party developers
|
||||
* for 3rd party developers
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ void hb_stackIsStackRef( void * pStackId, PHB_TSD_FUNC pCleanFunc )
|
||||
|
||||
void hb_stackUpdateAllocator( void * pStackId, PHB_ALLOCUPDT_FUNC pFunc, int iCount )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackUpdateAllocator(%p, %p, %d)", pStackId, pFunc, iCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_stackUpdateAllocator(%p, %p, %d)", pStackId, ( void * ) pFunc, iCount ) );
|
||||
|
||||
#if defined( HB_MT_VM )
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* The Eval API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (hb_itemDo()/hb_itemDoC() (based on HB_DO() by Ryszard Glab))
|
||||
*
|
||||
* 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
|
||||
@@ -44,17 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_itemDo() ( based on HB_DO() by Ryszard Glab )
|
||||
* hb_itemDoC() ( based on HB_DO() by Ryszard Glab )
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmint.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbstack.h"
|
||||
@@ -64,7 +54,7 @@
|
||||
|
||||
HB_BOOL hb_evalNew( PHB_EVALINFO pEvalInfo, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalNew(%p, %p)", pEvalInfo, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalNew(%p, %p)", ( void * ) pEvalInfo, ( void * ) pItem ) );
|
||||
|
||||
if( pEvalInfo )
|
||||
{
|
||||
@@ -93,7 +83,7 @@ HB_BOOL hb_evalNew( PHB_EVALINFO pEvalInfo, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_evalPutParam( PHB_EVALINFO pEvalInfo, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalPutParam(%p, %p)", pEvalInfo, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalPutParam(%p, %p)", ( void * ) pEvalInfo, ( void * ) pItem ) );
|
||||
|
||||
if( pEvalInfo && pItem && pEvalInfo->paramCount < HB_EVAL_PARAM_MAX_ )
|
||||
{
|
||||
@@ -109,13 +99,12 @@ PHB_ITEM hb_evalLaunch( PHB_EVALINFO pEvalInfo )
|
||||
{
|
||||
PHB_ITEM pResult = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalLaunch(%p)", pEvalInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalLaunch(%p)", ( void * ) pEvalInfo ) );
|
||||
|
||||
if( pEvalInfo )
|
||||
{
|
||||
PHB_ITEM pItem = pEvalInfo->pItems[ 0 ];
|
||||
PHB_SYMB pSymbol = NULL;
|
||||
HB_USHORT uiParam = 0;
|
||||
|
||||
if( HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -139,6 +128,8 @@ PHB_ITEM hb_evalLaunch( PHB_EVALINFO pEvalInfo )
|
||||
|
||||
if( pSymbol )
|
||||
{
|
||||
HB_USHORT uiParam = 0;
|
||||
|
||||
hb_vmPushSymbol( pSymbol );
|
||||
if( pItem )
|
||||
hb_vmPush( pItem );
|
||||
@@ -163,7 +154,7 @@ PHB_ITEM hb_evalLaunch( PHB_EVALINFO pEvalInfo )
|
||||
|
||||
HB_BOOL hb_evalRelease( PHB_EVALINFO pEvalInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalRelease(%p)", pEvalInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_evalRelease(%p)", ( void * ) pEvalInfo ) );
|
||||
|
||||
if( pEvalInfo )
|
||||
{
|
||||
@@ -197,7 +188,7 @@ PHB_ITEM hb_itemDo( PHB_ITEM pItem, HB_ULONG ulPCount, ... )
|
||||
{
|
||||
PHB_ITEM pResult = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemDo(%p, %lu, ...)", pItem, ulPCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemDo(%p, %lu, ...)", ( void * ) pItem, ulPCount ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -343,13 +334,15 @@ void hb_evalBlock( PHB_ITEM pCodeBlock, ... )
|
||||
|
||||
HB_FUNC( HB_FORNEXT ) /* nStart, nEnd | bEnd, bCode, nStep */
|
||||
{
|
||||
HB_MAXINT nStart = hb_parnint( 1 ), nEnd;
|
||||
PHB_ITEM pEndBlock = hb_param( 2, HB_IT_BLOCK );
|
||||
PHB_ITEM pCodeBlock = hb_param( 3, HB_IT_BLOCK );
|
||||
HB_MAXINT nStep = ( hb_pcount() > 3 ) ? hb_parnint( 4 ) : 1;
|
||||
|
||||
if( pCodeBlock )
|
||||
{
|
||||
HB_MAXINT nStart = hb_parnint( 1 ), nEnd;
|
||||
HB_MAXINT nStep = ( hb_pcount() > 3 ) ? hb_parnint( 4 ) : 1;
|
||||
|
||||
PHB_ITEM pEndBlock = hb_param( 2, HB_IT_BLOCK );
|
||||
|
||||
if( pEndBlock )
|
||||
{
|
||||
hb_evalBlock0( pEndBlock );
|
||||
@@ -504,11 +497,9 @@ HB_FUNC( HB_EXECFROMARRAY )
|
||||
|
||||
HB_BOOL hb_execFromArray( PHB_ITEM pParam )
|
||||
{
|
||||
PHB_SYMB pExecSym = NULL;
|
||||
PHB_ITEM pArray = NULL;
|
||||
PHB_ITEM pSelf = NULL;
|
||||
HB_ULONG ulParamOffset = 0;
|
||||
int iPCount = 0;
|
||||
|
||||
if( pParam && HB_IS_ARRAY( pParam ) && ! HB_IS_OBJECT( pParam ) )
|
||||
{
|
||||
@@ -526,6 +517,8 @@ HB_BOOL hb_execFromArray( PHB_ITEM pParam )
|
||||
|
||||
if( pParam )
|
||||
{
|
||||
PHB_SYMB pExecSym = NULL;
|
||||
|
||||
if( HB_IS_SYMBOL( pParam ) )
|
||||
pExecSym = hb_itemGetSymbol( pParam );
|
||||
else if( HB_IS_STRING( pParam ) )
|
||||
@@ -538,6 +531,8 @@ HB_BOOL hb_execFromArray( PHB_ITEM pParam )
|
||||
|
||||
if( pExecSym )
|
||||
{
|
||||
int iPCount = 0;
|
||||
|
||||
hb_vmPushSymbol( pExecSym );
|
||||
if( pSelf )
|
||||
hb_vmPush( pSelf );
|
||||
@@ -569,7 +564,7 @@ HB_BOOL hb_execFromArray( PHB_ITEM pParam )
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
/* hb_ExecMsg( <sFuncSym>, <object>, [<params,...>] ) -> <xResult>
|
||||
/* hb_ExecMsg( <sFuncSym>, <object>, [<params,...>] ) --> <xResult>
|
||||
* Execute <sFuncSym> with <object> set as QSELF() value
|
||||
*/
|
||||
HB_FUNC( HB_EXECMSG )
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* The Extend API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2009 Viktor Szakats (vszakats.net/harbour) (hb_stor(), hb_retn*len(), hb_retdl(), hb_parn*def())
|
||||
* Copyright 2000 Jose Lalin <dezac@corevia.com> (hb_retd())
|
||||
*
|
||||
* 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
|
||||
@@ -44,26 +46,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2009 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_stor()
|
||||
* hb_retnlen()
|
||||
* hb_retnilen()
|
||||
* hb_retnllen()
|
||||
* hb_retndlen()
|
||||
* hb_retdl()
|
||||
* hb_parnidef() (based on idea by Mindaugas Kavaliauskas)
|
||||
* hb_parnldef()
|
||||
*
|
||||
* Copyright 2000 Jose Lalin <dezac@corevia.com>
|
||||
* hb_retd()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmopt.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -341,7 +323,7 @@ char * hb_pardsbuff( char * szDate, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_pardsbuff(%p, %d)", szDate, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_pardsbuff(%p, %d)", ( void * ) szDate, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -404,7 +386,7 @@ HB_BOOL hb_partdt( long * plJulian, long * plMilliSec, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_partdt(%p,%p,%d)", plJulian, plMilliSec, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_partdt(%p,%p,%d)", ( void * ) plJulian, ( void * ) plMilliSec, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -731,7 +713,7 @@ void * hb_parptrGC( const HB_GC_FUNCS * pFuncs, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parptrGC(%p,%d)", pFuncs, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parptrGC(%p,%d)", ( const void * ) pFuncs, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -925,7 +907,7 @@ char * hb_parvdsbuff( char * szDate, int iParam, ... )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvdsbuff(%p, %d, ...)", szDate, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvdsbuff(%p, %d, ...)", ( void * ) szDate, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -1021,7 +1003,7 @@ HB_BOOL hb_parvtdt( long * plJulian, long * plMilliSec, int iParam, ... )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvtdt(%p,%p,%d, ...)", plJulian, plMilliSec, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvtdt(%p,%p,%d, ...)", ( void * ) plJulian, ( void * ) plMilliSec, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -1340,7 +1322,7 @@ void * hb_parvptrGC( const HB_GC_FUNCS * pFuncs, int iParam, ... )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvptrGC(%p,%d, ...)", pFuncs, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parvptrGC(%p,%d, ...)", ( const void * ) pFuncs, iParam ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* Exception handlers
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2008 Mindaugas Kavaliauskas (dbtopas at dbtopas.lt) (hb_winExceptionHandler() Windows exception info dump code.)
|
||||
* Copyright 2008-2010 Viktor Szakats (vszakats.net/harbour) (hb_winExceptionHandler() Module listing code, x86_64/WinCE/ARM support, OS/2, MIPS32, MIPS64, SH, IA64 CPU dumps.)
|
||||
*
|
||||
* 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
|
||||
@@ -44,23 +46,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 2008 Mindaugas Kavaliauskas (dbtopas at dbtopas.lt)
|
||||
* hb_winExceptionHandler() Windows exception info dump code.
|
||||
*
|
||||
* Copyright 2008-2010 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_winExceptionHandler() Module listing code.
|
||||
* hb_winExceptionHandler() x64 support.
|
||||
* hb_winExceptionHandler() WinCE/ARM support.
|
||||
* hb_winExceptionHandler() OS/2 CPU dump.
|
||||
* hb_winExceptionHandler() MIPS32, MIPS64, SH, IA64 CPU dumps.
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
#include "hbapifs.h"
|
||||
@@ -164,7 +149,7 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti
|
||||
|
||||
/* TODO: 64-bit stack trace.
|
||||
See: - StackWalk64()
|
||||
- http://www.codeproject.com/KB/threads/StackWalker.aspx?fid=202364 */
|
||||
- https://www.codeproject.com/KB/threads/StackWalker.aspx?fid=202364 */
|
||||
}
|
||||
#elif defined( HB_OS_WIN_64 ) && defined( HB_CPU_IA_64 )
|
||||
{
|
||||
@@ -363,7 +348,7 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti
|
||||
pc = ( unsigned char * ) pCtx->Eip;
|
||||
for( i = 0; i < 16; i++ )
|
||||
{
|
||||
/* TOFIX: Unsafe funcion. */
|
||||
/* FIXME: Unsafe function. */
|
||||
if( IsBadReadPtr( pc, 1 ) )
|
||||
break;
|
||||
hb_snprintf( buf, sizeof( buf ), " %02X", ( int ) pc[ i ] );
|
||||
@@ -373,7 +358,7 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti
|
||||
sc = ( unsigned int * ) pCtx->Esp;
|
||||
for( i = 0; i < 16; i++ )
|
||||
{
|
||||
/* TOFIX: Unsafe funcion. */
|
||||
/* FIXME: Unsafe function. */
|
||||
if( IsBadReadPtr( sc, 4 ) )
|
||||
break;
|
||||
hb_snprintf( buf, sizeof( buf ), " %08X", sc[ i ] );
|
||||
@@ -384,12 +369,12 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti
|
||||
hb_strncat( errmsg, " EIP: EBP: Frame: OldEBP, RetAddr, Params...\n", errmsglen );
|
||||
eip = pCtx->Eip;
|
||||
ebp = ( unsigned int * ) pCtx->Ebp;
|
||||
/* TOFIX: Unsafe funcion. */
|
||||
/* FIXME: Unsafe function. */
|
||||
if( ! IsBadWritePtr( ebp, 8 ) )
|
||||
{
|
||||
for( i = 0; i < 20; i++ )
|
||||
{
|
||||
/* TOFIX: Unsafe funcion. */
|
||||
/* FIXME: Unsafe function. */
|
||||
if( ( unsigned int ) ebp % 4 != 0 || IsBadWritePtr( ebp, 40 ) || ( unsigned int ) ebp >= ebp[ 0 ] )
|
||||
break;
|
||||
hb_snprintf( buf, sizeof( buf ), " %08X %08X ", ( int ) eip, ( int ) ebp );
|
||||
@@ -460,7 +445,7 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti
|
||||
{
|
||||
char buf[ 256 ];
|
||||
#if defined( HB_OS_WIN_64 )
|
||||
/* TOFIX: me32.szExePath seemed trashed in some (standalone) tests. */
|
||||
/* FIXME: me32.szExePath seemed trashed in some (standalone) tests. */
|
||||
hb_snprintf( buf, sizeof( buf ), "%016" PFLL "X %016" PFLL "X %s\n", ( HB_PTRUINT ) me32.modBaseAddr, ( HB_PTRUINT ) me32.modBaseSize, me32.szExePath );
|
||||
#else
|
||||
char szBuffer[ MAX_PATH ];
|
||||
@@ -594,7 +579,7 @@ void hb_vmSetExceptionHandler( void )
|
||||
s_regRec.ExceptionHandler = ( ERR ) hb_os2ExceptionHandler;
|
||||
rc = DosSetExceptionHandler( &s_regRec );
|
||||
if( rc != NO_ERROR )
|
||||
hb_errInternal( HB_EI_ERRUNRECOV, "Unable to setup exception handler (DosSetExceptionHandler())", NULL, NULL );
|
||||
hb_errInternal( HB_EI_ERRUNRECOV, "Could not setup exception handler (DosSetExceptionHandler())", NULL, NULL );
|
||||
}
|
||||
#elif defined( HB_SIGNAL_EXCEPTION_HANDLER )
|
||||
{
|
||||
@@ -628,7 +613,7 @@ void hb_vmUnsetExceptionHandler( void )
|
||||
{
|
||||
APIRET rc; /* Return code */
|
||||
|
||||
/* I don't do any check on return code since harbour is exiting in any case */
|
||||
/* I don't do any check on return code since Harbour is exiting in any case */
|
||||
rc = DosUnsetExceptionHandler( &s_regRec );
|
||||
HB_SYMBOL_UNUSED( rc );
|
||||
}
|
||||
|
||||
28
src/vm/fm.c
28
src/vm/fm.c
@@ -2,6 +2,7 @@
|
||||
* The Fixed Memory API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (hb_xquery())
|
||||
*
|
||||
* 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
|
||||
@@ -44,16 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_xquery()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: This definitions must be ahead of any and all #include statements */
|
||||
|
||||
#if ! defined( HB_FM_STATISTICS ) && \
|
||||
@@ -323,7 +314,7 @@ typedef struct _HB_MEMINFO
|
||||
#define HB_FM_BLOCKSIZE( p ) ( s_fStatistic ? HB_FM_PTR( pMem )->nSize : 0 )
|
||||
|
||||
/* NOTE: we cannot use here HB_TRACE because it will overwrite the
|
||||
* function name/line number of code which called hb_xalloc/hb_xgrab
|
||||
* function name/line number of code which called hb_xalloc()/hb_xgrab()
|
||||
*/
|
||||
#define HB_TRACE_FM HB_TRACE_STEALTH
|
||||
|
||||
@@ -622,7 +613,7 @@ void * hb_xalloc( HB_SIZE nSize ) /* allocates fixed memory, returns NUL
|
||||
/* NOTE: PRG line number/procname is not very useful during hunting
|
||||
* for memory leaks - this is why we are using the previously stored
|
||||
* function/line info - this is a location of code that called
|
||||
* hb_xalloc/hb_xgrab
|
||||
* hb_xalloc()/hb_xgrab()
|
||||
*/
|
||||
pMem->uiProcLine = pTrace->line; /* C line number */
|
||||
if( pTrace->file )
|
||||
@@ -713,7 +704,7 @@ void * hb_xgrab( HB_SIZE nSize ) /* allocates fixed memory, exits on fai
|
||||
/* NOTE: PRG line number/procname is not very useful during hunting
|
||||
* for memory leaks - this is why we are using the previously stored
|
||||
* function/line info - this is a location of code that called
|
||||
* hb_xalloc/hb_xgrab
|
||||
* hb_xalloc()/hb_xgrab()
|
||||
*/
|
||||
pMem->uiProcLine = pTrace->line; /* C line number */
|
||||
if( pTrace->file )
|
||||
@@ -1152,17 +1143,21 @@ static char * hb_mem2str( char * membuffer, void * pMem, HB_SIZE nSize )
|
||||
|
||||
nPrintable = 0;
|
||||
for( nIndex = 0; nIndex < nSize; nIndex++ )
|
||||
{
|
||||
if( ( cMem[ nIndex ] & 0x60 ) != 0 )
|
||||
nPrintable++;
|
||||
}
|
||||
|
||||
if( nPrintable * 100 / nSize > 70 ) /* more then 70% printable chars */
|
||||
{
|
||||
/* format as string of original chars */
|
||||
for( nIndex = 0; nIndex < nSize; nIndex++ )
|
||||
{
|
||||
if( cMem[ nIndex ] >= ' ' )
|
||||
membuffer[ nIndex ] = cMem[ nIndex ];
|
||||
else
|
||||
membuffer[ nIndex ] = '.';
|
||||
}
|
||||
membuffer[ nIndex ] = '\0';
|
||||
}
|
||||
else
|
||||
@@ -1170,9 +1165,8 @@ static char * hb_mem2str( char * membuffer, void * pMem, HB_SIZE nSize )
|
||||
/* format as hex */
|
||||
for( nIndex = 0; nIndex < nSize; nIndex++ )
|
||||
{
|
||||
int lownibble, hinibble;
|
||||
hinibble = cMem[ nIndex ] >> 4;
|
||||
lownibble = cMem[ nIndex ] & 0x0F;
|
||||
HB_BYTE hinibble = cMem[ nIndex ] >> 4;
|
||||
HB_BYTE lownibble = cMem[ nIndex ] & 0x0F;
|
||||
membuffer[ nIndex * 2 ] = hinibble <= 9 ?
|
||||
( '0' + hinibble ) : ( 'A' + hinibble - 10 );
|
||||
membuffer[ nIndex * 2 + 1 ] = lownibble <= 9 ?
|
||||
@@ -1507,7 +1501,7 @@ HB_SIZE hb_xquery( int iMode )
|
||||
nResult = hb_stackTopOffset();
|
||||
break;
|
||||
}
|
||||
case HB_MEM_STATISTICS: /* Harbour extension (Is FM statistic is enabled?) */
|
||||
case HB_MEM_STATISTICS: /* Harbour extension (Is FM statistic enabled?) */
|
||||
#ifdef HB_FM_STATISTICS
|
||||
nResult = s_fStatistic;
|
||||
#else
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
/* holder of memory block information */
|
||||
/* NOTE: HB_USHORT is used intentionally to fill up the structure to
|
||||
* full 16 bytes (on 16/32 bit environment)
|
||||
* full 16 bytes (on 16/32-bit environment)
|
||||
*/
|
||||
typedef struct HB_GARBAGE_
|
||||
{
|
||||
@@ -386,7 +386,7 @@ void hb_gcGripDrop( PHB_ITEM pItem )
|
||||
}
|
||||
|
||||
/* Lock a memory pointer so it will not be released if stored
|
||||
outside of harbour variables
|
||||
outside of Harbour variables
|
||||
*/
|
||||
void * hb_gcLock( void * pBlock )
|
||||
{
|
||||
@@ -409,7 +409,7 @@ void * hb_gcLock( void * pBlock )
|
||||
}
|
||||
|
||||
/* Unlock a memory pointer so it can be released if there is no
|
||||
references inside of harbour variables
|
||||
references inside of Harbour variables
|
||||
*/
|
||||
void * hb_gcUnlock( void * pBlock )
|
||||
{
|
||||
@@ -724,7 +724,7 @@ void hb_gcReleaseAll( void )
|
||||
{
|
||||
if( s_pCurrBlock )
|
||||
{
|
||||
PHB_GARBAGE pAlloc, pDelete;
|
||||
PHB_GARBAGE pAlloc;
|
||||
|
||||
s_bCollecting = HB_TRUE;
|
||||
|
||||
@@ -742,7 +742,8 @@ void hb_gcReleaseAll( void )
|
||||
|
||||
do
|
||||
{
|
||||
HB_TRACE( HB_TR_INFO, ( "Release %p", s_pCurrBlock ) );
|
||||
PHB_GARBAGE pDelete;
|
||||
HB_TRACE( HB_TR_INFO, ( "Release %p", ( void * ) s_pCurrBlock ) );
|
||||
pDelete = s_pCurrBlock;
|
||||
hb_gcUnlink( &s_pCurrBlock, pDelete );
|
||||
HB_GC_AUTO_DEC();
|
||||
@@ -779,7 +780,7 @@ HB_FUNC( HB_GCALL )
|
||||
*/
|
||||
hb_ret();
|
||||
|
||||
hb_gcCollectAll( hb_parldef( 1, 1 ) );
|
||||
hb_gcCollectAll( hb_parldef( 1, HB_TRUE ) );
|
||||
}
|
||||
|
||||
#ifdef HB_GC_AUTO
|
||||
|
||||
@@ -78,6 +78,6 @@ PROCEDURE __HBVMInit()
|
||||
|
||||
PROCEDURE __SetHelpK()
|
||||
|
||||
SET KEY K_F1 TO __XHELP
|
||||
SetKey( K_F1, {| p, l, v | __XHelp( p, l, v ) } )
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#ifndef _HB_HASH_INTERNAL_
|
||||
# define _HB_HASH_INTERNAL_
|
||||
#define _HB_HASH_INTERNAL_
|
||||
#endif
|
||||
|
||||
#include "hbvmopt.h"
|
||||
@@ -82,7 +82,7 @@ static HB_GARBAGE_FUNC( hb_hashGarbageRelease )
|
||||
{
|
||||
PHB_BASEHASH pBaseHash = ( PHB_BASEHASH ) Cargo;
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "hb_hashGarbageRelease(%p)", pBaseHash ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "hb_hashGarbageRelease(%p)", ( void * ) pBaseHash ) );
|
||||
|
||||
if( pBaseHash->nSize > 0 )
|
||||
{
|
||||
@@ -139,7 +139,7 @@ static HB_GARBAGE_FUNC( hb_hashGarbageMark )
|
||||
{
|
||||
PHB_BASEHASH pBaseHash = ( PHB_BASEHASH ) Cargo;
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "hb_hashMarkGarbage(%p)", pBaseHash ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "hb_hashMarkGarbage(%p)", ( void * ) pBaseHash ) );
|
||||
|
||||
if( pBaseHash->nLen > 0 )
|
||||
{
|
||||
@@ -240,7 +240,7 @@ static void hb_hashResort( PHB_BASEHASH pBaseHash )
|
||||
|
||||
static void hb_hashSortDo( PHB_BASEHASH pBaseHash )
|
||||
{
|
||||
HB_SIZE nPos, nFrom;
|
||||
HB_SIZE nFrom;
|
||||
int iFlags = pBaseHash->iFlags;
|
||||
|
||||
if( pBaseHash->pnPos )
|
||||
@@ -281,7 +281,7 @@ static void hb_hashSortDo( PHB_BASEHASH pBaseHash )
|
||||
|
||||
for( nFrom = 1; nFrom < pBaseHash->nLen; ++nFrom )
|
||||
{
|
||||
nPos = nFrom;
|
||||
HB_SIZE nPos = nFrom;
|
||||
while( nPos > 0 && hb_hashItemCmp( &pBaseHash->pPairs[ nPos - 1 ].key,
|
||||
&pBaseHash->pPairs[ nPos ].key,
|
||||
iFlags ) > 0 )
|
||||
@@ -300,9 +300,8 @@ static void hb_hashSortDo( PHB_BASEHASH pBaseHash )
|
||||
|
||||
static HB_BOOL hb_hashFind( PHB_BASEHASH pBaseHash, PHB_ITEM pKey, HB_SIZE * pnPos )
|
||||
{
|
||||
HB_SIZE nLeft, nRight, nMiddle;
|
||||
HB_SIZE nLeft, nRight;
|
||||
int iFlags = pBaseHash->iFlags;
|
||||
int i;
|
||||
|
||||
if( iFlags & HB_HASH_RESORT )
|
||||
hb_hashSortDo( pBaseHash );
|
||||
@@ -312,10 +311,10 @@ static HB_BOOL hb_hashFind( PHB_BASEHASH pBaseHash, PHB_ITEM pKey, HB_SIZE * pnP
|
||||
|
||||
while( nLeft < nRight )
|
||||
{
|
||||
nMiddle = ( nLeft + nRight ) >> 1;
|
||||
i = hb_hashItemCmp( &pBaseHash->pPairs[ pBaseHash->pnPos ?
|
||||
pBaseHash->pnPos[ nMiddle ] : nMiddle ].key,
|
||||
pKey, iFlags );
|
||||
HB_SIZE nMiddle = ( nLeft + nRight ) >> 1;
|
||||
int i = hb_hashItemCmp( &pBaseHash->pPairs[ pBaseHash->pnPos ?
|
||||
pBaseHash->pnPos[ nMiddle ] : nMiddle ].key,
|
||||
pKey, iFlags );
|
||||
if( i == 0 )
|
||||
{
|
||||
*pnPos = pBaseHash->pnPos ? pBaseHash->pnPos[ nMiddle ] : nMiddle;
|
||||
@@ -563,7 +562,7 @@ PHB_ITEM hb_hashNew( PHB_ITEM pItem )
|
||||
{
|
||||
PHB_BASEHASH pBaseHash;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashNew(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashNew(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem == NULL )
|
||||
pItem = hb_itemNew( NULL );
|
||||
@@ -586,7 +585,7 @@ PHB_ITEM hb_hashNew( PHB_ITEM pItem )
|
||||
|
||||
HB_SIZE hb_hashLen( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashLen(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashLen(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
return pHash->item.asHash.value->nLen;
|
||||
@@ -596,7 +595,7 @@ HB_SIZE hb_hashLen( PHB_ITEM pHash )
|
||||
|
||||
void hb_hashPreallocate( PHB_ITEM pHash, HB_SIZE nNewSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashPreallocate(%p,%" HB_PFS "u)", pHash, nNewSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashPreallocate(%p,%" HB_PFS "u)", ( void * ) pHash, nNewSize ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
hb_hashResize( pHash->item.asHash.value, nNewSize );
|
||||
@@ -604,7 +603,7 @@ void hb_hashPreallocate( PHB_ITEM pHash, HB_SIZE nNewSize )
|
||||
|
||||
HB_BOOL hb_hashAllocNewPair( PHB_ITEM pHash, PHB_ITEM * pKeyPtr, PHB_ITEM * pValPtr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAllocNewPair(%p,%p,%p)", pHash, pKeyPtr, pValPtr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAllocNewPair(%p,%p,%p)", ( void * ) pHash, ( void * ) pKeyPtr, ( void * ) pValPtr ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -617,7 +616,7 @@ HB_BOOL hb_hashAllocNewPair( PHB_ITEM pHash, PHB_ITEM * pKeyPtr, PHB_ITEM * pVal
|
||||
|
||||
void hb_hashSort( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSort(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSort(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -633,7 +632,7 @@ void hb_hashSort( PHB_ITEM pHash )
|
||||
|
||||
PHB_ITEM hb_hashGetItemPtr( PHB_ITEM pHash, PHB_ITEM pKey, int iFlags )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetItemPtr(%p,%p,%d)", pHash, pKey, iFlags ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetItemPtr(%p,%p,%d)", ( void * ) pHash, ( void * ) pKey, iFlags ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
{
|
||||
@@ -648,7 +647,7 @@ PHB_ITEM hb_hashGetItemPtr( PHB_ITEM pHash, PHB_ITEM pKey, int iFlags )
|
||||
|
||||
PHB_ITEM hb_hashGetCItemPtr( PHB_ITEM pHash, const char * pszKey )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetCItemPtr(%p,%s)", pHash, pszKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetCItemPtr(%p,%s)", ( void * ) pHash, pszKey ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -670,7 +669,7 @@ HB_SIZE hb_hashGetCItemPos( PHB_ITEM pHash, const char * pszKey )
|
||||
{
|
||||
HB_SIZE nPos = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetCItemPos(%p,%s)", pHash, pszKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetCItemPos(%p,%s)", ( void * ) pHash, pszKey ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -692,7 +691,7 @@ HB_SIZE hb_hashGetCItemPos( PHB_ITEM pHash, const char * pszKey )
|
||||
|
||||
PHB_ITEM hb_hashGetItemRefPtr( PHB_ITEM pHash, PHB_ITEM pKey )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetItemRefPtr(%p,%p)", pHash, pKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetItemRefPtr(%p,%p)", ( void * ) pHash, ( void * ) pKey ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
{
|
||||
@@ -712,7 +711,7 @@ PHB_ITEM hb_hashGetItemRefPtr( PHB_ITEM pHash, PHB_ITEM pKey )
|
||||
|
||||
HB_BOOL hb_hashScan( PHB_ITEM pHash, PHB_ITEM pKey, HB_SIZE * pnPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashScan(%p,%p,%p)", pHash, pKey, pnPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashScan(%p,%p,%p)", ( void * ) pHash, ( void * ) pKey, ( void * ) pnPos ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -749,7 +748,7 @@ HB_BOOL hb_hashScan( PHB_ITEM pHash, PHB_ITEM pKey, HB_SIZE * pnPos )
|
||||
|
||||
HB_BOOL hb_hashScanSoft( PHB_ITEM pHash, PHB_ITEM pKey, HB_SIZE * pnPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashScanSoft(%p,%p,%p)", pHash, pKey, pnPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashScanSoft(%p,%p,%p)", ( void * ) pHash, ( void * ) pKey, ( void * ) pnPos ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
{
|
||||
@@ -778,7 +777,7 @@ HB_BOOL hb_hashScanSoft( PHB_ITEM pHash, PHB_ITEM pKey, HB_SIZE * pnPos )
|
||||
|
||||
HB_BOOL hb_hashClear( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClear(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClear(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -816,7 +815,7 @@ HB_BOOL hb_hashClear( PHB_ITEM pHash )
|
||||
|
||||
HB_BOOL hb_hashDel( PHB_ITEM pHash, PHB_ITEM pKey )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashDel(%p,%p)", pHash, pKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashDel(%p,%p)", ( void * ) pHash, ( void * ) pKey ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
{
|
||||
@@ -835,7 +834,7 @@ HB_BOOL hb_hashDel( PHB_ITEM pHash, PHB_ITEM pKey )
|
||||
|
||||
HB_BOOL hb_hashRemove( PHB_ITEM pHash, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashRemove(%p,%p)", pHash, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashRemove(%p,%p)", ( void * ) pHash, ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -870,7 +869,7 @@ HB_BOOL hb_hashRemove( PHB_ITEM pHash, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_hashAdd( PHB_ITEM pHash, PHB_ITEM pKey, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAdd(%p,%p,%p)", pHash, pKey, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAdd(%p,%p,%p)", ( void * ) pHash, ( void * ) pKey, ( void * ) pValue ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
{
|
||||
@@ -892,7 +891,7 @@ HB_BOOL hb_hashAdd( PHB_ITEM pHash, PHB_ITEM pKey, PHB_ITEM pValue )
|
||||
|
||||
HB_BOOL hb_hashAddNew( PHB_ITEM pHash, PHB_ITEM pKey, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAddNew(%p,%p,%p)", pHash, pKey, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashAddNew(%p,%p,%p)", ( void * ) pHash, ( void * ) pKey, ( void * ) pValue ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && HB_IS_HASHKEY( pKey ) )
|
||||
return hb_hashNewValue( pHash->item.asHash.value, pKey, pValue );
|
||||
@@ -902,7 +901,7 @@ HB_BOOL hb_hashAddNew( PHB_ITEM pHash, PHB_ITEM pKey, PHB_ITEM pValue )
|
||||
|
||||
PHB_ITEM hb_hashGetKeyAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetKeyAt(%p,%" HB_PFS "u)", pHash, nPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetKeyAt(%p,%" HB_PFS "u)", ( void * ) pHash, nPos ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && nPos > 0 && nPos <= pHash->item.asHash.value->nLen )
|
||||
return &pHash->item.asHash.value->pPairs[ nPos - 1 ].key;
|
||||
@@ -912,7 +911,7 @@ PHB_ITEM hb_hashGetKeyAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
|
||||
PHB_ITEM hb_hashGetValueAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetValueAt(%p,%" HB_PFS "u)", pHash, nPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetValueAt(%p,%" HB_PFS "u)", ( void * ) pHash, nPos ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && nPos > 0 && nPos <= pHash->item.asHash.value->nLen )
|
||||
{
|
||||
@@ -925,7 +924,7 @@ PHB_ITEM hb_hashGetValueAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
|
||||
HB_BOOL hb_hashDelAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashDelAt(%p,%" HB_PFS "u)", pHash, nPos ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashDelAt(%p,%" HB_PFS "u)", ( void * ) pHash, nPos ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) && nPos > 0 && nPos <= pHash->item.asHash.value->nLen )
|
||||
{
|
||||
@@ -936,10 +935,10 @@ HB_BOOL hb_hashDelAt( PHB_ITEM pHash, HB_SIZE nPos )
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
/* retrives the hash unique ID */
|
||||
/* retrieves the hash unique ID */
|
||||
void * hb_hashId( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashId(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashId(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
return ( void * ) pHash->item.asHash.value;
|
||||
@@ -951,7 +950,7 @@ void hb_hashCloneBody( PHB_ITEM pDest, PHB_ITEM pHash, PHB_NESTED_CLONED pCloned
|
||||
{
|
||||
HB_SIZE nPos;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashCloneBody(%p,%p,%p)", pDest, pHash, pClonedList ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashCloneBody(%p,%p,%p)", ( void * ) pDest, ( void * ) pHash, ( void * ) pClonedList ) );
|
||||
|
||||
hb_hashNew( pDest );
|
||||
pDest->item.asHash.value->iFlags = pHash->item.asHash.value->iFlags;
|
||||
@@ -980,7 +979,7 @@ void hb_hashCloneBody( PHB_ITEM pDest, PHB_ITEM pHash, PHB_NESTED_CLONED pCloned
|
||||
|
||||
PHB_ITEM hb_hashCloneTo( PHB_ITEM pDest, PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashCloneTo(%p,%p)", pDest, pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashCloneTo(%p,%p)", ( void * ) pDest, ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -996,14 +995,14 @@ PHB_ITEM hb_hashCloneTo( PHB_ITEM pDest, PHB_ITEM pHash )
|
||||
|
||||
PHB_ITEM hb_hashClone( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClone(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClone(%p)", ( void * ) pHash ) );
|
||||
|
||||
return hb_hashCloneTo( hb_itemNew( NULL ), pHash );
|
||||
}
|
||||
|
||||
void hb_hashJoin( PHB_ITEM pDest, PHB_ITEM pSource, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashJoin(%p,%p,%d)", pDest, pSource, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashJoin(%p,%p,%d)", ( void * ) pDest, ( void * ) pSource, iType ) );
|
||||
|
||||
if( HB_IS_HASH( pDest ) && HB_IS_HASH( pSource ) )
|
||||
{
|
||||
@@ -1084,7 +1083,7 @@ void hb_hashJoin( PHB_ITEM pDest, PHB_ITEM pSource, int iType )
|
||||
|
||||
PHB_ITEM hb_hashGetKeys( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetKeys(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetKeys(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -1106,7 +1105,7 @@ PHB_ITEM hb_hashGetKeys( PHB_ITEM pHash )
|
||||
|
||||
PHB_ITEM hb_hashGetValues( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetValues(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetValues(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -1128,7 +1127,7 @@ PHB_ITEM hb_hashGetValues( PHB_ITEM pHash )
|
||||
|
||||
void hb_hashSetDefault( PHB_ITEM pHash, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSetDefault(%p,%p)", pHash, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSetDefault(%p,%p)", ( void * ) pHash, ( void * ) pValue ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -1149,7 +1148,7 @@ void hb_hashSetDefault( PHB_ITEM pHash, PHB_ITEM pValue )
|
||||
|
||||
PHB_ITEM hb_hashGetDefault( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetDefault(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetDefault(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
return pHash->item.asHash.value->pDefault;
|
||||
@@ -1159,7 +1158,7 @@ PHB_ITEM hb_hashGetDefault( PHB_ITEM pHash )
|
||||
|
||||
void hb_hashSetFlags( PHB_ITEM pHash, int iFlags )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSetFlags(%p,%d)", pHash, iFlags ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashSetFlags(%p,%d)", ( void * ) pHash, iFlags ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -1184,7 +1183,7 @@ void hb_hashSetFlags( PHB_ITEM pHash, int iFlags )
|
||||
|
||||
void hb_hashClearFlags( PHB_ITEM pHash, int iFlags )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClearFlags(%p,%d)", pHash, iFlags ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashClearFlags(%p,%d)", ( void * ) pHash, iFlags ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
{
|
||||
@@ -1201,7 +1200,7 @@ void hb_hashClearFlags( PHB_ITEM pHash, int iFlags )
|
||||
|
||||
int hb_hashGetFlags( PHB_ITEM pHash )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetFlags(%p)", pHash ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hashGetFlags(%p)", ( void * ) pHash ) );
|
||||
|
||||
if( HB_IS_HASH( pHash ) )
|
||||
return pHash->item.asHash.value->iFlags;
|
||||
|
||||
@@ -54,13 +54,14 @@
|
||||
|
||||
HB_FUNC( HB_HASH )
|
||||
{
|
||||
int iPCount = hb_pcount(), iParam;
|
||||
int iPCount = hb_pcount();
|
||||
|
||||
if( iPCount & 1 )
|
||||
hb_errRT_BASE( EG_BOUND, 1131, NULL, hb_langDGetErrorDesc( EG_ARRDIMENSION ), HB_ERR_ARGS_BASEPARAMS );
|
||||
else
|
||||
{
|
||||
PHB_ITEM pHash = hb_hashNew( NULL );
|
||||
int iParam;
|
||||
for( iParam = 1; iParam <= iPCount; iParam += 2 )
|
||||
{
|
||||
PHB_ITEM pKey = hb_param( iParam, HB_IT_HASHKEY );
|
||||
@@ -377,10 +378,11 @@ HB_FUNC( HB_HMERGE )
|
||||
{
|
||||
PHB_ITEM pDest = hb_param( 1, HB_IT_HASH );
|
||||
PHB_ITEM pSource = hb_param( 2, HB_IT_HASH );
|
||||
PHB_ITEM pAction = hb_param( 3, HB_IT_EVALITEM | HB_IT_NUMERIC );
|
||||
|
||||
if( pDest && pSource )
|
||||
{
|
||||
PHB_ITEM pAction = hb_param( 3, HB_IT_EVALITEM | HB_IT_NUMERIC );
|
||||
|
||||
if( pAction && HB_IS_EVALITEM( pAction ) )
|
||||
{
|
||||
HB_SIZE nLen = hb_hashLen( pSource ), nPos = 0;
|
||||
@@ -690,12 +692,14 @@ HB_FUNC( HB_HSORT )
|
||||
HB_FUNC( HB_HCASEMATCH )
|
||||
{
|
||||
PHB_ITEM pHash = hb_param( 1, HB_IT_HASH );
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
|
||||
if( pHash )
|
||||
{
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
int iFlags = hb_hashGetFlags( pHash );
|
||||
|
||||
hb_retl( ( iFlags & HB_HASH_IGNORECASE ) == 0 );
|
||||
|
||||
if( pValue )
|
||||
{
|
||||
if( hb_itemGetL( pValue ) )
|
||||
@@ -720,12 +724,14 @@ HB_FUNC( HB_HCASEMATCH )
|
||||
HB_FUNC( HB_HBINARY )
|
||||
{
|
||||
PHB_ITEM pHash = hb_param( 1, HB_IT_HASH );
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
|
||||
if( pHash )
|
||||
{
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
int iFlags = hb_hashGetFlags( pHash );
|
||||
|
||||
hb_retl( ( iFlags & HB_HASH_BINARY ) != 0 );
|
||||
|
||||
if( pValue )
|
||||
{
|
||||
if( hb_itemGetL( pValue ) )
|
||||
@@ -750,10 +756,10 @@ HB_FUNC( HB_HBINARY )
|
||||
HB_FUNC( HB_HAUTOADD )
|
||||
{
|
||||
PHB_ITEM pHash = hb_param( 1, HB_IT_HASH );
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL | HB_IT_NUMERIC );
|
||||
|
||||
if( pHash )
|
||||
{
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL | HB_IT_NUMERIC );
|
||||
int iOldFlags = hb_hashGetFlags( pHash ) & HB_HASH_AUTOADD_MASK;
|
||||
|
||||
hb_retni( iOldFlags );
|
||||
@@ -788,12 +794,14 @@ HB_FUNC( HB_HAUTOADD )
|
||||
HB_FUNC( HB_HKEEPORDER )
|
||||
{
|
||||
PHB_ITEM pHash = hb_param( 1, HB_IT_HASH );
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
|
||||
if( pHash )
|
||||
{
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_LOGICAL );
|
||||
int iFlags = hb_hashGetFlags( pHash );
|
||||
|
||||
hb_retl( ( iFlags & HB_HASH_KEEPORDER ) != 0 );
|
||||
|
||||
if( pValue )
|
||||
{
|
||||
if( hb_itemGetL( pValue ) )
|
||||
|
||||
296
src/vm/hvm.c
296
src/vm/hvm.c
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* common file with all HVM functions for compilers which can improve
|
||||
* speed automatically inlining functions
|
||||
* Common file with all HVM functions for compilers which can improve
|
||||
* speed automatically inlining functions
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -66,10 +66,10 @@
|
||||
|
||||
/* For Linux and mremap() function */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
/* warning the order of included files is important
|
||||
/* Warning: the order of included files is important
|
||||
* due to macros used to overload some functions
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -184,5 +184,5 @@ void hb_vmSymbolInit_RT( void )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_vmSymbolInit_RT()" ) );
|
||||
|
||||
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ), "initsymb.c", 0, 0 );
|
||||
hb_vmProcessSymbols( symbols, HB_SIZEOFARRAY( symbols ), "", 0, 0 );
|
||||
}
|
||||
|
||||
233
src/vm/itemapi.c
233
src/vm/itemapi.c
@@ -2,6 +2,15 @@
|
||||
* The Item API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2007 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_itemPCount(), hb_itemParamPtr(), hb_itemReturnPtr()
|
||||
* hb_itemPutDL(), hb_itemPutNI(), hb_itemGetDL(), hb_itemGetNI(),
|
||||
* hb_itemGetCPtr(), hb_itemPutCLPtr(), hb_itemGetCLen(), hb_itemGetNLen()
|
||||
* hb_itemPutCConst(), hb_itemPutCLConst()
|
||||
* hb_itemPutNLen(), hb_itemPutNDLen(), hb_itemPutNILen(), hb_itemPutNLLen()
|
||||
* hb_itemPutD(), hb_itemSetCMemo()
|
||||
* Copyright 1999 Eddie Runia <eddie@runia.com> (hb_itemStrCmp())
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com> (hb_itemStr(), hb_itemString(), hb_itemValToStr())
|
||||
*
|
||||
* 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
|
||||
@@ -44,40 +53,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2007 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_itemPCount()
|
||||
* hb_itemParamPtr()
|
||||
* hb_itemReturnPtr()
|
||||
* hb_itemPutDL()
|
||||
* hb_itemPutNI()
|
||||
* hb_itemGetDL()
|
||||
* hb_itemGetNI()
|
||||
* hb_itemGetCPtr()
|
||||
* hb_itemGetCLPtr()
|
||||
* hb_itemGetCLen()
|
||||
* hb_itemGetNLen()
|
||||
* hb_itemPutCConst()
|
||||
* hb_itemPutCLConst()
|
||||
* hb_itemPutNLen()
|
||||
* hb_itemPutNDLen()
|
||||
* hb_itemPutNILen()
|
||||
* hb_itemPutNLLen()
|
||||
* hb_itemPutD()
|
||||
* hb_itemSetCMemo()
|
||||
*
|
||||
* Copyright 1999 Eddie Runia <eddie@runia.com>
|
||||
* hb_itemStrCmp()
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_itemStr(), hb_itemString(), and hb_itemValToStr().
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmopt.h"
|
||||
/* hbfloat.h have to be included before other header files */
|
||||
#include "hbfloat.h"
|
||||
@@ -94,7 +69,7 @@
|
||||
|
||||
PHB_ITEM hb_itemNew( PHB_ITEM pNull )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemNew(%p)", pNull ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemNew(%p)", ( void * ) pNull ) );
|
||||
|
||||
return hb_gcGripGet( pNull );
|
||||
}
|
||||
@@ -117,7 +92,7 @@ PHB_ITEM hb_itemParamPtr( HB_USHORT uiParam, long lMask )
|
||||
|
||||
HB_BOOL hb_itemParamStore( HB_USHORT uiParam, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStore(%hu, %p)", uiParam, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStore(%hu, %p)", uiParam, ( void * ) pItem ) );
|
||||
|
||||
if( hb_param( uiParam, HB_IT_BYREF ) )
|
||||
{
|
||||
@@ -136,7 +111,7 @@ HB_BOOL hb_itemParamStore( HB_USHORT uiParam, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_itemParamStoreForward( HB_USHORT uiParam, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStoreForward(%hu, %p)", uiParam, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStoreForward(%hu, %p)", uiParam, ( void * ) pItem ) );
|
||||
|
||||
if( hb_param( uiParam, HB_IT_BYREF ) )
|
||||
{
|
||||
@@ -155,7 +130,7 @@ HB_BOOL hb_itemParamStoreForward( HB_USHORT uiParam, PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_itemParamStoreRelease( HB_USHORT uiParam, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStoreRelease(%hu, %p)", uiParam, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemParamStoreRelease(%hu, %p)", uiParam, ( void * ) pItem ) );
|
||||
|
||||
if( hb_param( uiParam, HB_IT_BYREF ) )
|
||||
{
|
||||
@@ -186,7 +161,7 @@ HB_USHORT hb_itemPCount( void )
|
||||
|
||||
HB_BOOL hb_itemRelease( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemRelease(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemRelease(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -214,7 +189,7 @@ PHB_ITEM hb_itemArrayGet( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
{
|
||||
PHB_ITEM pItem;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemArrayGet(%p, %" HB_PFS "u)", pArray, nIndex ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemArrayGet(%p, %" HB_PFS "u)", ( void * ) pArray, nIndex ) );
|
||||
|
||||
pItem = hb_itemNew( NULL );
|
||||
|
||||
@@ -226,7 +201,7 @@ PHB_ITEM hb_itemArrayGet( PHB_ITEM pArray, HB_SIZE nIndex )
|
||||
|
||||
PHB_ITEM hb_itemArrayPut( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemArrayPut(%p, %" HB_PFS "u, %p)", pArray, nIndex, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemArrayPut(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( void * ) pItem ) );
|
||||
|
||||
if( pArray )
|
||||
hb_arraySet( pArray, nIndex, pItem );
|
||||
@@ -236,7 +211,7 @@ PHB_ITEM hb_itemArrayPut( PHB_ITEM pArray, HB_SIZE nIndex, PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemPutNil( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNil(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNil(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
hb_itemSetNil( pItem );
|
||||
@@ -250,7 +225,7 @@ PHB_ITEM hb_itemPutC( PHB_ITEM pItem, const char * szText )
|
||||
{
|
||||
HB_SIZE nLen, nAlloc;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutC(%p, %s)", pItem, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutC(%p, %s)", ( void * ) pItem, szText ) );
|
||||
|
||||
nLen = szText ? strlen( szText ) : 0;
|
||||
if( nLen <= 1 )
|
||||
@@ -285,7 +260,7 @@ PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, const char * szText, HB_SIZE nLen )
|
||||
HB_SIZE nAlloc;
|
||||
char * szValue;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCL(%p, %.*s, %" HB_PFS "u)", pItem, ( int ) nLen, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCL(%p, %.*s, %" HB_PFS "u)", ( void * ) pItem, ( int ) nLen, szText, nLen ) );
|
||||
|
||||
if( nLen <= 1 )
|
||||
{
|
||||
@@ -323,7 +298,7 @@ PHB_ITEM hb_itemPutCConst( PHB_ITEM pItem, const char * szText )
|
||||
{
|
||||
HB_SIZE nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCConst(%p, %s)", pItem, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCConst(%p, %s)", ( void * ) pItem, szText ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -346,7 +321,7 @@ PHB_ITEM hb_itemPutCConst( PHB_ITEM pItem, const char * szText )
|
||||
|
||||
PHB_ITEM hb_itemPutCLConst( PHB_ITEM pItem, const char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCLConst(%p, %.*s, %" HB_PFS "u)", pItem, ( int ) nLen, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCLConst(%p, %.*s, %" HB_PFS "u)", ( void * ) pItem, ( int ) nLen, szText, nLen ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -374,7 +349,7 @@ PHB_ITEM hb_itemPutCPtr( PHB_ITEM pItem, char * szText )
|
||||
{
|
||||
HB_SIZE nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCPtr(%p, %s)", pItem, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCPtr(%p, %s)", ( void * ) pItem, szText ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -406,7 +381,7 @@ PHB_ITEM hb_itemPutCPtr( PHB_ITEM pItem, char * szText )
|
||||
|
||||
PHB_ITEM hb_itemPutCLPtr( PHB_ITEM pItem, char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCLPtr(%p, %.*s, %" HB_PFS "u)", pItem, ( int ) nLen, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutCLPtr(%p, %.*s, %" HB_PFS "u)", ( void * ) pItem, ( int ) nLen, szText, nLen ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -444,7 +419,7 @@ void hb_itemSetCMemo( PHB_ITEM pItem )
|
||||
|
||||
char * hb_itemGetC( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetC(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetC(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -463,7 +438,7 @@ char * hb_itemGetC( PHB_ITEM pItem )
|
||||
|
||||
const char * hb_itemGetCPtr( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetCPtr(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetCPtr(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
return pItem->item.asString.value;
|
||||
@@ -473,7 +448,7 @@ const char * hb_itemGetCPtr( PHB_ITEM pItem )
|
||||
|
||||
HB_SIZE hb_itemGetCLen( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetCLen(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetCLen(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
return pItem->item.asString.length;
|
||||
@@ -483,7 +458,7 @@ HB_SIZE hb_itemGetCLen( PHB_ITEM pItem )
|
||||
|
||||
HB_SIZE hb_itemCopyC( PHB_ITEM pItem, char * szBuffer, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyC(%p, %s, %" HB_PFS "u)", pItem, szBuffer, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyC(%p, %s, %" HB_PFS "u)", ( void * ) pItem, szBuffer, nLen ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -520,7 +495,7 @@ HB_BOOL hb_itemFreeC( char * szText )
|
||||
|
||||
char * hb_itemGetDS( PHB_ITEM pItem, char * szDate )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetDS(%p, %p)", pItem, szDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetDS(%p, %p)", ( void * ) pItem, ( void * ) szDate ) );
|
||||
|
||||
if( pItem && HB_IS_DATETIME( pItem ) )
|
||||
return hb_dateDecStr( szDate, pItem->item.asDateTime.julian );
|
||||
@@ -530,7 +505,7 @@ char * hb_itemGetDS( PHB_ITEM pItem, char * szDate )
|
||||
|
||||
long hb_itemGetDL( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetDL(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetDL(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_DATETIME( pItem ) )
|
||||
return pItem->item.asDateTime.julian;
|
||||
@@ -544,7 +519,7 @@ long hb_itemGetDL( PHB_ITEM pItem )
|
||||
*/
|
||||
char * hb_itemGetTS( PHB_ITEM pItem, char * szDateTime )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTS(%p, %s)", pItem, szDateTime ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTS(%p, %s)", ( void * ) pItem, szDateTime ) );
|
||||
|
||||
if( pItem && HB_IS_DATETIME( pItem ) )
|
||||
return hb_timeStampStrRawPut( szDateTime, pItem->item.asDateTime.julian,
|
||||
@@ -555,7 +530,7 @@ char * hb_itemGetTS( PHB_ITEM pItem, char * szDateTime )
|
||||
|
||||
double hb_itemGetTD( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTD(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTD(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_DATETIME( pItem ) )
|
||||
return hb_timeStampPackDT( pItem->item.asDateTime.julian,
|
||||
@@ -566,7 +541,7 @@ double hb_itemGetTD( PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_itemGetTDT( PHB_ITEM pItem, long * plJulian, long * plMilliSec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTDT(%p,%p,%p)", pItem, plJulian, plMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetTDT(%p,%p,%p)", ( void * ) pItem, ( void * ) plJulian, ( void * ) plMilliSec ) );
|
||||
|
||||
if( pItem && HB_IS_DATETIME( pItem ) )
|
||||
{
|
||||
@@ -583,7 +558,7 @@ HB_BOOL hb_itemGetTDT( PHB_ITEM pItem, long * plJulian, long * plMilliSec )
|
||||
|
||||
HB_BOOL hb_itemGetL( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetL(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetL(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -605,7 +580,7 @@ HB_BOOL hb_itemGetL( PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_itemGetLX( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetLX(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetLX(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -634,7 +609,7 @@ HB_BOOL hb_itemGetLX( PHB_ITEM pItem )
|
||||
|
||||
double hb_itemGetND( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetND(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetND(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -653,7 +628,7 @@ double hb_itemGetND( PHB_ITEM pItem )
|
||||
|
||||
int hb_itemGetNI( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNI(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNI(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -672,7 +647,7 @@ int hb_itemGetNI( PHB_ITEM pItem )
|
||||
|
||||
long hb_itemGetNL( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -691,7 +666,7 @@ long hb_itemGetNL( PHB_ITEM pItem )
|
||||
|
||||
HB_ISIZ hb_itemGetNS( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNS(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNS(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -710,7 +685,7 @@ HB_ISIZ hb_itemGetNS( PHB_ITEM pItem )
|
||||
|
||||
HB_MAXINT hb_itemGetNInt( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -730,7 +705,7 @@ HB_MAXINT hb_itemGetNInt( PHB_ITEM pItem )
|
||||
#ifndef HB_LONG_LONG_OFF
|
||||
HB_LONGLONG hb_itemGetNLL( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNL(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -750,7 +725,7 @@ HB_LONGLONG hb_itemGetNLL( PHB_ITEM pItem )
|
||||
|
||||
void * hb_itemGetPtr( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetPtr(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetPtr(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_POINTER( pItem ) )
|
||||
return pItem->item.asPointer.value;
|
||||
@@ -760,7 +735,7 @@ void * hb_itemGetPtr( PHB_ITEM pItem )
|
||||
|
||||
void * hb_itemGetPtrGC( PHB_ITEM pItem, const HB_GC_FUNCS * pFuncs )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetPtrGC(%p,%p)", pItem, pFuncs ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetPtrGC(%p,%p)", ( void * ) pItem, ( const void * ) pFuncs ) );
|
||||
|
||||
if( pItem && HB_IS_POINTER( pItem ) &&
|
||||
pItem->item.asPointer.collect &&
|
||||
@@ -772,7 +747,7 @@ void * hb_itemGetPtrGC( PHB_ITEM pItem, const HB_GC_FUNCS * pFuncs )
|
||||
|
||||
PHB_SYMB hb_itemGetSymbol( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetSymbol(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetSymbol(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem && HB_IS_SYMBOL( pItem ) )
|
||||
return pItem->item.asSymbol.value;
|
||||
@@ -782,7 +757,7 @@ PHB_SYMB hb_itemGetSymbol( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemReturn( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturn(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturn(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -795,7 +770,7 @@ PHB_ITEM hb_itemReturn( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemReturnForward( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturnForward(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturnForward(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -808,7 +783,7 @@ PHB_ITEM hb_itemReturnForward( PHB_ITEM pItem )
|
||||
|
||||
void hb_itemReturnRelease( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturnRelease(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReturnRelease(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -821,7 +796,7 @@ void hb_itemReturnRelease( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, const char * szDate )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutDS(%p, %.8s)", pItem, szDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutDS(%p, %.8s)", ( void * ) pItem, szDate ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -840,7 +815,7 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, const char * szDate )
|
||||
|
||||
PHB_ITEM hb_itemPutD( PHB_ITEM pItem, int iYear, int iMonth, int iDay )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutD(%p, %04i, %02i, %02i)", pItem, iYear, iMonth, iDay ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutD(%p, %04i, %02i, %02i)", ( void * ) pItem, iYear, iMonth, iDay ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -859,7 +834,7 @@ PHB_ITEM hb_itemPutD( PHB_ITEM pItem, int iYear, int iMonth, int iDay )
|
||||
|
||||
PHB_ITEM hb_itemPutDL( PHB_ITEM pItem, long lJulian )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutDL(%p, %ld)", pItem, lJulian ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutDL(%p, %ld)", ( void * ) pItem, lJulian ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -878,7 +853,7 @@ PHB_ITEM hb_itemPutDL( PHB_ITEM pItem, long lJulian )
|
||||
|
||||
PHB_ITEM hb_itemPutTS( PHB_ITEM pItem, const char * szDateTime )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTS(%p, %s)", pItem, szDateTime ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTS(%p, %s)", ( void * ) pItem, szDateTime ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -899,7 +874,7 @@ PHB_ITEM hb_itemPutTD( PHB_ITEM pItem, double dTimeStamp )
|
||||
{
|
||||
long lJulian, lMilliSec;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTD(%p, %lf)", pItem, dTimeStamp ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTD(%p, %lf)", ( void * ) pItem, dTimeStamp ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -919,7 +894,7 @@ PHB_ITEM hb_itemPutTD( PHB_ITEM pItem, double dTimeStamp )
|
||||
|
||||
PHB_ITEM hb_itemPutTDT( PHB_ITEM pItem, long lJulian, long lMilliSec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTDT(%p, %ld, %ld)", pItem, lJulian, lMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutTDT(%p, %ld, %ld)", ( void * ) pItem, lJulian, lMilliSec ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -938,7 +913,7 @@ PHB_ITEM hb_itemPutTDT( PHB_ITEM pItem, long lJulian, long lMilliSec )
|
||||
|
||||
PHB_ITEM hb_itemPutL( PHB_ITEM pItem, HB_BOOL bValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutL(%p, %d)", pItem, ( int ) bValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutL(%p, %d)", ( void * ) pItem, ( int ) bValue ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -958,7 +933,7 @@ PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutND(%p, %lf)", pItem, dNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutND(%p, %lf)", ( void * ) pItem, dNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -978,7 +953,7 @@ PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber )
|
||||
|
||||
PHB_ITEM hb_itemPutNI( PHB_ITEM pItem, int iNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNI(%p, %d)", pItem, iNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNI(%p, %d)", ( void * ) pItem, iNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -997,7 +972,7 @@ PHB_ITEM hb_itemPutNI( PHB_ITEM pItem, int iNumber )
|
||||
|
||||
PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNL(%p, %ld)", pItem, lNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNL(%p, %ld)", ( void * ) pItem, lNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1014,7 +989,7 @@ PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber )
|
||||
|
||||
PHB_ITEM hb_itemPutNS( PHB_ITEM pItem, HB_ISIZ nNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNS(%p, %" HB_PFS "d)", pItem, nNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNS(%p, %" HB_PFS "d)", ( void * ) pItem, nNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1051,7 +1026,7 @@ PHB_ITEM hb_itemPutNS( PHB_ITEM pItem, HB_ISIZ nNumber )
|
||||
#ifndef HB_LONG_LONG_OFF
|
||||
PHB_ITEM hb_itemPutNLL( PHB_ITEM pItem, HB_LONGLONG llNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNL(%p, %" PFLL "d)", pItem, llNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNL(%p, %" PFLL "d)", ( void * ) pItem, llNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1077,7 +1052,7 @@ PHB_ITEM hb_itemPutNLL( PHB_ITEM pItem, HB_LONGLONG llNumber )
|
||||
|
||||
PHB_ITEM hb_itemPutNInt( PHB_ITEM pItem, HB_MAXINT nNumber )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNInt(%p, %" PFHL "d)", pItem, nNumber ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNInt(%p, %" PFHL "d)", ( void * ) pItem, nNumber ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1106,7 +1081,7 @@ PHB_ITEM hb_itemPutNInt( PHB_ITEM pItem, HB_MAXINT nNumber )
|
||||
|
||||
PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_MAXINT nNumber, int iWidth )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNIntLen(%p, %" PFHL "d, %d)", pItem, nNumber, iWidth ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNIntLen(%p, %" PFHL "d, %d)", ( void * ) pItem, nNumber, iWidth ) );
|
||||
|
||||
if( HB_LIM_INT( nNumber ) )
|
||||
{
|
||||
@@ -1124,7 +1099,7 @@ PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_MAXINT nNumber, int iWidth )
|
||||
|
||||
PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLen(%p, %lf, %d, %d)", pItem, dNumber, iWidth, iDec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLen(%p, %lf, %d, %d)", ( void * ) pItem, dNumber, iWidth, iDec ) );
|
||||
|
||||
if( iDec < 0 )
|
||||
{
|
||||
@@ -1150,7 +1125,7 @@ PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
|
||||
|
||||
PHB_ITEM hb_itemPutNDLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNDLen(%p, %lf, %d, %d)", pItem, dNumber, iWidth, iDec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNDLen(%p, %lf, %d, %d)", ( void * ) pItem, dNumber, iWidth, iDec ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1179,7 +1154,7 @@ PHB_ITEM hb_itemPutNDLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
|
||||
|
||||
PHB_ITEM hb_itemPutNDDec( PHB_ITEM pItem, double dNumber, int iDec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNDDec(%p, %lf, %i)", pItem, dNumber, iDec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNDDec(%p, %lf, %i)", ( void * ) pItem, dNumber, iDec ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1209,7 +1184,7 @@ PHB_ITEM hb_itemPutNDDec( PHB_ITEM pItem, double dNumber, int iDec )
|
||||
|
||||
double hb_itemGetNDDec( PHB_ITEM pItem, int * piDec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNDDec(%p,%p)", pItem, piDec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNDDec(%p,%p)", ( void * ) pItem, ( void * ) piDec ) );
|
||||
|
||||
if( HB_IS_INTEGER( pItem ) )
|
||||
{
|
||||
@@ -1234,7 +1209,7 @@ double hb_itemGetNDDec( PHB_ITEM pItem, int * piDec )
|
||||
|
||||
PHB_ITEM hb_itemPutNILen( PHB_ITEM pItem, int iNumber, int iWidth )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNILen(%p, %d, %d)", pItem, iNumber, iWidth ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNILen(%p, %d, %d)", ( void * ) pItem, iNumber, iWidth ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1256,7 +1231,7 @@ PHB_ITEM hb_itemPutNILen( PHB_ITEM pItem, int iNumber, int iWidth )
|
||||
|
||||
PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLLen(%p, %ld, %d)", pItem, lNumber, iWidth ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLLen(%p, %ld, %d)", ( void * ) pItem, lNumber, iWidth ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1288,7 +1263,7 @@ PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth )
|
||||
#ifndef HB_LONG_LONG_OFF
|
||||
PHB_ITEM hb_itemPutNLLLen( PHB_ITEM pItem, HB_LONGLONG llNumber, int iWidth )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLLLen(%p, %" PFLL "d, %d)", pItem, llNumber, iWidth ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNLLLen(%p, %" PFLL "d, %d)", ( void * ) pItem, llNumber, iWidth ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1320,7 +1295,7 @@ PHB_ITEM hb_itemPutNLLLen( PHB_ITEM pItem, HB_LONGLONG llNumber, int iWidth )
|
||||
|
||||
PHB_ITEM hb_itemPutNumType( PHB_ITEM pItem, double dNumber, int iDec, int iType1, int iType2 )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNumType( %p, %lf, %d, %i, %i)", pItem, dNumber, iDec, iType1, iType2 ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutNumType( %p, %lf, %d, %i, %i)", ( void * ) pItem, dNumber, iDec, iType1, iType2 ) );
|
||||
|
||||
if( iDec || iType1 & HB_IT_DOUBLE || iType2 & HB_IT_DOUBLE )
|
||||
{
|
||||
@@ -1346,7 +1321,7 @@ PHB_ITEM hb_itemPutNumType( PHB_ITEM pItem, double dNumber, int iDec, int iType1
|
||||
|
||||
PHB_ITEM hb_itemPutPtr( PHB_ITEM pItem, void * pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtr(%p, %p)", pItem, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtr(%p, %p)", ( void * ) pItem, pValue ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1366,7 +1341,7 @@ PHB_ITEM hb_itemPutPtr( PHB_ITEM pItem, void * pValue )
|
||||
|
||||
PHB_ITEM hb_itemPutPtrGC( PHB_ITEM pItem, void * pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtrGC(%p, %p)", pItem, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtrGC(%p, %p)", ( void * ) pItem, pValue ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1388,7 +1363,7 @@ PHB_ITEM hb_itemPutPtrGC( PHB_ITEM pItem, void * pValue )
|
||||
|
||||
PHB_ITEM hb_itemPutPtrRawGC( PHB_ITEM pItem, void * pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtrRawGC(%p, %p)", pItem, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutPtrRawGC(%p, %p)", ( void * ) pItem, pValue ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1408,7 +1383,7 @@ PHB_ITEM hb_itemPutPtrRawGC( PHB_ITEM pItem, void * pValue )
|
||||
|
||||
PHB_ITEM hb_itemPutSymbol( PHB_ITEM pItem, PHB_SYMB pSym )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutSymbol(%p,%p)", pItem, pSym ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutSymbol(%p,%p)", ( void * ) pItem, ( void * ) pSym ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1429,7 +1404,7 @@ PHB_ITEM hb_itemPutSymbol( PHB_ITEM pItem, PHB_SYMB pSym )
|
||||
|
||||
void hb_itemGetNLen( PHB_ITEM pItem, int * piWidth, int * piDecimal )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNLen(%p, %p, %p)", pItem, piWidth, piDecimal ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetNLen(%p, %p, %p)", ( void * ) pItem, ( void * ) piWidth, ( void * ) piDecimal ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1458,7 +1433,7 @@ void hb_itemGetNLen( PHB_ITEM pItem, int * piWidth, int * piDecimal )
|
||||
|
||||
HB_SIZE hb_itemSize( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemSize(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemSize(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1475,7 +1450,7 @@ HB_SIZE hb_itemSize( PHB_ITEM pItem )
|
||||
|
||||
HB_TYPE hb_itemType( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemType(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemType(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
return ( HB_TYPE ) HB_ITEM_TYPE( pItem );
|
||||
@@ -1485,7 +1460,7 @@ HB_TYPE hb_itemType( PHB_ITEM pItem )
|
||||
|
||||
const char * hb_itemTypeStr( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemTypeStr(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemTypeStr(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -1535,7 +1510,7 @@ const char * hb_itemTypeStr( PHB_ITEM pItem )
|
||||
|
||||
void hb_itemInit( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemInit(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemInit(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
pItem->type = HB_IT_NIL;
|
||||
@@ -1545,7 +1520,7 @@ void hb_itemClear( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TYPE type;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemClear(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemClear(%p)", ( void * ) pItem ) );
|
||||
|
||||
type = HB_ITEM_TYPERAW( pItem );
|
||||
pItem->type = HB_IT_NIL;
|
||||
@@ -1592,7 +1567,7 @@ void hb_itemClear( PHB_ITEM pItem )
|
||||
|
||||
void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopy(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopy(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( pDest == pSource )
|
||||
hb_errInternal( HB_EI_ITEMBADCOPY, NULL, "hb_itemCopy()", NULL );
|
||||
@@ -1625,7 +1600,7 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
if( HB_IS_MEMVAR( pSource ) )
|
||||
hb_memvarValueIncRef( pSource->item.asMemvar.value );
|
||||
|
||||
else if( HB_IS_ENUM( pSource ) ) /* enumerators cannnot be copied */
|
||||
else if( HB_IS_ENUM( pSource ) ) /* enumerators cannot be copied */
|
||||
pDest->type = HB_IT_NIL;
|
||||
|
||||
else if( HB_IS_EXTREF( pSource ) )
|
||||
@@ -1652,7 +1627,7 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
|
||||
void hb_itemCopyToRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyToRef(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyToRef(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_BYREF( pDest ) )
|
||||
{
|
||||
@@ -1685,7 +1660,7 @@ void hb_itemCopyToRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
|
||||
void hb_itemCopyFromRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyFromRef(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyFromRef(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_BYREF( pSource ) )
|
||||
{
|
||||
@@ -1704,7 +1679,7 @@ void hb_itemCopyFromRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
*/
|
||||
void hb_itemMove( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMove(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMove(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( pDest == pSource )
|
||||
hb_errInternal( HB_EI_ITEMBADCOPY, NULL, "hb_itemMove()", NULL );
|
||||
@@ -1723,7 +1698,7 @@ void hb_itemMove( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
|
||||
void hb_itemMoveRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveRef(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveRef(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_BYREF( pSource ) )
|
||||
{
|
||||
@@ -1754,7 +1729,7 @@ void hb_itemMoveRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
|
||||
void hb_itemMoveToRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveToRef(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveToRef(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_BYREF( pDest ) )
|
||||
{
|
||||
@@ -1801,7 +1776,7 @@ void hb_itemMoveToRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
|
||||
void hb_itemMoveFromRef( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveFromRef(%p, %p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemMoveFromRef(%p, %p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_BYREF( pSource ) )
|
||||
{
|
||||
@@ -1821,7 +1796,7 @@ void hb_itemSwap( PHB_ITEM pItem1, PHB_ITEM pItem2 )
|
||||
{
|
||||
HB_ITEM temp;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemSwap(%p, %p)", pItem1, pItem2 ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemSwap(%p, %p)", ( void * ) pItem1, ( void * ) pItem2 ) );
|
||||
|
||||
/*
|
||||
* It's safe to use this version because our GC cannot be
|
||||
@@ -1841,7 +1816,7 @@ void hb_itemSwap( PHB_ITEM pItem1, PHB_ITEM pItem2 )
|
||||
|
||||
PHB_ITEM hb_itemUnRefOnce( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefOnce(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefOnce(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_BYREF( pItem ) )
|
||||
{
|
||||
@@ -1966,7 +1941,7 @@ PHB_ITEM hb_itemUnRefOnce( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRef(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRef(%p)", ( void * ) pItem ) );
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1982,7 +1957,7 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
|
||||
*/
|
||||
PHB_ITEM hb_itemUnRefWrite( PHB_ITEM pItem, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefWrite(%p,%p)", pItem, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefWrite(%p,%p)", ( void * ) pItem, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_EXTREF( pItem ) )
|
||||
{
|
||||
@@ -2023,7 +1998,7 @@ PHB_ITEM hb_itemUnRefRefer( PHB_ITEM pItem )
|
||||
{
|
||||
PHB_ITEM pLast;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefRefer(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnRefRefer(%p)", ( void * ) pItem ) );
|
||||
|
||||
do
|
||||
{
|
||||
@@ -2040,7 +2015,7 @@ PHB_ITEM hb_itemUnRefRefer( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemReSizeString( PHB_ITEM pItem, HB_SIZE nSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReSizeString(%p,%" HB_PFS "u)", pItem, nSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemReSizeString(%p,%" HB_PFS "u)", ( void * ) pItem, nSize ) );
|
||||
|
||||
if( pItem->item.asString.allocated == 0 )
|
||||
{
|
||||
@@ -2073,7 +2048,7 @@ PHB_ITEM hb_itemReSizeString( PHB_ITEM pItem, HB_SIZE nSize )
|
||||
|
||||
PHB_ITEM hb_itemUnShareString( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnShareString(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnShareString(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem->item.asString.allocated == 0 ||
|
||||
hb_xRefCount( pItem->item.asString.value ) > 1 )
|
||||
@@ -2097,7 +2072,7 @@ PHB_ITEM hb_itemUnShareString( PHB_ITEM pItem )
|
||||
|
||||
PHB_ITEM hb_itemUnShare( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnShare(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemUnShare(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_BYREF( pItem ) )
|
||||
pItem = hb_itemUnRef( pItem );
|
||||
@@ -2110,7 +2085,7 @@ PHB_ITEM hb_itemUnShare( PHB_ITEM pItem )
|
||||
|
||||
HB_BOOL hb_itemGetWriteCL( PHB_ITEM pItem, char ** pszValue, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetWriteCL(%p,%p,%p)", pItem, pszValue, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetWriteCL(%p,%p,%p)", ( void * ) pItem, ( void * ) pszValue, ( void * ) pnLen ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -2132,7 +2107,7 @@ HB_BOOL hb_itemGetWriteCL( PHB_ITEM pItem, char ** pszValue, HB_SIZE * pnLen )
|
||||
/* clone the given item */
|
||||
PHB_ITEM hb_itemClone( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemClone(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemClone(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( HB_IS_ARRAY( pItem ) )
|
||||
{
|
||||
@@ -2149,7 +2124,7 @@ PHB_ITEM hb_itemClone( PHB_ITEM pItem )
|
||||
|
||||
void hb_itemCloneTo( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCloneTo(%p,%p)", pDest, pSource ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCloneTo(%p,%p)", ( void * ) pDest, ( void * ) pSource ) );
|
||||
|
||||
if( HB_IS_ARRAY( pSource ) )
|
||||
{
|
||||
@@ -2349,7 +2324,7 @@ int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, HB_BOOL bForceExact )
|
||||
HB_SIZE nMinLen;
|
||||
int iRet = 0; /* Current status */
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStrCmp(%p, %p, %d)", pFirst, pSecond, ( int ) bForceExact ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStrCmp(%p, %p, %d)", ( void * ) pFirst, ( void * ) pSecond, ( int ) bForceExact ) );
|
||||
|
||||
szFirst = pFirst->item.asString.value;
|
||||
szSecond = pSecond->item.asString.value;
|
||||
@@ -2432,7 +2407,7 @@ int hb_itemStrICmp( PHB_ITEM pFirst, PHB_ITEM pSecond, HB_BOOL bForceExact )
|
||||
HB_SIZE nMinLen;
|
||||
int iRet = 0; /* Current status */
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStrICmp(%p, %p, %d)", pFirst, pSecond, ( int ) bForceExact ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStrICmp(%p, %p, %d)", ( void * ) pFirst, ( void * ) pSecond, ( int ) bForceExact ) );
|
||||
|
||||
szFirst = pFirst->item.asString.value;
|
||||
szSecond = pSecond->item.asString.value;
|
||||
@@ -2708,7 +2683,7 @@ HB_BOOL hb_itemStrBuf( char * szResult, PHB_ITEM pNumber, int iSize, int iDec )
|
||||
This function should be used by any function that wants to format numeric
|
||||
data for displaying, printing, or putting in a database.
|
||||
|
||||
Note: The caller is responsible for calling hb_xfree to free the results
|
||||
Note: The caller is responsible for calling hb_xfree() to free the results
|
||||
buffer, but ONLY if the return value is not a NULL pointer! (If a NULL
|
||||
pointer is returned, then there was a conversion error.)
|
||||
*/
|
||||
@@ -2716,7 +2691,7 @@ char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec )
|
||||
{
|
||||
char * szResult = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStr(%p, %p, %p)", pNumber, pWidth, pDec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemStr(%p, %p, %p)", ( void * ) pNumber, ( void * ) pWidth, ( void * ) pDec ) );
|
||||
|
||||
if( pNumber )
|
||||
{
|
||||
@@ -2776,7 +2751,7 @@ char * hb_itemString( PHB_ITEM pItem, HB_SIZE * nLen, HB_BOOL * bFreeReq )
|
||||
{
|
||||
char * buffer;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemString(%p, %p, %p)", pItem, nLen, bFreeReq ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemString(%p, %p, %p)", ( void * ) pItem, ( void * ) nLen, ( void * ) bFreeReq ) );
|
||||
|
||||
switch( HB_ITEM_TYPE( pItem ) )
|
||||
{
|
||||
@@ -2903,7 +2878,7 @@ char * hb_itemString( PHB_ITEM pItem, HB_SIZE * nLen, HB_BOOL * bFreeReq )
|
||||
|
||||
char * hb_itemPadConv( PHB_ITEM pItem, HB_SIZE * pnSize, HB_BOOL * bFreeReq )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPadConv(%p, %p, %p)", pItem, pnSize, bFreeReq ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPadConv(%p, %p, %p)", ( void * ) pItem, ( void * ) pnSize, ( void * ) bFreeReq ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -2954,7 +2929,7 @@ PHB_ITEM hb_itemValToStr( PHB_ITEM pItem )
|
||||
HB_SIZE nLen;
|
||||
HB_BOOL bFreeReq;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemValToStr(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemValToStr(%p)", ( void * ) pItem ) );
|
||||
|
||||
buffer = hb_itemString( pItem, &nLen, &bFreeReq );
|
||||
if( bFreeReq )
|
||||
|
||||
@@ -93,19 +93,19 @@ static int s_macroFlags = HB_SM_DEFAULT;
|
||||
|
||||
#define HB_SM_ISUSERCP() ( HB_CDP_ISCHARUNI( hb_vmCDP() ) ? HB_COMPFLAG_USERCP : 0 )
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* - */
|
||||
|
||||
/* Compile passed string into a pcode buffer
|
||||
*
|
||||
* 'pMacro' - pointer to HB_MACRO structure that will hold all information
|
||||
* nedded for macro compilation and evaluation
|
||||
* needed for macro compilation and evaluation
|
||||
* 'szString' - a string to compile
|
||||
* 'iFlag' - specifies if compiled code should generate pcodes either for push
|
||||
* operation (for example: var :=¯o) or for pop operation (¯o :=var)
|
||||
*/
|
||||
static int hb_macroParse( PHB_MACRO pMacro )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroParse(%p)", pMacro ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroParse(%p)", ( void * ) pMacro ) );
|
||||
|
||||
/* initialize the output (pcode) buffer - it will be filled by yacc */
|
||||
pMacro->pCodeInfo = &pMacro->pCodeInfoBuffer;
|
||||
@@ -134,7 +134,7 @@ static int hb_macroParse( PHB_MACRO pMacro )
|
||||
*/
|
||||
static void hb_macroClear( PHB_MACRO pMacro )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroClear(%p)", pMacro ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroClear(%p)", ( void * ) pMacro ) );
|
||||
|
||||
hb_xfree( pMacro->pCodeInfo->pCode );
|
||||
if( pMacro->pError )
|
||||
@@ -143,7 +143,7 @@ static void hb_macroClear( PHB_MACRO pMacro )
|
||||
|
||||
void hb_macroDelete( PHB_MACRO pMacro )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroDelete(%p)", pMacro ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroDelete(%p)", ( void * ) pMacro ) );
|
||||
|
||||
hb_macroClear( pMacro );
|
||||
hb_xfree( pMacro );
|
||||
@@ -155,7 +155,7 @@ static HB_BOOL hb_macroCheckParam( PHB_ITEM pItem )
|
||||
{
|
||||
HB_BOOL bValid = HB_TRUE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCheckParam(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCheckParam(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( ! HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -199,7 +199,7 @@ static HB_ERROR_HANDLE( hb_macroErrorType )
|
||||
*/
|
||||
void hb_macroRun( PHB_MACRO pMacro )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroRun(%p)", pMacro ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroRun(%p)", ( void * ) pMacro ) );
|
||||
|
||||
hb_vmExecute( pMacro->pCodeInfo->pCode, NULL );
|
||||
}
|
||||
@@ -208,7 +208,7 @@ static void hb_macroSyntaxError( PHB_MACRO pMacro )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroSyntaxError(%p)", pMacro ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroSyntaxError(%p)", ( void * ) pMacro ) );
|
||||
|
||||
if( pMacro && pMacro->pError )
|
||||
{
|
||||
@@ -233,10 +233,10 @@ static void hb_macroSyntaxError( PHB_MACRO pMacro )
|
||||
}
|
||||
}
|
||||
|
||||
/* This replaces all '&var' or '&var.' occurences within a given string
|
||||
/* This replaces all '&var' or '&var.' occurrences within a given string
|
||||
* with the value of variable 'var' if this variable exists and contains
|
||||
* a string value. The value of variable is also searched for
|
||||
* occurences of macro operator and if it is found then it is expanded
|
||||
* occurrences of macro operator and if it is found then it is expanded
|
||||
* until there is no more macro operators.
|
||||
* NOTE:
|
||||
* this does not evaluate a macro expression - there is a simple text
|
||||
@@ -418,7 +418,7 @@ void hb_macroGetValue( PHB_ITEM pItem, int iContext, int flags )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroGetValue(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroGetValue(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -434,7 +434,7 @@ void hb_macroGetValue( PHB_ITEM pItem, int iContext, int flags )
|
||||
struMacro.status = HB_MACRO_CONT;
|
||||
struMacro.length = pItem->item.asString.length;
|
||||
/*
|
||||
* Clipper appears to expand nested macros staticly vs. by
|
||||
* Clipper appears to expand nested macros statically vs. by
|
||||
* Macro Parser, f.e.:
|
||||
* PROCEDURE Main()
|
||||
* LOCAL cText
|
||||
@@ -505,7 +505,7 @@ void hb_macroSetValue( PHB_ITEM pItem, int flags )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroSetValue(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroSetValue(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -549,7 +549,7 @@ void hb_macroPushReference( PHB_ITEM pItem )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushReference(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushReference(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -676,7 +676,7 @@ static void hb_macroUseAliased( PHB_ITEM pAlias, PHB_ITEM pVar, int iFlag, int i
|
||||
*/
|
||||
void hb_macroPopAliasedValue( PHB_ITEM pAlias, PHB_ITEM pVar, int flags )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPopAliasedValue(%p, %p)", pAlias, pVar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPopAliasedValue(%p, %p)", ( void * ) pAlias, ( void * ) pVar ) );
|
||||
|
||||
hb_macroUseAliased( pAlias, pVar, HB_MACRO_GEN_POP, flags );
|
||||
}
|
||||
@@ -688,7 +688,7 @@ void hb_macroPopAliasedValue( PHB_ITEM pAlias, PHB_ITEM pVar, int flags )
|
||||
*/
|
||||
void hb_macroPushAliasedValue( PHB_ITEM pAlias, PHB_ITEM pVar, int flags )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushAliasedValue(%p, %p)", pAlias, pVar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushAliasedValue(%p, %p)", ( void * ) pAlias, ( void * ) pVar ) );
|
||||
|
||||
hb_macroUseAliased( pAlias, pVar, HB_MACRO_GEN_PUSH, flags );
|
||||
}
|
||||
@@ -702,7 +702,7 @@ char * hb_macroExpandString( const char * szString, HB_SIZE nLength, HB_BOOL * p
|
||||
{
|
||||
char * szResultString;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroExpandString(%s,%" HB_PFS "u,%p)", szString, nLength, pfNewString ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroExpandString(%s,%" HB_PFS "u,%p)", szString, nLength, ( void * ) pfNewString ) );
|
||||
|
||||
if( szString )
|
||||
szResultString = hb_macroTextSubst( szString, &nLength );
|
||||
@@ -716,7 +716,7 @@ char * hb_macroTextSymbol( const char * szString, HB_SIZE nLength, HB_BOOL * pfN
|
||||
{
|
||||
char * szResult = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroTextSymbol(%s,%" HB_PFS "u,%p)", szString, nLength, pfNewString ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroTextSymbol(%s,%" HB_PFS "u,%p)", szString, nLength, ( void * ) pfNewString ) );
|
||||
|
||||
if( szString )
|
||||
{
|
||||
@@ -859,7 +859,7 @@ static void hb_macroSetGetBlock( PHB_DYNS pVarSym, PHB_ITEM pItem,
|
||||
bPushPcode = HB_P_MPUSHALIASEDFIELD;
|
||||
bPopPcode = HB_P_MPOPALIASEDFIELD;
|
||||
}
|
||||
else if( !fMemVar )
|
||||
else if( ! fMemVar )
|
||||
{
|
||||
bPushPcode = HB_P_MPUSHFIELD;
|
||||
bPopPcode = HB_P_MPOPFIELD;
|
||||
@@ -1017,7 +1017,7 @@ HB_FUNC( FIELDWBLOCK )
|
||||
void hb_macroPushSymbol( PHB_ITEM pItem )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushSymbol(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroPushSymbol(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -1059,7 +1059,7 @@ void hb_macroPushSymbol( PHB_ITEM pItem )
|
||||
*/
|
||||
void hb_macroTextValue( PHB_ITEM pItem )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroTextValue(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroTextValue(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -1087,7 +1087,7 @@ const char * hb_macroGetType( PHB_ITEM pItem )
|
||||
HB_STACK_TLS_PRELOAD
|
||||
const char * szType;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroGetType(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroGetType(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( hb_macroCheckParam( pItem ) )
|
||||
{
|
||||
@@ -1134,7 +1134,7 @@ const char * hb_macroGetType( PHB_ITEM pItem )
|
||||
|
||||
/* Set our temporary error handler. We do not need any error
|
||||
* messages here - we need to know only if evaluation was
|
||||
* successfull. If evaluation was successfull then the data type
|
||||
* successful. If evaluation was successful then the data type
|
||||
* of expression can be determined.
|
||||
*/
|
||||
struErr.Func = hb_macroErrorType;
|
||||
@@ -1145,7 +1145,7 @@ const char * hb_macroGetType( PHB_ITEM pItem )
|
||||
|
||||
if( struMacro.status & HB_MACRO_CONT )
|
||||
{
|
||||
/* Evaluation was successfull
|
||||
/* Evaluation was successful
|
||||
* Now the value of expression is placed on the eval stack -
|
||||
* check its type and pop it from the stack
|
||||
*/
|
||||
@@ -1238,7 +1238,7 @@ HB_FUNC( HB_SETMACRO )
|
||||
hb_ret(); /* return NIL */
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* - */
|
||||
|
||||
/* returns the order + 1 of a variable if defined or zero */
|
||||
int hb_macroLocalVarGetPos( const char * szVarName, HB_COMP_DECL )
|
||||
@@ -1577,7 +1577,7 @@ void hb_macroGenPopAliasedVar( const char * szVarName,
|
||||
}
|
||||
}
|
||||
|
||||
/* generates the pcode to push a nonaliased variable value to the virtual
|
||||
/* generates the pcode to push a non-aliased variable value to the virtual
|
||||
* machine stack
|
||||
*/
|
||||
void hb_macroGenPushVar( const char * szVarName, HB_COMP_DECL )
|
||||
@@ -1788,7 +1788,7 @@ void hb_macroGenPCodeN( const HB_BYTE * pBuffer, HB_SIZE nSize, HB_COMP_DECL )
|
||||
pFunc->nPCodePos += nSize;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* - */
|
||||
|
||||
void hb_macroError( int iError, HB_COMP_DECL )
|
||||
{
|
||||
@@ -1796,14 +1796,12 @@ void hb_macroError( int iError, HB_COMP_DECL )
|
||||
HB_MACRO_DATA->status &= ~HB_MACRO_CONT; /* clear CONT bit */
|
||||
}
|
||||
|
||||
/*
|
||||
* Start a new pcode buffer for a codeblock
|
||||
*/
|
||||
/* Start a new pcode buffer for a codeblock */
|
||||
void hb_macroCodeBlockStart( HB_COMP_DECL )
|
||||
{
|
||||
PHB_PCODE_INFO pCB;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCodeBlockStart(%p)", HB_COMP_PARAM ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCodeBlockStart(%p)", ( void * ) HB_COMP_PARAM ) );
|
||||
|
||||
pCB = ( PHB_PCODE_INFO ) hb_xgrab( sizeof( HB_PCODE_INFO ) );
|
||||
|
||||
@@ -1826,7 +1824,7 @@ void hb_macroCodeBlockEnd( HB_COMP_DECL )
|
||||
HB_USHORT usParms = 0; /* number of codeblock parameters */
|
||||
PHB_CBVAR pVar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCodeBlockEnd(%p)", HB_COMP_PARAM ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_macroCodeBlockEnd(%p)", ( void * ) HB_COMP_PARAM ) );
|
||||
|
||||
/* a currently processed codeblock */
|
||||
pCodeblock = HB_PCODE_DATA;
|
||||
|
||||
@@ -56,5 +56,5 @@
|
||||
#elif defined( HB_MAIN_WIN )
|
||||
#include "mainwin.c"
|
||||
#else
|
||||
#include "mainstd.c" /* Use the standard ANSI C entry point if not speficied */
|
||||
#include "mainstd.c" /* Use the standard ANSI C entry point if not specified */
|
||||
#endif
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -2,14 +2,7 @@
|
||||
* Windows pcode DLL entry point and VM/RTL routing functions
|
||||
*
|
||||
* Copyright 2001 Antonio Linares <alinares@fivetech.com>
|
||||
*
|
||||
* Copyright 2010 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* rewritten
|
||||
*
|
||||
* 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:
|
||||
* Copyright 2010 Przemyslaw Czerpak <druzus / at / priv.onet.pl> (rewritten)
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Std applications entry point
|
||||
* Standard application entry point
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
*
|
||||
@@ -60,7 +60,7 @@ int _crt0_startup_flags = _CRT0_FLAG_USE_DOS_SLASHES;
|
||||
|
||||
char ** __crt0_glob_function( char * _arg )
|
||||
{
|
||||
/* This function disables command line wildcard expansion. */
|
||||
/* This function disables command-line wildcard expansion. */
|
||||
HB_SYMBOL_UNUSED( _arg );
|
||||
|
||||
return 0;
|
||||
@@ -76,7 +76,7 @@ HB_EXTERN_END
|
||||
|
||||
int main( int argc, char * argv[] )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "main(%d, %p)", argc, argv ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "main(%d, %p)", argc, ( void * ) argv ) );
|
||||
|
||||
#if defined( __DJGPP__ )
|
||||
__system_flags =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Windows applications entry point
|
||||
* Windows application entry point
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
*
|
||||
|
||||
152
src/vm/memvars.c
152
src/vm/memvars.c
@@ -2,6 +2,9 @@
|
||||
* Memvar (PRIVATE/PUBLIC) runtime support
|
||||
*
|
||||
* Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* __mvSave(), __mvRestore() (Thanks to Dave Pearson and Jo French for
|
||||
* the original Clipper function FReadMem() to read .mem files)
|
||||
*
|
||||
* 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
|
||||
@@ -44,18 +47,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* __mvSave()
|
||||
* __mvRestore() (Thanks to Dave Pearson and Jo French for the original
|
||||
* Clipper function (FReadMem()) to read .mem files)
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmopt.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -69,10 +60,8 @@
|
||||
#include "hbstack.h"
|
||||
|
||||
#if ! defined( HB_MT_VM )
|
||||
|
||||
# define hb_dynsymGetMemvar( p ) ( ( PHB_ITEM ) ( p )->pMemvar )
|
||||
# define hb_dynsymSetMemvar( p, h ) do { ( p )->pMemvar = ( h ); } while( 0 )
|
||||
|
||||
#endif
|
||||
|
||||
#define TABLE_INITHB_VALUE 100
|
||||
@@ -113,7 +102,7 @@ static PHB_ITEM hb_memvarValueNew( void )
|
||||
#undef hb_memvarValueIncRef
|
||||
void hb_memvarValueIncRef( PHB_ITEM pMemvar )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarValueIncRef(%p)", pMemvar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarValueIncRef(%p)", ( void * ) pMemvar ) );
|
||||
|
||||
hb_xRefInc( pMemvar );
|
||||
}
|
||||
@@ -124,7 +113,7 @@ void hb_memvarValueIncRef( PHB_ITEM pMemvar )
|
||||
*/
|
||||
void hb_memvarValueDecRef( PHB_ITEM pMemvar )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarValueDecRef(%p)", pMemvar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarValueDecRef(%p)", ( void * ) pMemvar ) );
|
||||
|
||||
if( hb_xRefDec( pMemvar ) )
|
||||
{
|
||||
@@ -141,7 +130,7 @@ static void hb_memvarDetachDynSym( PHB_DYNS pDynSym, PHB_ITEM pPrevMemvar )
|
||||
{
|
||||
PHB_ITEM pMemvar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDetachDynSym(%p,%p)", pDynSym, pPrevMemvar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDetachDynSym(%p,%p)", ( void * ) pDynSym, ( void * ) pPrevMemvar ) );
|
||||
|
||||
pMemvar = hb_dynsymGetMemvar( pDynSym );
|
||||
hb_dynsymSetMemvar( pDynSym, pPrevMemvar );
|
||||
@@ -154,7 +143,7 @@ static void hb_memvarDetachDynSym( PHB_DYNS pDynSym, PHB_ITEM pPrevMemvar )
|
||||
*/
|
||||
PHB_ITEM hb_memvarDetachLocal( PHB_ITEM pLocal )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDetachLocal(%p)", pLocal ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDetachLocal(%p)", ( void * ) pLocal ) );
|
||||
|
||||
if( HB_IS_BYREF( pLocal ) )
|
||||
{
|
||||
@@ -220,7 +209,7 @@ static void hb_memvarAddPrivate( PHB_DYNS pDynSym, PHB_ITEM pValue )
|
||||
PHB_PRIVATE_STACK pPrivateStack;
|
||||
PHB_ITEM pMemvar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarAddPrivate(%p,%p)", pDynSym, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarAddPrivate(%p,%p)", ( void * ) pDynSym, ( void * ) pValue ) );
|
||||
|
||||
pPrivateStack = hb_stackGetPrivateStack();
|
||||
|
||||
@@ -330,7 +319,7 @@ void hb_memvarSetPrivatesBase( HB_SIZE nBase )
|
||||
}
|
||||
|
||||
/*
|
||||
* Update PRIVATE base ofsset so they will not be removed
|
||||
* Update PRIVATE base offset so they will not be removed
|
||||
* when function return
|
||||
*/
|
||||
void hb_memvarUpdatePrivatesBase( void )
|
||||
@@ -366,7 +355,7 @@ void hb_memvarSetValue( PHB_SYMB pMemvarSymb, PHB_ITEM pItem )
|
||||
{
|
||||
PHB_DYNS pDyn;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarSetValue(%p, %p)", pMemvarSymb, pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarSetValue(%p, %p)", ( void * ) pMemvarSymb, ( void * ) pItem ) );
|
||||
|
||||
pDyn = pMemvarSymb->pDynSym;
|
||||
if( pDyn )
|
||||
@@ -375,7 +364,7 @@ void hb_memvarSetValue( PHB_SYMB pMemvarSymb, PHB_ITEM pItem )
|
||||
|
||||
pMemvar = hb_dynsymGetMemvar( pDyn );
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) assigned", pMemvar, pMemvarSymb->szName ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) assigned", ( void * ) pMemvar, pMemvarSymb->szName ) );
|
||||
|
||||
if( pMemvar )
|
||||
{
|
||||
@@ -399,7 +388,7 @@ HB_ERRCODE hb_memvarGet( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
PHB_DYNS pDyn;
|
||||
HB_ERRCODE errCode = HB_FAILURE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGet(%p, %p)", pItem, pMemvarSymb ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGet(%p, %p)", ( void * ) pItem, ( void * ) pMemvarSymb ) );
|
||||
|
||||
pDyn = pMemvarSymb->pDynSym;
|
||||
if( pDyn )
|
||||
@@ -408,7 +397,7 @@ HB_ERRCODE hb_memvarGet( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
|
||||
pMemvar = hb_dynsymGetMemvar( pDyn );
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) queried", pMemvar, pMemvarSymb->szName ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) queried", ( void * ) pMemvar, pMemvarSymb->szName ) );
|
||||
|
||||
if( pMemvar )
|
||||
{
|
||||
@@ -429,7 +418,7 @@ HB_ERRCODE hb_memvarGet( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
|
||||
void hb_memvarGetValue( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetValue(%p, %p)", pItem, pMemvarSymb ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetValue(%p, %p)", ( void * ) pItem, ( void * ) pMemvarSymb ) );
|
||||
|
||||
if( hb_memvarGet( pItem, pMemvarSymb ) == HB_FAILURE )
|
||||
{
|
||||
@@ -456,7 +445,7 @@ void hb_memvarGetRefer( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
{
|
||||
PHB_DYNS pDyn;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetRefer(%p, %p)", pItem, pMemvarSymb ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetRefer(%p, %p)", ( void * ) pItem, ( void * ) pMemvarSymb ) );
|
||||
|
||||
pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
|
||||
if( pDyn )
|
||||
@@ -465,7 +454,7 @@ void hb_memvarGetRefer( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
|
||||
pMemvar = hb_dynsymGetMemvar( pDyn );
|
||||
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) referenced", pMemvar, pMemvarSymb->szName ) );
|
||||
HB_TRACE( HB_TR_INFO, ( "Memvar item (%p)(%s) referenced", ( void * ) pMemvar, pMemvarSymb->szName ) );
|
||||
|
||||
if( pMemvar )
|
||||
{
|
||||
@@ -516,7 +505,7 @@ void hb_memvarGetRefer( PHB_ITEM pItem, PHB_SYMB pMemvarSymb )
|
||||
|
||||
PHB_ITEM hb_memvarGetItem( PHB_SYMB pMemvarSymb )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetItem(%p)", pMemvarSymb ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetItem(%p)", ( void * ) pMemvarSymb ) );
|
||||
|
||||
if( pMemvarSymb->pDynSym )
|
||||
{
|
||||
@@ -537,7 +526,7 @@ PHB_ITEM hb_memvarGetItem( PHB_SYMB pMemvarSymb )
|
||||
*/
|
||||
void hb_memvarNewParameter( PHB_SYMB pSymbol, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarNewParameter(%p, %p)", pSymbol, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarNewParameter(%p, %p)", ( void * ) pSymbol, ( void * ) pValue ) );
|
||||
|
||||
hb_memvarCreateFromDynSymbol( pSymbol->pDynSym, HB_VSCOMP_PRIVATE, pValue );
|
||||
}
|
||||
@@ -546,7 +535,7 @@ static PHB_DYNS hb_memvarFindSymbol( const char * szArg, HB_SIZE nLen )
|
||||
{
|
||||
PHB_DYNS pDynSym = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarFindSymbol(%p,%" HB_PFS "u)", szArg, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarFindSymbol(%p,%" HB_PFS "u)", ( const void * ) szArg, nLen ) );
|
||||
|
||||
if( nLen && szArg && *szArg )
|
||||
{
|
||||
@@ -585,7 +574,7 @@ char * hb_memvarGetStrValuePtr( char * szVarName, HB_SIZE * pnLen )
|
||||
PHB_DYNS pDynVar;
|
||||
char * szValue = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetStrValuePtr(%s, %p)", szVarName, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarGetStrValuePtr(%s, %p)", ( void * ) szVarName, ( void * ) pnLen ) );
|
||||
|
||||
pDynVar = hb_memvarFindSymbol( szVarName, *pnLen );
|
||||
|
||||
@@ -619,7 +608,7 @@ char * hb_memvarGetStrValuePtr( char * szVarName, HB_SIZE * pnLen )
|
||||
*
|
||||
* pMemvar - an item that stores the name of variable - it can be either
|
||||
* the HB_IT_SYMBOL (if created by PUBLIC statement) or HB_IT_STRING
|
||||
* (if created by direct call to __MVPUBLIC function)
|
||||
* (if created by direct call to __mvPublic() function)
|
||||
* iScope - the scope of created variable - if a variable with the same name
|
||||
* exists already then it's value is hidden by new variable with
|
||||
* passed scope
|
||||
@@ -631,12 +620,15 @@ void hb_memvarCreateFromItem( PHB_ITEM pMemvar, int iScope, PHB_ITEM pValue )
|
||||
{
|
||||
PHB_DYNS pDynVar = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarCreateFromItem(%p, %d, %p)", pMemvar, iScope, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarCreateFromItem(%p, %d, %p)", ( void * ) pMemvar, iScope, ( void * ) pValue ) );
|
||||
|
||||
/* find dynamic symbol or creeate one */
|
||||
/* find dynamic symbol or create one */
|
||||
if( HB_IS_SYMBOL( pMemvar ) )
|
||||
/* pDynVar = hb_dynsymGet( pMemvar->item.asSymbol.value->szName ); */
|
||||
#if 0
|
||||
pDynVar = hb_dynsymGet( pMemvar->item.asSymbol.value->szName );
|
||||
#else
|
||||
pDynVar = pMemvar->item.asSymbol.value->pDynSym;
|
||||
#endif
|
||||
else if( HB_IS_STRING( pMemvar ) )
|
||||
pDynVar = hb_dynsymGet( pMemvar->item.asString.value );
|
||||
|
||||
@@ -648,7 +640,7 @@ void hb_memvarCreateFromItem( PHB_ITEM pMemvar, int iScope, PHB_ITEM pValue )
|
||||
|
||||
static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, int iScope, PHB_ITEM pValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarCreateFromDynSymbol(%p, %d, %p)", pDynVar, iScope, pValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarCreateFromDynSymbol(%p, %d, %p)", ( void * ) pDynVar, iScope, ( void * ) pValue ) );
|
||||
|
||||
if( iScope & HB_VSCOMP_PUBLIC )
|
||||
{
|
||||
@@ -696,7 +688,7 @@ static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, int iScope, PHB_ITEM
|
||||
*/
|
||||
static void hb_memvarRelease( PHB_ITEM pMemvar )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarRelease(%p)", pMemvar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarRelease(%p)", ( void * ) pMemvar ) );
|
||||
|
||||
if( HB_IS_STRING( pMemvar ) )
|
||||
{
|
||||
@@ -715,7 +707,7 @@ static void hb_memvarRelease( PHB_ITEM pMemvar )
|
||||
{
|
||||
if( pDynSymbol == hb_stackGetPrivateStack()->stack[ --nBase ].pDynSym )
|
||||
{
|
||||
/* reset current value to NIL - the overriden variables will be
|
||||
/* reset current value to NIL - the overridden variables will be
|
||||
* visible after exit from current procedure
|
||||
*/
|
||||
pMemvar = hb_dynsymGetMemvar( pDynSymbol );
|
||||
@@ -744,8 +736,6 @@ static void hb_memvarReleaseWithMask( const char * szMask, HB_BOOL bInclude )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
HB_SIZE nBase, nCount;
|
||||
PHB_DYNS pDynVar;
|
||||
PHB_ITEM pMemvar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarReleaseWithMask(%s, %d)", szMask, ( int ) bInclude ) );
|
||||
|
||||
@@ -753,8 +743,11 @@ static void hb_memvarReleaseWithMask( const char * szMask, HB_BOOL bInclude )
|
||||
nBase = hb_stackBaseItem()->item.asSymbol.stackstate->nPrivateBase;
|
||||
while( nCount-- > nBase )
|
||||
{
|
||||
PHB_DYNS pDynVar;
|
||||
PHB_ITEM pMemvar;
|
||||
|
||||
pDynVar = hb_stackGetPrivateStack()->stack[ nCount ].pDynSym;
|
||||
/* reset current value to NIL - the overriden variables will be
|
||||
/* reset current value to NIL - the overridden variables will be
|
||||
* visible after exit from current procedure
|
||||
*/
|
||||
pMemvar = hb_dynsymGetMemvar( pDynVar );
|
||||
@@ -771,7 +764,7 @@ static void hb_memvarReleaseWithMask( const char * szMask, HB_BOOL bInclude )
|
||||
*/
|
||||
static int hb_memvarScopeGet( PHB_DYNS pDynVar )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarScopeGet(%p)", pDynVar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarScopeGet(%p)", ( void * ) pDynVar ) );
|
||||
|
||||
if( hb_dynsymGetMemvar( pDynVar ) == 0 )
|
||||
return HB_MV_UNKNOWN;
|
||||
@@ -935,7 +928,7 @@ static PHB_ITEM hb_memvarDebugVariable( int iScope, int iPos, const char ** pszN
|
||||
|
||||
*pszName = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDebugVariable(%d, %d, %p)", iScope, iPos, pszName ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_memvarDebugVariable(%d, %d, %p)", iScope, iPos, ( const void * ) pszName ) );
|
||||
|
||||
if( iPos > 0 )
|
||||
{
|
||||
@@ -992,8 +985,7 @@ PHB_ITEM hb_memvarSaveInArray( int iScope, HB_BOOL fCopy )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
struct mv_memvarArray_info MVInfo;
|
||||
PHB_ITEM pArray, pItem, pMemvar;
|
||||
PHB_DYNS pDynSymbol;
|
||||
PHB_ITEM pArray;
|
||||
|
||||
pArray = NULL;
|
||||
|
||||
@@ -1017,23 +1009,26 @@ PHB_ITEM hb_memvarSaveInArray( int iScope, HB_BOOL fCopy )
|
||||
pArray = hb_itemArrayNew( MVInfo.nCount );
|
||||
do
|
||||
{
|
||||
pItem = hb_arrayGetItemPtr( pArray, MVInfo.nCount );
|
||||
pDynSymbol = MVInfo.pDyns[ --MVInfo.nCount ];
|
||||
pMemvar = hb_dynsymGetMemvar( pDynSymbol ),
|
||||
PHB_ITEM pItem = hb_arrayGetItemPtr( pArray, MVInfo.nCount );
|
||||
if( pItem )
|
||||
{
|
||||
PHB_DYNS pDynSymbol = MVInfo.pDyns[ --MVInfo.nCount ];
|
||||
PHB_ITEM pMemvar = hb_dynsymGetMemvar( pDynSymbol );
|
||||
|
||||
hb_arrayNew( pItem, 2 );
|
||||
hb_arraySetSymbol( pItem, 1, pDynSymbol->pSymbol );
|
||||
pItem = hb_arrayGetItemPtr( pItem, 2 );
|
||||
if( fCopy )
|
||||
{
|
||||
hb_itemCopy( pItem, pMemvar );
|
||||
hb_memvarDetachLocal( pItem );
|
||||
}
|
||||
else
|
||||
{
|
||||
pItem->type = HB_IT_BYREF | HB_IT_MEMVAR;
|
||||
pItem->item.asMemvar.value = pMemvar;
|
||||
hb_xRefInc( pMemvar );
|
||||
hb_arrayNew( pItem, 2 );
|
||||
hb_arraySetSymbol( pItem, 1, pDynSymbol->pSymbol );
|
||||
pItem = hb_arrayGetItemPtr( pItem, 2 );
|
||||
if( fCopy )
|
||||
{
|
||||
hb_itemCopy( pItem, pMemvar );
|
||||
hb_memvarDetachLocal( pItem );
|
||||
}
|
||||
else
|
||||
{
|
||||
pItem->type = HB_IT_BYREF | HB_IT_MEMVAR;
|
||||
pItem->item.asMemvar.value = pMemvar;
|
||||
hb_xRefInc( pMemvar );
|
||||
}
|
||||
}
|
||||
}
|
||||
while( MVInfo.nCount );
|
||||
@@ -1061,7 +1056,7 @@ void hb_memvarRestoreFromArray( PHB_ITEM pArray )
|
||||
}
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* - */
|
||||
|
||||
static const char * hb_memvarGetMask( int iParam )
|
||||
{
|
||||
@@ -1311,7 +1306,7 @@ HB_FUNC( __MVPUT )
|
||||
pName->item.asString.length );
|
||||
if( pDynVar )
|
||||
{
|
||||
/* variable was declared somwhere - assign a new value
|
||||
/* variable was declared somewhere - assign a new value
|
||||
*/
|
||||
hb_memvarSetValue( pDynVar->pSymbol, pValue );
|
||||
}
|
||||
@@ -1385,7 +1380,7 @@ static HB_DYNS_FUNC( hb_memvarSave )
|
||||
HB_SIZE nLen = hb_itemGetCLen( pMemvar ) + 1;
|
||||
int iOverFlow = 0;
|
||||
|
||||
/* Clipper supports only 64KB strings */
|
||||
/* Clipper supports only 64 KiB strings */
|
||||
if( nLen > USHRT_MAX )
|
||||
{
|
||||
nLen = USHRT_MAX;
|
||||
@@ -1561,7 +1556,6 @@ HB_FUNC( __MVRESTORE )
|
||||
HB_BOOL bIncludeMask;
|
||||
HB_BYTE buffer[ HB_MEM_REC_LEN ];
|
||||
const char * pszMask;
|
||||
char *szName;
|
||||
PHB_ITEM pItem = NULL;
|
||||
|
||||
#ifdef HB_CLP_STRICT
|
||||
@@ -1569,11 +1563,13 @@ HB_FUNC( __MVRESTORE )
|
||||
bIncludeMask = HB_TRUE;
|
||||
#else
|
||||
pszMask = hb_memvarGetMask( 3 );
|
||||
bIncludeMask = hb_parldef( 4, 1 );
|
||||
bIncludeMask = hb_parldef( 4, HB_TRUE );
|
||||
#endif
|
||||
|
||||
while( hb_fileRead( fhnd, buffer, HB_MEM_REC_LEN, -1 ) == HB_MEM_REC_LEN )
|
||||
{
|
||||
char * pszName;
|
||||
|
||||
/* FoxPro does not add 128 to item type: 'N', 'C', 'D', 'L'
|
||||
* CA-Cl*pper respects it and read such files so we also should.
|
||||
*/
|
||||
@@ -1583,7 +1579,7 @@ HB_FUNC( __MVRESTORE )
|
||||
|
||||
/* protect against corrupted files */
|
||||
buffer[ 10 ] = '\0';
|
||||
szName = ( char * ) buffer;
|
||||
pszName = ( char * ) buffer;
|
||||
|
||||
switch( uiType )
|
||||
{
|
||||
@@ -1599,7 +1595,7 @@ HB_FUNC( __MVRESTORE )
|
||||
else
|
||||
{
|
||||
hb_xfree( pbyString );
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1612,7 +1608,7 @@ HB_FUNC( __MVRESTORE )
|
||||
if( hb_fileRead( fhnd, pbyNumber, HB_MEM_NUM_LEN, -1 ) == HB_MEM_NUM_LEN )
|
||||
pItem = hb_itemPutNLen( pItem, HB_GET_LE_DOUBLE( pbyNumber ), uiWidth - ( uiDec ? ( uiDec + 1 ) : 0 ), uiDec );
|
||||
else
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1624,7 +1620,7 @@ HB_FUNC( __MVRESTORE )
|
||||
if( hb_fileRead( fhnd, pbyNumber, HB_MEM_NUM_LEN, -1 ) == HB_MEM_NUM_LEN )
|
||||
pItem = hb_itemPutDL( pItem, ( long ) HB_GET_LE_DOUBLE( pbyNumber ) );
|
||||
else
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1636,7 +1632,7 @@ HB_FUNC( __MVRESTORE )
|
||||
if( hb_fileRead( fhnd, pbyNumber, HB_MEM_NUM_LEN, -1 ) == HB_MEM_NUM_LEN )
|
||||
pItem = hb_itemPutTD( pItem, HB_GET_LE_DOUBLE( pbyNumber ) );
|
||||
else
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1648,31 +1644,31 @@ HB_FUNC( __MVRESTORE )
|
||||
if( hb_fileRead( fhnd, pbyLogical, 1, -1 ) == 1 )
|
||||
pItem = hb_itemPutL( pItem, pbyLogical[ 0 ] != 0 );
|
||||
else
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
szName = NULL;
|
||||
pszName = NULL;
|
||||
}
|
||||
|
||||
if( szName )
|
||||
if( pszName )
|
||||
{
|
||||
HB_BOOL bMatch = hb_strMatchCaseWildExact( szName, pszMask );
|
||||
HB_BOOL bMatch = hb_strMatchCaseWildExact( pszName, pszMask );
|
||||
|
||||
/* Process it if it matches the passed mask */
|
||||
if( bIncludeMask ? bMatch : ! bMatch )
|
||||
{
|
||||
/* the first parameter is a string with not empty variable name */
|
||||
PHB_DYNS pDynVar = hb_memvarFindSymbol( szName, strlen( szName ) );
|
||||
PHB_DYNS pDynVar = hb_memvarFindSymbol( pszName, strlen( pszName ) );
|
||||
|
||||
if( pDynVar )
|
||||
/* variable was declared somwhere - assign a new value */
|
||||
/* variable was declared somewhere - assign a new value */
|
||||
hb_memvarSetValue( pDynVar->pSymbol, pItem );
|
||||
else
|
||||
/* attempt to assign a value to undeclared variable create the PRIVATE one */
|
||||
hb_memvarCreateFromDynSymbol( hb_dynsymGet( szName ), HB_VSCOMP_PRIVATE, pItem );
|
||||
hb_memvarCreateFromDynSymbol( hb_dynsymGet( pszName ), HB_VSCOMP_PRIVATE, pItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
* ProcName(), ProcLine() and ProcFile() functions
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (ProcFile())
|
||||
* Copyright 2001 JFL (Mafact) <jfl@mafact.com>
|
||||
* Adding the MethodName() just calling ProcName()
|
||||
* Special treatment in case of Object and Eval (only for method mame)
|
||||
* skipping block and adding (b) before the method name
|
||||
*
|
||||
* 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
|
||||
@@ -44,21 +49,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* ProcFile()
|
||||
*
|
||||
* Copyright 2001 JFL (Mafact) <jfl@mafact.com>
|
||||
* Adding the MethodName() just calling ProcName()
|
||||
* Special treatment in case of Object and Eval (only for methodname)
|
||||
* skipping block and adding (b) before the method name
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmint.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapicls.h"
|
||||
@@ -211,7 +201,7 @@ char * hb_procname( int iLevel, char * szName, HB_BOOL fMethodName )
|
||||
|
||||
/* NOTE: szName size must be an at least:
|
||||
* HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 5
|
||||
* szFile szie must be an at least:
|
||||
* szFile size must be an at least:
|
||||
* HB_PATH_MAX
|
||||
*/
|
||||
HB_BOOL hb_procinfo( int iLevel, char * szName, HB_USHORT * puiLine, char * szFile )
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdefs.h"
|
||||
|
||||
/* NOTE: This function is a new Harbour function implemented in the
|
||||
original CA-Cl*pper namespace. It should have been marked as
|
||||
HB_EXTENSION, but it's not, because it's commonly used extension
|
||||
in other xbase dialects, like Xbase++ and FlagShip.
|
||||
in other xBase dialects, like Xbase++ and FlagShip.
|
||||
Nevertheless this function must be kept in a separate
|
||||
source file to avoid linking errors when a 3rd party
|
||||
library or user code would also define this function.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* Harbour Portable Object (.hrb) file runner
|
||||
*
|
||||
* Copyright 1999 Eddie Runia <eddie@runia.com>
|
||||
* Copyright 2002 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* (hb_hrbLoad(), hb_hrbDo(), hb_hrbUnload(), hb_hrbGetFunSym())
|
||||
*
|
||||
* 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
|
||||
@@ -44,19 +46,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 2002 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* hb_hrbLoad()
|
||||
* hb_hrbDo()
|
||||
* hb_hrbUnload()
|
||||
* hb_hrbGetFunSym()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbvmint.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbstack.h"
|
||||
@@ -71,20 +60,20 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * szName; /* Name of the function */
|
||||
HB_PCODEFUNC pcodeFunc; /* Dynamic function info */
|
||||
HB_BYTE * pCode; /* P-code */
|
||||
char * szName; /* Name of the function */
|
||||
HB_PCODEFUNC pcodeFunc; /* Dynamic function info */
|
||||
HB_BYTE * pCode; /* P-code */
|
||||
} HB_DYNF, * PHB_DYNF;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HB_ULONG ulSymbols; /* Number of symbols */
|
||||
HB_ULONG ulFuncs; /* Number of functions */
|
||||
HB_ULONG ulSymbols; /* Number of symbols */
|
||||
HB_ULONG ulFuncs; /* Number of functions */
|
||||
HB_BOOL fInit; /* should be INIT functions executed */
|
||||
HB_BOOL fExit; /* should be EXIT functions executed */
|
||||
HB_LONG lSymStart; /* Startup Symbol */
|
||||
PHB_SYMB pSymRead; /* Symbols read */
|
||||
PHB_DYNF pDynFunc; /* Functions read */
|
||||
HB_LONG lSymStart; /* Startup Symbol */
|
||||
PHB_SYMB pSymRead; /* Symbols read */
|
||||
PHB_DYNF pDynFunc; /* Functions read */
|
||||
PHB_SYMBOLS pModuleSymbols;
|
||||
} HRB_BODY, * PHRB_BODY;
|
||||
|
||||
@@ -92,10 +81,10 @@ static const char s_szHead[ 4 ] = { '\xC0', 'H', 'R', 'B' };
|
||||
|
||||
|
||||
#define SYM_NOLINK 0 /* symbol does not have to be linked */
|
||||
#define SYM_FUNC 1 /* function defined in this module */
|
||||
#define SYM_EXTERN 2 /* function defined in other module */
|
||||
#define SYM_DEFERRED 3 /* lately bound function */
|
||||
#define SYM_NOT_FOUND 0xFFFFFFFFUL /* Symbol not found. */
|
||||
#define SYM_FUNC 1 /* function defined in this module */
|
||||
#define SYM_EXTERN 2 /* function defined in other module */
|
||||
#define SYM_DEFERRED 3 /* lately bound function */
|
||||
#define SYM_NOT_FOUND 0xFFFFFFFFUL /* Symbol not found. */
|
||||
|
||||
static HB_SIZE hb_hrbCheckSig( const char * szBody, HB_SIZE nBodySize )
|
||||
{
|
||||
@@ -109,7 +98,7 @@ static int hb_hrbReadHead( const char * szBody, HB_SIZE nBodySize, HB_SIZE * pnB
|
||||
const char * pVersion;
|
||||
HB_SIZE nSigSize;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadHead(%p,%" HB_PFS "u,%p)", szBody, nBodySize, pnBodyOffset ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadHead(%p,%" HB_PFS "u,%p)", ( const void * ) szBody, nBodySize, ( void * ) pnBodyOffset ) );
|
||||
|
||||
nSigSize = hb_hrbCheckSig( szBody, nBodySize );
|
||||
|
||||
@@ -124,7 +113,7 @@ static int hb_hrbReadHead( const char * szBody, HB_SIZE nBodySize, HB_SIZE * pnB
|
||||
|
||||
static HB_BOOL hb_hrbReadValue( const char * szBody, HB_SIZE nBodySize, HB_SIZE * pnBodyOffset, HB_ULONG * pulValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadValue(%p,%" HB_PFS "u,%p,%p)", szBody, nBodySize, pnBodyOffset, pulValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadValue(%p,%" HB_PFS "u,%p,%p)", ( const void * ) szBody, nBodySize, ( void * ) pnBodyOffset, ( void * ) pulValue ) );
|
||||
|
||||
if( *pnBodyOffset + 4 < nBodySize )
|
||||
{
|
||||
@@ -144,7 +133,7 @@ static char * hb_hrbReadId( const char * szBody, HB_SIZE nBodySize, HB_SIZE * pn
|
||||
{
|
||||
const char * szIdx;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadId(%p,%" HB_PFS "u,%p)", szBody, nBodySize, pnBodyOffset ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbReadId(%p,%" HB_PFS "u,%p)", ( const void * ) szBody, nBodySize, ( void * ) pnBodyOffset ) );
|
||||
|
||||
szIdx = &szBody[ *pnBodyOffset ];
|
||||
|
||||
@@ -162,7 +151,7 @@ static HB_ULONG hb_hrbFindSymbol( const char * szName, PHB_DYNF pDynFunc, HB_ULO
|
||||
{
|
||||
HB_ULONG ulRet;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbFindSymbol(%s, %p, %lu)", szName, pDynFunc, ulLoaded ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_hrbFindSymbol(%s, %p, %lu)", szName, ( void * ) pDynFunc, ulLoaded ) );
|
||||
|
||||
for( ulRet = 0; ulRet < ulLoaded; ++ulRet )
|
||||
{
|
||||
@@ -210,15 +199,14 @@ static void hb_hrbInit( PHRB_BODY pHrbBody, int iPCount, PHB_ITEM * pParams )
|
||||
{
|
||||
if( hb_vmRequestReenter() )
|
||||
{
|
||||
HB_ULONG ul;
|
||||
HB_BOOL fRepeat, fClipInit = HB_TRUE;
|
||||
int i;
|
||||
|
||||
pHrbBody->fInit = HB_FALSE;
|
||||
pHrbBody->fExit = HB_TRUE;
|
||||
|
||||
do
|
||||
{
|
||||
HB_ULONG ul;
|
||||
fRepeat = HB_FALSE;
|
||||
ul = pHrbBody->ulSymbols;
|
||||
while( ul-- )
|
||||
@@ -229,6 +217,7 @@ static void hb_hrbInit( PHRB_BODY pHrbBody, int iPCount, PHB_ITEM * pParams )
|
||||
if( strcmp( pHrbBody->pSymRead[ ul ].szName, "CLIPINIT$" ) ?
|
||||
! fClipInit : fClipInit )
|
||||
{
|
||||
int i;
|
||||
hb_vmPushSymbol( pHrbBody->pSymRead + ul );
|
||||
hb_vmPushNil();
|
||||
for( i = 0; i < iPCount; i++ )
|
||||
@@ -280,25 +269,21 @@ static void hb_hrbExit( PHRB_BODY pHrbBody )
|
||||
|
||||
static void hb_hrbUnLoad( PHRB_BODY pHrbBody )
|
||||
{
|
||||
HB_ULONG ul;
|
||||
|
||||
hb_hrbExit( pHrbBody );
|
||||
|
||||
if( pHrbBody->pModuleSymbols )
|
||||
{
|
||||
hb_vmFreeSymbols( pHrbBody->pModuleSymbols );
|
||||
}
|
||||
|
||||
if( pHrbBody->pDynFunc )
|
||||
{
|
||||
HB_ULONG ul;
|
||||
|
||||
for( ul = 0; ul < pHrbBody->ulFuncs; ul++ )
|
||||
{
|
||||
PHB_DYNS pDyn;
|
||||
|
||||
if( pHrbBody->pDynFunc[ ul ].szName &&
|
||||
pHrbBody->pDynFunc[ ul ].pcodeFunc.pCode )
|
||||
{
|
||||
pDyn = hb_dynsymFind( pHrbBody->pDynFunc[ ul ].szName );
|
||||
PHB_DYNS pDyn = hb_dynsymFind( pHrbBody->pDynFunc[ ul ].szName );
|
||||
if( pDyn && pDyn->pSymbol->value.pCodeFunc ==
|
||||
&pHrbBody->pDynFunc[ ul ].pcodeFunc )
|
||||
{
|
||||
@@ -317,8 +302,6 @@ static void hb_hrbUnLoad( PHRB_BODY pHrbBody )
|
||||
hb_xfree( pHrbBody );
|
||||
}
|
||||
|
||||
|
||||
|
||||
static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE nBodySize, HB_USHORT usMode, const char * szFileName )
|
||||
{
|
||||
PHRB_BODY pHrbBody = NULL;
|
||||
@@ -326,14 +309,14 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE nBodySize, HB_USHOR
|
||||
if( szHrbBody )
|
||||
{
|
||||
HB_SIZE nBodyOffset = 0;
|
||||
HB_SIZE nSize; /* Size of function */
|
||||
HB_SIZE nSize; /* Size of function */
|
||||
HB_SIZE nPos;
|
||||
HB_ULONG ul;
|
||||
char * buffer, ch;
|
||||
HB_USHORT usBind = ( usMode & HB_HRB_BIND_MODEMASK );
|
||||
|
||||
PHB_SYMB pSymRead; /* Symbols read */
|
||||
PHB_DYNF pDynFunc; /* Functions read */
|
||||
PHB_SYMB pSymRead; /* Symbols read */
|
||||
PHB_DYNF pDynFunc; /* Functions read */
|
||||
PHB_DYNS pDynSym;
|
||||
|
||||
int iVersion = hb_hrbReadHead( szHrbBody, nBodySize, &nBodyOffset );
|
||||
@@ -544,7 +527,7 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE nBodySize, HB_USHOR
|
||||
{
|
||||
/*
|
||||
* Old unused symbol table has been recycled - free the one
|
||||
* we allocated and disactivate static initialization [druzus]
|
||||
* we allocated and deactivate static initialization [druzus]
|
||||
*/
|
||||
pHrbBody->pSymRead = pHrbBody->pModuleSymbols->pModuleSymbols;
|
||||
hb_xfree( pSymRead );
|
||||
@@ -619,13 +602,14 @@ static PHRB_BODY hb_hrbLoadFromFile( const char * szHrb, HB_USHORT usMode )
|
||||
static void hb_hrbDo( PHRB_BODY pHrbBody, int iPCount, PHB_ITEM * pParams )
|
||||
{
|
||||
PHB_ITEM pRetVal = NULL;
|
||||
int i;
|
||||
|
||||
hb_hrbInit( pHrbBody, iPCount, pParams );
|
||||
|
||||
/* May not have a startup symbol, if first symbol was an INIT Symbol (was executed already). */
|
||||
if( pHrbBody->lSymStart >= 0 && hb_vmRequestQuery() == 0 )
|
||||
{
|
||||
int i;
|
||||
|
||||
hb_vmPushSymbol( &pHrbBody->pSymRead[ pHrbBody->lSymStart ] );
|
||||
hb_vmPushNil();
|
||||
|
||||
@@ -677,7 +661,7 @@ static void hb_hrbReturn( PHRB_BODY pHrbBody )
|
||||
}
|
||||
|
||||
/*
|
||||
hb_hrbRun( [ <nOptions>, ] <cHrb> [, <xparams,...> ] ) -> <retVal>
|
||||
hb_hrbRun( [ <nOptions>, ] <cHrb> [, <xparams,...> ] ) --> <retVal>
|
||||
|
||||
This program will get the data from the .hrb file and run the p-code
|
||||
contained in it.
|
||||
@@ -711,11 +695,12 @@ HB_FUNC( HB_HRBRUN )
|
||||
|
||||
if( pHrbBody )
|
||||
{
|
||||
int iPCount = hb_pcount() - nParam, i;
|
||||
int iPCount = hb_pcount() - nParam;
|
||||
PHB_ITEM * pParams = NULL;
|
||||
|
||||
if( iPCount > 0 )
|
||||
{
|
||||
int i;
|
||||
pParams = ( PHB_ITEM * ) hb_xgrab( sizeof( PHB_ITEM ) * iPCount );
|
||||
for( i = 0; i < iPCount; i++ )
|
||||
pParams[ i ] = hb_stackItemFromBase( i + 1 + nParam );
|
||||
@@ -763,12 +748,11 @@ HB_FUNC( HB_HRBLOAD )
|
||||
{
|
||||
int iPCount = hb_pcount() - nParam;
|
||||
PHB_ITEM * pParams = NULL;
|
||||
int i;
|
||||
|
||||
if( iPCount > 0 )
|
||||
{
|
||||
int i;
|
||||
pParams = ( PHB_ITEM * ) hb_xgrab( sizeof( PHB_ITEM ) * iPCount );
|
||||
|
||||
for( i = 0; i < iPCount; i++ )
|
||||
pParams[ i ] = hb_stackItemFromBase( i + 1 + nParam );
|
||||
}
|
||||
@@ -792,12 +776,11 @@ HB_FUNC( HB_HRBDO )
|
||||
{
|
||||
int iPCount = hb_pcount() - 1;
|
||||
PHB_ITEM * pParams = NULL;
|
||||
int i;
|
||||
|
||||
if( iPCount > 0 )
|
||||
{
|
||||
int i;
|
||||
pParams = ( PHB_ITEM * ) hb_xgrab( sizeof( PHB_ITEM ) * iPCount );
|
||||
|
||||
for( i = 0; i < iPCount; i++ )
|
||||
pParams[ i ] = hb_stackItemFromBase( i + 2 );
|
||||
}
|
||||
|
||||
51
src/vm/set.c
51
src/vm/set.c
@@ -2,6 +2,7 @@
|
||||
* Set functions
|
||||
*
|
||||
* Copyright 1999-2003 David G. Holm <dholm@jsd-llc.com>
|
||||
* Copyright 2008-2009 Viktor Szakats (vszakats.net/harbour) (hb_osEncode(), hb_osDecode())
|
||||
*
|
||||
* 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
|
||||
@@ -44,17 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 2008-2009 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_osEncode()
|
||||
* hb_osDecode()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#define _HB_SET_INTERNAL_
|
||||
|
||||
#include "hbvmopt.h"
|
||||
@@ -88,7 +78,7 @@ static char set_char( PHB_ITEM pItem, char oldChar )
|
||||
{
|
||||
char newChar = oldChar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_char(%p, %c)", pItem, oldChar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_char(%p, %c)", ( void * ) pItem, oldChar ) );
|
||||
|
||||
if( HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -110,7 +100,7 @@ static HB_BOOL set_logical( PHB_ITEM pItem, HB_BOOL bDefault )
|
||||
{
|
||||
HB_BOOL bLogical = bDefault;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_logical(%p)", pItem ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_logical(%p)", ( void * ) pItem ) );
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
@@ -138,7 +128,7 @@ static HB_BOOL set_logical( PHB_ITEM pItem, HB_BOOL bDefault )
|
||||
|
||||
static int set_number( PHB_ITEM pItem, int iOldValue )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_number(%p, %d)", pItem, iOldValue ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_number(%p, %d)", ( void * ) pItem, iOldValue ) );
|
||||
|
||||
return HB_IS_NUMERIC( pItem ) ? hb_itemGetNI( pItem ) : iOldValue;
|
||||
}
|
||||
@@ -147,13 +137,13 @@ static char * set_string( PHB_ITEM pItem, char * szOldString )
|
||||
{
|
||||
char * szString;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_string(%p, %s)", pItem, szOldString ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "set_string(%p, %s)", ( void * ) pItem, szOldString ) );
|
||||
|
||||
if( HB_IS_STRING( pItem ) || HB_IS_NIL( pItem ) )
|
||||
{
|
||||
if( szOldString )
|
||||
hb_xfree( szOldString );
|
||||
/* Limit size of SET strings to 64K, truncating if source is longer */
|
||||
/* Limit size of SET strings to 64 KiB, truncating if source is longer */
|
||||
szString = hb_strndup( hb_itemGetCPtr( pItem ), USHRT_MAX );
|
||||
}
|
||||
else
|
||||
@@ -166,7 +156,7 @@ static void close_handle( PHB_SET_STRUCT pSet, HB_set_enum set_specifier )
|
||||
{
|
||||
PHB_FILE * handle_ptr;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "close_handle(%p,%d)", pSet, ( int ) set_specifier ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "close_handle(%p, %d)", ( void * ) pSet, ( int ) set_specifier ) );
|
||||
|
||||
switch( set_specifier )
|
||||
{
|
||||
@@ -202,7 +192,7 @@ static const char * is_devicename( const char * szFileName )
|
||||
"LPT1", "LPT2", "LPT3",
|
||||
"COM1", "COM2", "COM3", "COM4", "COM5",
|
||||
"COM6", "COM7", "COM8", "COM9" };
|
||||
int iSkip = 0, iLen, iFrom, iTo;
|
||||
int iSkip = 0, iLen;
|
||||
|
||||
if( ( szFileName[ 0 ] == '\\' || szFileName[ 0 ] == '/' ) &&
|
||||
( szFileName[ 1 ] == '\\' || szFileName[ 1 ] == '/' ) )
|
||||
@@ -217,6 +207,7 @@ static const char * is_devicename( const char * szFileName )
|
||||
}
|
||||
if( szFileName[ 2 ] != '\\' && szFileName[ 2 ] != '/' )
|
||||
{
|
||||
int iFrom, iTo;
|
||||
for( iFrom = 2, iTo = 0; szFileName[ iFrom ]; ++iFrom )
|
||||
{
|
||||
if( szFileName[ iFrom ] == '\\' || szFileName[ iFrom ] == '/' )
|
||||
@@ -232,6 +223,8 @@ static const char * is_devicename( const char * szFileName )
|
||||
iLen = ( int ) strlen( szFileName + iSkip );
|
||||
if( iLen >= 3 && iLen <= 4 )
|
||||
{
|
||||
int iFrom, iTo;
|
||||
|
||||
if( iLen == 3 )
|
||||
{
|
||||
iFrom = 0;
|
||||
@@ -277,7 +270,7 @@ static void open_handle( PHB_SET_STRUCT pSet, const char * file_name,
|
||||
char ** set_value;
|
||||
HB_BOOL fPipe = HB_FALSE, fStripEof;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "open_handle(%p, %s, %d, %d)", pSet, file_name, ( int ) fAppend, ( int ) set_specifier ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "open_handle(%p, %s, %d, %d)", ( void * ) pSet, file_name, ( int ) fAppend, ( int ) set_specifier ) );
|
||||
|
||||
switch( set_specifier )
|
||||
{
|
||||
@@ -434,7 +427,7 @@ HB_BOOL hb_setSetCentury( HB_BOOL new_century_setting )
|
||||
*/
|
||||
if( old_century_setting != new_century_setting )
|
||||
{
|
||||
int count, digit, size, y_size, y_start, y_stop;
|
||||
int count, size, y_size, y_start, y_stop;
|
||||
char * szDateFormat, * szNewFormat;
|
||||
|
||||
/* Convert to upper case and determine where year is */
|
||||
@@ -443,7 +436,7 @@ HB_BOOL hb_setSetCentury( HB_BOOL new_century_setting )
|
||||
size = ( int ) strlen( szDateFormat );
|
||||
for( count = 0; count < size; count++ )
|
||||
{
|
||||
digit = HB_TOUPPER( ( HB_UCHAR ) szDateFormat[ count ] );
|
||||
int digit = HB_TOUPPER( ( HB_UCHAR ) szDateFormat[ count ] );
|
||||
if( digit == 'Y' )
|
||||
{
|
||||
if( y_start == -1 )
|
||||
@@ -526,7 +519,7 @@ static char * hb_set_PRINTFILE_default( void )
|
||||
#elif defined( HB_OS_WIN ) || defined( HB_OS_OS2 )
|
||||
return hb_strdup( "LPT1" );
|
||||
#else
|
||||
return hb_strdup( "PRN" ); /* TOFIX */
|
||||
return hb_strdup( "PRN" ); /* FIXME */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1005,7 +998,7 @@ PHB_ITEM hb_setGetItem( HB_set_enum set_specifier, PHB_ITEM pResult,
|
||||
if( HB_IS_NIL( pArg1 ) )
|
||||
pSet->HB_SET_HBOUTLOG = NULL;
|
||||
else
|
||||
/* Limit size of SET strings to 64K, truncating if source is longer */
|
||||
/* Limit size of SET strings to 64 KiB, truncating if source is longer */
|
||||
pSet->HB_SET_HBOUTLOG = hb_strndup( hb_itemGetCPtr( pArg1 ), USHRT_MAX );
|
||||
hb_xsetfilename( pSet->HB_SET_HBOUTLOG );
|
||||
}
|
||||
@@ -1090,7 +1083,7 @@ HB_FUNC( SET )
|
||||
|
||||
void hb_setInitialize( PHB_SET_STRUCT pSet )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_setInitialize(%p)", pSet ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_setInitialize(%p)", ( void * ) pSet ) );
|
||||
|
||||
pSet->HB_SET_ALTERNATE = HB_FALSE;
|
||||
pSet->HB_SET_ALTFILE = NULL;
|
||||
@@ -1103,6 +1096,7 @@ void hb_setInitialize( PHB_SET_STRUCT pSet )
|
||||
pSet->hb_set_century = HB_FALSE;
|
||||
pSet->hb_set_prndevice = HB_FALSE;
|
||||
pSet->HB_SET_COLOR = ( char * ) hb_xgrab( HB_CLRSTR_LEN + 1 );
|
||||
/* NOTE: color must be synced with the one in IsDefColor() function */
|
||||
hb_strncpy( pSet->HB_SET_COLOR, "W/N,N/W,N/N,N/N,N/W", HB_CLRSTR_LEN );
|
||||
pSet->HB_SET_CONFIRM = HB_FALSE;
|
||||
pSet->HB_SET_CONSOLE = HB_TRUE;
|
||||
@@ -1332,13 +1326,14 @@ int hb_setListenerRemove( int listener )
|
||||
HB_BOOL hb_setSetItem( HB_set_enum set_specifier, PHB_ITEM pItem )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
PHB_SET_STRUCT pSet = hb_stackSetStruct();
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
char * szValue;
|
||||
int iValue;
|
||||
|
||||
if( pItem )
|
||||
{
|
||||
PHB_SET_STRUCT pSet = hb_stackSetStruct();
|
||||
char * szValue;
|
||||
int iValue;
|
||||
|
||||
hb_setListenerNotify( set_specifier, HB_SET_LISTENER_BEFORE );
|
||||
|
||||
switch( set_specifier )
|
||||
@@ -1346,7 +1341,7 @@ HB_BOOL hb_setSetItem( HB_set_enum set_specifier, PHB_ITEM pItem )
|
||||
case HB_SET_ALTFILE:
|
||||
case HB_SET_EXTRAFILE:
|
||||
case HB_SET_PRINTFILE:
|
||||
/* This sets needs 3-rd parameter to indicate additive mode
|
||||
/* This sets needs 3rd parameter to indicate additive mode
|
||||
* so they cannot be fully supported by this function
|
||||
*/
|
||||
if( HB_IS_STRING( pItem ) || HB_IS_NIL( pItem ) )
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdefs.h"
|
||||
|
||||
HB_FUNC_TRANSLATE( __CLASSINS, __CLASSINSTANCE )
|
||||
HB_FUNC_TRANSLATE( __CLASSNAM, __CLASSNAME )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* string API functions
|
||||
* String API functions
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -56,7 +56,7 @@ HB_SIZE hb_wstrlen( const HB_WCHAR * szText )
|
||||
{
|
||||
HB_SIZE nLen = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrlen(%p)", szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrlen(%p)", ( const void * ) szText ) );
|
||||
|
||||
if( szText )
|
||||
{
|
||||
@@ -71,7 +71,7 @@ HB_SIZE hb_wstrnlen( const HB_WCHAR * szText, HB_SIZE nCount )
|
||||
{
|
||||
HB_SIZE nLen = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrnlen(%p,%" HB_PFS "u)", szText, nCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrnlen(%p,%" HB_PFS "u)", ( const void * ) szText, nCount ) );
|
||||
|
||||
if( szText )
|
||||
{
|
||||
@@ -86,7 +86,7 @@ int hb_wstrcmp( const HB_WCHAR * s1, const HB_WCHAR * s2 )
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrcmp(%p, %p)", s1, s2 ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrcmp(%p, %p)", ( const void * ) s1, ( const void * ) s2 ) );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
@@ -109,7 +109,7 @@ int hb_wstrncmp( const HB_WCHAR * s1, const HB_WCHAR * s2, HB_SIZE nCount )
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrncmp(%p, %p, %" HB_PFS "u)", s1, s2, nCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrncmp(%p, %p, %" HB_PFS "u)", ( const void * ) s1, ( const void * ) s2, nCount ) );
|
||||
|
||||
while( nCount-- )
|
||||
{
|
||||
@@ -132,7 +132,7 @@ HB_WCHAR * hb_wstrncpy( HB_WCHAR * pDest, const HB_WCHAR * pSource, HB_SIZE nLen
|
||||
{
|
||||
HB_WCHAR * pBuf = pDest;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrncpy(%p, %p, %" HB_PFS "u)", pDest, pSource, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrncpy(%p, %p, %" HB_PFS "u)", ( void * ) pDest, ( const void * ) pSource, nLen ) );
|
||||
|
||||
pDest[ nLen ] = '\0';
|
||||
|
||||
@@ -146,7 +146,7 @@ HB_WCHAR * hb_wstrncat( HB_WCHAR * pDest, const HB_WCHAR * pSource, HB_SIZE nLen
|
||||
{
|
||||
HB_WCHAR * pBuf = pDest;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strncat(%p, %p, %" HB_PFS "u)", pDest, pSource, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strncat(%p, %p, %" HB_PFS "u)", ( void * ) pDest, ( const void * ) pSource, nLen ) );
|
||||
|
||||
pDest[ nLen ] = '\0';
|
||||
|
||||
@@ -167,7 +167,7 @@ HB_WCHAR * hb_wstrdup( const HB_WCHAR * szText )
|
||||
HB_WCHAR * pszDest;
|
||||
HB_SIZE nSize;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrdup(%p)", szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrdup(%p)", ( const void * ) szText ) );
|
||||
|
||||
nSize = ( hb_wstrlen( szText ) + 1 ) * sizeof( HB_WCHAR );
|
||||
pszDest = ( HB_WCHAR * ) hb_xgrab( nSize );
|
||||
@@ -182,7 +182,7 @@ HB_WCHAR * hb_wstrndup( const HB_WCHAR * szText, HB_SIZE nLen )
|
||||
HB_WCHAR * pszDest;
|
||||
HB_SIZE nSize;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrndup(%p,%" HB_PFS "u)", szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrndup(%p,%" HB_PFS "u)", ( const void * ) szText, nLen ) );
|
||||
|
||||
nSize = hb_wstrlen( szText );
|
||||
if( nSize < nLen )
|
||||
@@ -197,7 +197,7 @@ HB_WCHAR * hb_wstrndup( const HB_WCHAR * szText, HB_SIZE nLen )
|
||||
|
||||
HB_WCHAR * hb_wstrunshare( void ** phStr, const HB_WCHAR * pStr, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrunshare(%p,%p,%" HB_PFS "u)", phStr, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrunshare(%p,%p,%" HB_PFS "u)", ( void * ) phStr, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( pStr == NULL || phStr == NULL || *phStr == NULL )
|
||||
return NULL;
|
||||
@@ -221,7 +221,7 @@ HB_WCHAR * hb_wstrunshare( void ** phStr, const HB_WCHAR * pStr, HB_SIZE nLen )
|
||||
|
||||
char * hb_strunshare( void ** phStr, const char * pStr, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strunshare(%p,%p,%" HB_PFS "u)", phStr, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strunshare(%p,%p,%" HB_PFS "u)", ( void * ) phStr, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( pStr == NULL || phStr == NULL || *phStr == NULL )
|
||||
return NULL;
|
||||
@@ -244,14 +244,14 @@ char * hb_strunshare( void ** phStr, const char * pStr, HB_SIZE nLen )
|
||||
|
||||
const char * hb_strnull( const char * str )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strnull(%p)", str ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strnull(%p)", ( const void * ) str ) );
|
||||
|
||||
return str ? str : "";
|
||||
}
|
||||
|
||||
const HB_WCHAR * hb_wstrnull( const HB_WCHAR * str )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrnull(%p)", str ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_wstrnull(%p)", ( const void * ) str ) );
|
||||
|
||||
return str ? str : s_szConstStr;
|
||||
}
|
||||
@@ -269,7 +269,7 @@ void hb_strfree( void * hString )
|
||||
|
||||
const char * hb_itemGetStr( PHB_ITEM pItem, void * cdp, void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStr(%p,%p,%p,%p)", pItem, cdp, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStr(%p,%p,%p,%p)", ( void * ) pItem, cdp, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -302,7 +302,7 @@ const char * hb_itemGetStr( PHB_ITEM pItem, void * cdp, void ** phString, HB_SIZ
|
||||
|
||||
const char * hb_itemGetStrUTF8( PHB_ITEM pItem, void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStrUTF8(%p,%p,%p)", pItem, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStrUTF8(%p,%p,%p)", ( void * ) pItem, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -343,7 +343,7 @@ const char * hb_itemGetStrUTF8( PHB_ITEM pItem, void ** phString, HB_SIZE * pnLe
|
||||
const HB_WCHAR * hb_itemGetStrU16( PHB_ITEM pItem, int iEndian,
|
||||
void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStrU16(%p,%d,%p,%p)", pItem, iEndian, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemGetStrU16(%p,%d,%p,%p)", ( void * ) pItem, iEndian, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -379,7 +379,7 @@ const HB_WCHAR * hb_itemGetStrU16( PHB_ITEM pItem, int iEndian,
|
||||
|
||||
HB_SIZE hb_itemCopyStr( PHB_ITEM pItem, void * cdp, char * pStrBuffer, HB_SIZE nSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStr(%p,%p,%p,%" HB_PFS "u)", pItem, cdp, pStrBuffer, nSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStr(%p,%p,%p,%" HB_PFS "u)", ( void * ) pItem, cdp, ( void * ) pStrBuffer, nSize ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -401,7 +401,7 @@ HB_SIZE hb_itemCopyStr( PHB_ITEM pItem, void * cdp, char * pStrBuffer, HB_SIZE n
|
||||
|
||||
HB_SIZE hb_itemCopyStrUTF8( PHB_ITEM pItem, char * pStrBuffer, HB_SIZE nSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStrUTF8(%p,%p,%" HB_PFS "u)", pItem, pStrBuffer, nSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStrUTF8(%p,%p,%" HB_PFS "u)", ( void * ) pItem, ( void * ) pStrBuffer, nSize ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -425,7 +425,7 @@ HB_SIZE hb_itemCopyStrUTF8( PHB_ITEM pItem, char * pStrBuffer, HB_SIZE nSize )
|
||||
|
||||
HB_SIZE hb_itemCopyStrU16( PHB_ITEM pItem, int iEndian, HB_WCHAR * pStrBuffer, HB_SIZE nSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStrU16(%p,%d,%p,%" HB_PFS "u)", pItem, iEndian, pStrBuffer, nSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemCopyStrU16(%p,%d,%p,%" HB_PFS "u)", ( void * ) pItem, iEndian, ( void * ) pStrBuffer, nSize ) );
|
||||
|
||||
if( pItem && HB_IS_STRING( pItem ) )
|
||||
{
|
||||
@@ -451,7 +451,7 @@ PHB_ITEM hb_itemPutStrLen( PHB_ITEM pItem, void * cdp, const char * pStr, HB_SIZ
|
||||
{
|
||||
char * pszText;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLen(%p,%p,%p,%" HB_PFS "u)", pItem, cdp, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLen(%p,%p,%p,%" HB_PFS "u)", ( void * ) pItem, cdp, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( nLen == 0 )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -467,7 +467,7 @@ PHB_ITEM hb_itemPutStrLenUTF8( PHB_ITEM pItem, const char * pStr, HB_SIZE nLen )
|
||||
char * pszDest;
|
||||
HB_SIZE nDest;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLenUTF8(%p,%p,%" HB_PFS "u)", pItem, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLenUTF8(%p,%p,%" HB_PFS "u)", ( void * ) pItem, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( nLen == 0 )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -486,7 +486,7 @@ PHB_ITEM hb_itemPutStrLenU16( PHB_ITEM pItem, int iEndian, const HB_WCHAR * pStr
|
||||
char * pszDest;
|
||||
HB_SIZE nDest;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLenU16(%p,%d,%p,%" HB_PFS "u)", pItem, iEndian, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrLenU16(%p,%d,%p,%" HB_PFS "u)", ( void * ) pItem, iEndian, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( nLen == 0 )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -505,7 +505,7 @@ PHB_ITEM hb_itemPutStr( PHB_ITEM pItem, void * cdp, const char * pStr )
|
||||
char * pszText;
|
||||
HB_SIZE nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStr(%p,%p,%p)", pItem, cdp, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStr(%p,%p,%p)", ( void * ) pItem, cdp, ( const void * ) pStr ) );
|
||||
|
||||
if( pStr == NULL )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -522,7 +522,7 @@ PHB_ITEM hb_itemPutStrUTF8( PHB_ITEM pItem, const char * pStr )
|
||||
char * pszDest;
|
||||
HB_SIZE nDest, nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrUTF8(%p,%p)", pItem, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrUTF8(%p,%p)", ( void * ) pItem, ( const void * ) pStr ) );
|
||||
|
||||
if( pStr == NULL )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -542,7 +542,7 @@ PHB_ITEM hb_itemPutStrU16( PHB_ITEM pItem, int iEndian, const HB_WCHAR * pStr )
|
||||
char * pszDest;
|
||||
HB_SIZE nDest, nLen;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrU16(%p,%d,%p)", pItem, iEndian, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_itemPutStrU16(%p,%d,%p)", ( void * ) pItem, iEndian, ( const void * ) pStr ) );
|
||||
|
||||
if( pStr == NULL )
|
||||
return hb_itemPutC( pItem, NULL );
|
||||
@@ -562,7 +562,7 @@ PHB_ITEM hb_itemPutStrU16( PHB_ITEM pItem, int iEndian, const HB_WCHAR * pStr )
|
||||
const char * hb_arrayGetStr( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp,
|
||||
void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStr(%p, %" HB_PFS "u, %p, %p, %p)", pArray, nIndex, cdp, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStr(%p, %" HB_PFS "u, %p, %p, %p)", ( void * ) pArray, nIndex, cdp, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetStr( pArray->item.asArray.value->pItems + nIndex - 1,
|
||||
@@ -577,7 +577,7 @@ const char * hb_arrayGetStr( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp,
|
||||
const char * hb_arrayGetStrUTF8( PHB_ITEM pArray, HB_SIZE nIndex,
|
||||
void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStrUTF8(%p, %" HB_PFS "u, %p, %p)", pArray, nIndex, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStrUTF8(%p, %" HB_PFS "u, %p, %p)", ( void * ) pArray, nIndex, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetStrUTF8( pArray->item.asArray.value->pItems + nIndex - 1,
|
||||
@@ -592,7 +592,7 @@ const char * hb_arrayGetStrUTF8( PHB_ITEM pArray, HB_SIZE nIndex,
|
||||
const HB_WCHAR * hb_arrayGetStrU16( PHB_ITEM pArray, HB_SIZE nIndex, int iEndian,
|
||||
void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStrU16(%p, %" HB_PFS "u, %d, %p, %p)", pArray, nIndex, iEndian, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arrayGetStrU16(%p, %" HB_PFS "u, %d, %p, %p)", ( void * ) pArray, nIndex, iEndian, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
return hb_itemGetStrU16( pArray->item.asArray.value->pItems + nIndex - 1,
|
||||
@@ -608,7 +608,7 @@ const HB_WCHAR * hb_arrayGetStrU16( PHB_ITEM pArray, HB_SIZE nIndex, int iEndian
|
||||
HB_BOOL hb_arraySetStrLen( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp,
|
||||
const char * pStr, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLen(%p, %" HB_PFS "u, %p, %p, %" HB_PFS "u)", pArray, nIndex, cdp, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLen(%p, %" HB_PFS "u, %p, %p, %" HB_PFS "u)", ( void * ) pArray, nIndex, cdp, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -623,7 +623,7 @@ HB_BOOL hb_arraySetStrLen( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp,
|
||||
HB_BOOL hb_arraySetStrLenUTF8( PHB_ITEM pArray, HB_SIZE nIndex,
|
||||
const char * pStr, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLenUTF8(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", pArray, nIndex, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLenUTF8(%p, %" HB_PFS "u, %p, %" HB_PFS "u)", ( void * ) pArray, nIndex, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -638,7 +638,7 @@ HB_BOOL hb_arraySetStrLenUTF8( PHB_ITEM pArray, HB_SIZE nIndex,
|
||||
HB_BOOL hb_arraySetStrLenU16( PHB_ITEM pArray, HB_SIZE nIndex, int iEndian,
|
||||
const HB_WCHAR * pStr, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLenU16(%p, %" HB_PFS "u, %d, %p, %" HB_PFS "u)", pArray, nIndex, iEndian, pStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrLenU16(%p, %" HB_PFS "u, %d, %p, %" HB_PFS "u)", ( void * ) pArray, nIndex, iEndian, ( const void * ) pStr, nLen ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -653,7 +653,7 @@ HB_BOOL hb_arraySetStrLenU16( PHB_ITEM pArray, HB_SIZE nIndex, int iEndian,
|
||||
|
||||
HB_BOOL hb_arraySetStr( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp, const char * pStr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStr(%p, %" HB_PFS "u, %p, %p)", pArray, nIndex, cdp, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStr(%p, %" HB_PFS "u, %p, %p)", ( void * ) pArray, nIndex, cdp, ( const void * ) pStr ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -666,7 +666,7 @@ HB_BOOL hb_arraySetStr( PHB_ITEM pArray, HB_SIZE nIndex, void * cdp, const char
|
||||
|
||||
HB_BOOL hb_arraySetStrUTF8( PHB_ITEM pArray, HB_SIZE nIndex, const char * pStr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrUTF8(%p, %" HB_PFS "u, %p)", pArray, nIndex, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrUTF8(%p, %" HB_PFS "u, %p)", ( void * ) pArray, nIndex, ( const void * ) pStr ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -679,7 +679,7 @@ HB_BOOL hb_arraySetStrUTF8( PHB_ITEM pArray, HB_SIZE nIndex, const char * pStr )
|
||||
|
||||
HB_BOOL hb_arraySetStrU16( PHB_ITEM pArray, HB_SIZE nIndex, int iEndian, const HB_WCHAR * pStr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrU16(%p, %" HB_PFS "u, %d, %p)", pArray, nIndex, iEndian, pStr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_arraySetStrU16(%p, %" HB_PFS "u, %d, %p)", ( void * ) pArray, nIndex, iEndian, ( const void * ) pStr ) );
|
||||
|
||||
if( HB_IS_ARRAY( pArray ) && nIndex > 0 && nIndex <= pArray->item.asArray.value->nLen )
|
||||
{
|
||||
@@ -697,7 +697,7 @@ const char * hb_parstr( int iParam, void * cdp, void ** phString, HB_SIZE * pnLe
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr(%d,%p,%p,%p)", iParam, cdp, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr(%d,%p,%p,%p)", iParam, cdp, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -720,7 +720,7 @@ const char * hb_parstr_utf8( int iParam, void ** phString, HB_SIZE * pnLen )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr_utf8(%d,%p,%p)", iParam, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr_utf8(%d,%p,%p)", iParam, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -744,7 +744,7 @@ const HB_WCHAR * hb_parstr_u16( int iParam, int iEndian,
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr_u16(%d,%d,%p,%p)", iParam, iEndian, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parstr_u16(%d,%d,%p,%p)", iParam, iEndian, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -769,7 +769,7 @@ const char * hb_parastr( int iParam, HB_SIZE nIndex,
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr(%d,%" HB_PFS "u,%p,%p,%p)", iParam, nIndex, cdp, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr(%d,%" HB_PFS "u,%p,%p,%p)", iParam, nIndex, cdp, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -796,7 +796,7 @@ const char * hb_parastr_utf8( int iParam, HB_SIZE nIndex,
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr_utf8(%d,%" HB_PFS "u,%p,%p)", iParam, nIndex, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr_utf8(%d,%" HB_PFS "u,%p,%p)", iParam, nIndex, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -823,7 +823,7 @@ const HB_WCHAR * hb_parastr_u16( int iParam, HB_SIZE nIndex, int iEndian,
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr_u16(%d,%" HB_PFS "u,%d,%p,%p)", iParam, nIndex, iEndian, phString, pnLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_parastr_u16(%d,%" HB_PFS "u,%d,%p,%p)", iParam, nIndex, iEndian, ( void * ) phString, ( void * ) pnLen ) );
|
||||
|
||||
if( iParam >= -1 && iParam <= hb_pcount() )
|
||||
{
|
||||
@@ -870,7 +870,7 @@ void hb_retstr_u16( int iEndian, const HB_WCHAR * szText )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstr_u16(%d,%p)", iEndian, szText ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstr_u16(%d,%p)", iEndian, ( const void * ) szText ) );
|
||||
|
||||
hb_itemPutStrLenU16( hb_stackReturnItem(), iEndian, szText,
|
||||
hb_wstrlen( szText ) );
|
||||
@@ -881,7 +881,7 @@ void hb_retstrlen( void * cdp, const char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstrlen(%p,%s,%" HB_PFS "u)", cdp, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstrlen(%p,%s,%" HB_PFS "u)", cdp, ( const void * ) szText, nLen ) );
|
||||
|
||||
hb_itemPutStrLen( hb_stackReturnItem(), cdp, szText, nLen );
|
||||
}
|
||||
@@ -899,7 +899,7 @@ void hb_retstrlen_u16( int iEndian, const HB_WCHAR * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstrlen_u16(%d,%p,%" HB_PFS "u)", iEndian, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_retstrlen_u16(%d,%p,%" HB_PFS "u)", iEndian, ( const void * ) szText, nLen ) );
|
||||
|
||||
hb_itemPutStrLenU16( hb_stackReturnItem(), iEndian, szText, nLen );
|
||||
}
|
||||
@@ -909,7 +909,7 @@ int hb_storstr( void * cdp, const char * szText, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstr(%p,%s,%d)", cdp, szText, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstr(%p,%s,%d)", cdp, ( const void * ) szText, iParam ) );
|
||||
|
||||
if( iParam == -1 )
|
||||
{
|
||||
@@ -963,7 +963,7 @@ int hb_storstr_u16( int iEndian, const HB_WCHAR * szText, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstr_u16(%d,%p,%d)", iEndian, szText, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstr_u16(%d,%p,%d)", iEndian, ( const void * ) szText, iParam ) );
|
||||
|
||||
if( iParam == -1 )
|
||||
{
|
||||
@@ -991,7 +991,7 @@ int hb_storstrlen( void * cdp, const char * szText, HB_SIZE nLen, int iParam )
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstrlen(%p,%s,%" HB_PFS "u,%d)", cdp, szText, nLen, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstrlen(%p,%s,%" HB_PFS "u,%d)", cdp, ( const void * ) szText, nLen, iParam ) );
|
||||
|
||||
if( iParam == -1 )
|
||||
{
|
||||
@@ -1041,7 +1041,7 @@ int hb_storstrlen_u16( int iEndian, const HB_WCHAR * szText, HB_SIZE nLen, int i
|
||||
{
|
||||
HB_STACK_TLS_PRELOAD
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstrlen_u16(%d,%p,%" HB_PFS "u,%d)", iEndian, szText, nLen, iParam ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_storstrlen_u16(%d,%p,%" HB_PFS "u,%d)", iEndian, ( const void * ) szText, nLen, iParam ) );
|
||||
|
||||
if( iParam == -1 )
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* platform independent task system. It's used when when OS does not
|
||||
* support threads
|
||||
* Platform independent task system. It's used when when OS does not
|
||||
* support threads
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -400,7 +400,7 @@ static void hb_taskFinalize( PHB_TASKINFO pTask )
|
||||
#endif
|
||||
}
|
||||
|
||||
/* it cannot happen for runing threads */
|
||||
/* it cannot happen for running threads */
|
||||
|
||||
/* remove from mutex lockers queue */
|
||||
if( pTask->locking )
|
||||
|
||||
@@ -47,29 +47,29 @@
|
||||
/*
|
||||
Harbour level API:
|
||||
|
||||
hb_threadStart( [ <nThreadAttrs>, ] <@sStart()> | <bStart> | <cStart> [, <params,...> ] ) -> <pThID>
|
||||
hb_threadSelf() -> <pThID> | NIL
|
||||
hb_threadID( [ <pThID> ] ) -> <nThNo>
|
||||
hb_threadJoin( <pThID> [, @<xRetCode> ] ) -> <lOK>
|
||||
hb_threadDetach( <pThID> ) -> <lOK>
|
||||
* hb_threadQuitRequest( <pThID> ) -> <lOK>
|
||||
hb_threadTerminateAll() -> NIL
|
||||
hb_threadIsMain( [ <pThID> ] ) -> <lMainHvmThread>
|
||||
hb_threadWaitForAll() -> NIL
|
||||
hb_threadStart( [ <nThreadAttrs>, ] <@sStart()> | <bStart> | <cStart> [, <params,...> ] ) --> <pThID>
|
||||
hb_threadSelf() --> <pThID> | NIL
|
||||
hb_threadID( [ <pThID> ] ) --> <nThNo>
|
||||
hb_threadJoin( <pThID> [, @<xRetCode> ] ) --> <lOK>
|
||||
hb_threadDetach( <pThID> ) --> <lOK>
|
||||
* hb_threadQuitRequest( <pThID> ) --> <lOK>
|
||||
hb_threadTerminateAll() --> NIL
|
||||
hb_threadIsMain( [ <pThID> ] ) --> <lMainHvmThread>
|
||||
hb_threadWaitForAll() --> NIL
|
||||
hb_threadWait( <pThID> | <apThID>, [ <nTimeOut> ] [, <lAll> ] ) => <nThInd> | <nThCount> | 0
|
||||
hb_threadOnce( @<onceControl> [, <bAction> | <@sAction()> ] ) -> <lFirstCall>
|
||||
hb_threadOnceInit( @<item>, <value> ) -> <lInitialized>
|
||||
hb_mutexCreate() -> <pMtx>
|
||||
hb_mutexExists( <pMtx> ) -> <lExists>
|
||||
hb_mutexLock( <pMtx> [, <nTimeOut> ] ) -> <lLocked>
|
||||
hb_mutexUnlock( <pMtx> ) -> <lOK>
|
||||
hb_mutexNotify( <pMtx> [, <xVal>] ) -> NIL
|
||||
hb_mutexNotifyAll( <pMtx> [, <xVal>] ) -> NIL
|
||||
hb_mutexSubscribe( <pMtx>, [ <nTimeOut> ] [, @<xSubscribed> ] ) -> <lSubscribed>
|
||||
hb_mutexSubscribeNow( <pMtx>, [ <nTimeOut> ] [, @<xSubscribed> ] ) -> <lSubscribed>
|
||||
hb_mutexEval( <pMtx>, <bCode> | <@sFunc()> [, <params,...> ] ) -> <xCodeResult>
|
||||
** hb_mutexQueueInfo( <pMtx>, [ @<nWaitersCount> ], [ @<nQueueLength> ] ) -> .T.
|
||||
hb_mtvm() -> <lMultiThreadVM>
|
||||
hb_threadOnce( @<onceControl> [, <bAction> | <@sAction()> ] ) --> <lFirstCall>
|
||||
hb_threadOnceInit( @<item>, <value> ) --> <lInitialized>
|
||||
hb_mutexCreate() --> <pMtx>
|
||||
hb_mutexExists( <pMtx> ) --> <lExists>
|
||||
hb_mutexLock( <pMtx> [, <nTimeOut> ] ) --> <lLocked>
|
||||
hb_mutexUnlock( <pMtx> ) --> <lOK>
|
||||
hb_mutexNotify( <pMtx> [, <xVal>] ) --> NIL
|
||||
hb_mutexNotifyAll( <pMtx> [, <xVal>] ) --> NIL
|
||||
hb_mutexSubscribe( <pMtx>, [ <nTimeOut> ] [, @<xSubscribed> ] ) --> <lSubscribed>
|
||||
hb_mutexSubscribeNow( <pMtx>, [ <nTimeOut> ] [, @<xSubscribed> ] ) --> <lSubscribed>
|
||||
hb_mutexEval( <pMtx>, <bCode> | <@sFunc()> [, <params,...> ] ) --> <xCodeResult>
|
||||
** hb_mutexQueueInfo( <pMtx>, [ @<nWaitersCount> ], [ @<nQueueLength> ] ) --> .T.
|
||||
hb_mtvm() --> <lMultiThreadVM>
|
||||
|
||||
* - this function call can be ignored by the destination thread in some
|
||||
cases. HVM does not guaranties that the QUIT signal will be always
|
||||
@@ -300,7 +300,7 @@ void hb_threadReleaseCPU( void )
|
||||
}
|
||||
|
||||
/* the code below is simpler but seems that some Linux kernels
|
||||
* (f.e. from Centos 5.1) have problems with nanosleep()
|
||||
* (f.e. from CentOS 5.1) have problems with nanosleep()
|
||||
* so it was replaced by above code
|
||||
*/
|
||||
|
||||
@@ -528,7 +528,7 @@ static HB_CRITICAL_NEW( s_atomicMtx );
|
||||
void hb_atomic_set( volatile HB_COUNTER * pCounter, HB_COUNTER value )
|
||||
{
|
||||
/* NOTE: on some platforms it may be necessary to protect this
|
||||
* by cirtical section, f.e. when HB_COUNTER cannot be accessed
|
||||
* by critical section, f.e. when HB_COUNTER cannot be accessed
|
||||
* using single memory access by CPU.
|
||||
*/
|
||||
*pCounter = value;
|
||||
@@ -537,7 +537,7 @@ void hb_atomic_set( volatile HB_COUNTER * pCounter, HB_COUNTER value )
|
||||
HB_COUNTER hb_atomic_get( volatile HB_COUNTER * pCounter )
|
||||
{
|
||||
/* NOTE: on some platforms it may be necessary to protect this
|
||||
* by cirtical section, f.e. when HB_COUNTER cannot be accessed
|
||||
* by critical section, f.e. when HB_COUNTER cannot be accessed
|
||||
* using single memory access by CPU.
|
||||
*/
|
||||
return *pCounter;
|
||||
@@ -859,7 +859,7 @@ HB_BOOL hb_threadJoin( HB_THREAD_HANDLE th_h )
|
||||
return HB_FALSE;
|
||||
#elif defined( HB_OS_OS2 )
|
||||
APIRET rc = DosWaitThread( &th_h, DCWW_WAIT );
|
||||
/* TOFIX: ERROR_INVALID_THREADID is a hack for failing DosWaitThread()
|
||||
/* FIXME: ERROR_INVALID_THREADID is a hack for failing DosWaitThread()
|
||||
* when thread terminates before DosWaitThread() call.
|
||||
* OS2 users please check and fix this code if possible.
|
||||
*/
|
||||
@@ -1501,7 +1501,6 @@ HB_FUNC( HB_THREADWAIT )
|
||||
#if defined( HB_MT_VM )
|
||||
# define HB_THREAD_WAIT_ALLOC 16
|
||||
HB_STACK_TLS_PRELOAD
|
||||
HB_BOOL fAll;
|
||||
HB_ULONG ulMilliSec = HB_THREAD_INFINITE_WAIT;
|
||||
PHB_THREADSTATE * pThreads, pAlloc[ HB_THREAD_WAIT_ALLOC ];
|
||||
int iThreads = -1;
|
||||
@@ -1538,6 +1537,8 @@ HB_FUNC( HB_THREADWAIT )
|
||||
|
||||
if( iThreads > 0 )
|
||||
{
|
||||
HB_BOOL fAll;
|
||||
|
||||
if( HB_ISNUM( 2 ) )
|
||||
{
|
||||
double dTimeOut = hb_parnd( 2 );
|
||||
@@ -1571,7 +1572,7 @@ HB_FUNC( HB_THREADTERMINATEALL )
|
||||
#endif
|
||||
}
|
||||
|
||||
/* hb_threadOnce( @<onceControl> [, <bAction> ] ) -> <lFirstCall>
|
||||
/* hb_threadOnce( @<onceControl> [, <bAction> ] ) --> <lFirstCall>
|
||||
* Execute <bAction> only once. <onceControl> is variable which holds
|
||||
* the execution status and have to be initialized to NIL. In most of
|
||||
* cases it will be simple static variable in user code.
|
||||
@@ -1582,7 +1583,7 @@ HB_FUNC( HB_THREADTERMINATEALL )
|
||||
* If thread calls hb_threadOnce() with the same <onceControl> variable
|
||||
* recursively from <bAction> then hb_threadOnce() returns immediately
|
||||
* returning HB_FALSE without executing <bAction>.
|
||||
* This function returns logical value indicating if it was 1-st call to
|
||||
* This function returns logical value indicating if it was 1st call to
|
||||
* hb_threadOnce() for given <onceControl> variable
|
||||
*/
|
||||
HB_FUNC( HB_THREADONCE )
|
||||
@@ -1634,7 +1635,7 @@ HB_FUNC( HB_THREADONCE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_threadOnceInit( @<item>, <value> ) -> <lInitialized>
|
||||
/* hb_threadOnceInit( @<item>, <value> ) --> <lInitialized>
|
||||
* assign <value> to @<item> only if <item> is NIL
|
||||
*/
|
||||
HB_FUNC( HB_THREADONCEINIT )
|
||||
|
||||
@@ -44,10 +44,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* -------------------------------------------------------- */
|
||||
/* Warning: VM functionality is not supported by Harbour. */
|
||||
/* All functions will emulate constant failure. */
|
||||
/* -------------------------------------------------------- */
|
||||
/* WARNING: VM functionality is not supported by Harbour.
|
||||
All functions will emulate constant failure. */
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user