* harbour/include/hbthread.h
* harbour/source/vm/thread.c
+ added hb_atomic_set(), hb_atomic_get(), hb_atomic_inc() and
hb_atomic_dec() functions which operates on HB_COUNTER or smaller
type if it's necessary for some platforms which can be access/assign
increment/decrement in MT safe atom operations.
hb_atomic_dec() returns true if counter is 0 after decrementation
* harbour/include/hbatomic.h
! fixed compilation in Linux and OpenWatcom
* harbour/include/hbapiitm.h
* harbour/source/rtl/itemseri.c
+ make hb_itemSerialize() and hb_itemDeserialize() public functions
! fixed serialization items with internal item references
* harbour/source/vm/hvm.c
* release memvars after closing RDDs
* harbour/source/debug/dbgentry.c
! fixed buffer overflow reported by Rodrigo
* harbour/source/vm/macro.c
* harbour/source/compiler/hbmain.c
* formatting
* harbour/include/hbexprb.c
! fixed wrongly recognized functions with HB_I18N_ prefix as
HB_I18N_GETTEXT()
* harbour/include/hbapi.h
* harbour/include/hbstack.h
* harbour/include/hbthread.h
* harbour/source/vm/estack.c
* harbour/source/vm/thread.c
* harbour/source/vm/hvm.c
+ added support for I18N in HVM.
Each thread can have it's own i18n set.
When new thread is created then it inherits i18n set from parent
thread and both uses the same set (please remember about it if you
will want to make some direct modifications on active i18n set
internals).
When thread change active i18n set then it effects only this thread
and new threads which will be create later. It does not change i18n
in other existing threads.
+ added functions to set/get pointer to active i18n set in HVM
void * hb_vmI18N( void )
void hb_vmSetI18N( void * )
* harbour/include/hbapi.h
* harbour/source/rtl/hbi18n.c
+ added i18n module. Now only for internal Harbour usage without support
for optional switching to alternative implementations.
I'll add such functionality later when I will work on native gettext
support.
The following public .prg functions has been added:
HB_I18N_GETTEXT[_STRICT]( <cMsgID> [, <cContext> ] )
-> <cTranslatedMsgID> | <cMsgID>
HB_I18N_NGETTEXT[_STRICT]( <nValue>, <cMsgID> | <acMsgID> ;
[, <cContext> ] )
-> <cTranslatedMsgID> | <cMsgID> | <acMsgID>[ <nIndex> ]
This is minimal support necessary for .prg code which has to exists
in each i18n module working with Harbour.
The following functions had been added as public C API:
PHB_ITEM hb_i18n_gettext( PHB_ITEM pMsgID, PHB_ITEM pContext )
PHB_ITEM hb_i18n_ngettext( PHB_ITEM pNum,
PHB_ITEM pMsgID, PHB_ITEM pContext )
The following functions had been added as private HVM C API:
void hb_i18n_init( void )
void hb_i18n_exit( void )
void hb_i18n_release( void * cargo )
void * hb_i18n_alloc( void * cargo )
They have to be supported by alternative i18n modules
The following functions has been added to manage Harbour i18n
translations sets:
HB_I18N_CREATE()
-> <pI18N>
Creates new empty I18N translation set
HB_I18N_CODEPAGE( [<pI18N>,] [<cNewCP>], [<lBase>], [<lTranslate>] )
-> <cOldCP>
Gets or sets Harbour codepage used by translation set
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewCP> - new CP ID. Must be linked with application
<lBase> - when it's .T. then get/set base massages CP instead of
translated massages CP
<lTranslate> - if it's .T. then translate base (<lBase>==.T.) or
final messages in I18N set from previous CP to
given one. Base messages translation in synced
with context ID translation.
HB_I18N_PLURALFORM( [<pI18N>,] [<cNewForm>|<bNewForm>], [<lBase>] )
-> <cOldForm>|<bOldForm>
Gets or sets plural form used for final or base messages
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewForm> - language ID of plural form, f.e.: "EN", "PL", "LT".
Now only three above are supported. Please add rules
for other languages to source/rtl/hbi18n.c.
<bNewForm> - codeblock used to calculate plural form indexes.
can be used instead of character representation but
it's not storred in serialized I18N set
<lBase> - when it's .T. then get/set base massages plural form
instead of translated massages one.
HB_I18N_DESCRIPTION( [<pI18N>,] [<cNewDescription>] )
-> <cOldDescription>
Gets or sets translation set description. After serialization
up to 32 bytes is stored in header which can be easy used to
determinate type of translation file.
<pI18N> - I18N translation set,
if it's not given then currently active I18N set is used
<cNewDescription> - new description
HB_I18N_ADDTEXT( <pI18N>, <cMsgID>, <cTrans> | <acTrans> [, <cContext> ] )
-> NIL
Adds new message with translation to i18n translation set
<pI18N> - I18N translation set
<cMsgID> - original message
<cTrans> - translated message
<acTrans> - array with translated messages used for plural forms
<cContext> - message context
HB_I18N_SET( [ <pI18N> | NIL ] )
-> <lActive>
Sets given I18N translation set as default one used by
HB_I18N_[N]GETTEXT[_STRICT]() functions or remove translation
set for calling thread when passed parameter is NIL
<pI18N> - I18N translation set
Returns logical value which is .T. when i18n set is active
HB_I18N_SAVETABLE( [<pI18N>] )
-> <cTable>
Returns I18N translation as string item which can be stored
in file or database
<pI18N> - I18N translation set, if it's not given then currently
active I18N set is used
HB_I18N_RESTORETABLE( <cTable> )
-> <pI18N> | NIL
Restores I18N translation set from strin item.
<cTable> - I18N translation set in string representation
On success it returns new <pI18N> set otherwise NIL if <cTable>
is not valid item created by HB_I18N_SAVETABLE() or it's corrupted.
HB_I18N_HEADERSIZE()
-> <nHeaderSize>
Returns size of header used by i18n serialized version
HB_I18N_CHEK( <cTable> | <cHeader> [, @<cDescription> ] )
-> <lValid>
<cTable> - i18n translation set serialized by HB_I18N_SAVETABLE
<cHeader> - header of i18n translation set
( LEFT( <cTable>, HB_I18N_HEADERSIZE() )
<cDescription> - optional parameter passed by reference where
will be sored i18n translation set description
extracted from valid header
Returns logical value indicating if given table or header is
valid serialized by HB_I18N_SAVETABLE() data. It does not
decode the table though it validates size and control sums.
These functions are optional and some future alternative implementations
may not support all of them and/or may provide some other functions.
+ added unofficial .prg function __I18N_HASHTABLE() which allows to
access hash table used by i18n translation set or create new translation
set with given hash table. It's helper functions for developers which
will work on Harbour i18n tools and should not be used by Harbour users.
Unlike original gettext Harbour allows to use language with many
plural forms as base one. In such case programmer should activate
at application startup default i18n translation set with base plural
form valid for base application language, f.e. by:
pI18N := hb_i18n_create()
hb_i18n_pluralForm( pI18N, <cLangID> | <bForm>, .t. )
hb_i18n_set( pI18N )
.prg code example:
#xtranslate _( <x,...> ) => hb_i18n_gettext_strict( <x> )
#xtranslate _N( <x,...> ) => hb_i18n_ngettext_strict( <x> )
proc main()
local pI18N, i
pI18N := hb_i18n_create()
hb_i18n_pluralForm( pI18N, "PL", .t. )
hb_i18n_set( pI18N )
for i := 0 to 30
? i, _N( i, {"grosz", "grosze", "groszy"} )
if i > 0 .and. i % 10 == 0
wait
endif
next
return
In .pot files created during compilation by Harbour with -j option
for above code we have the following entries for message with plural
forms:
msgid "grosz"
msgid_plural "grosze"
msgid_plural2 "groszy"
msgstr[0] ""
The msgid_plural2 (and others if language has more plural forms)
is Harbour extension which is not gettext compatible.
The above implementation is base version but should be fully functional.
Now we will need functions to safe/read i18n files and tools to mange
.pot files: merge them, edit translations, create final binary i18n
translation sets. Because we are using gettext compatible .pot files
then for some of such jobs we can use original gettext tools but we
need at least function which will create translation set from one or
more .pot files.
We should also agree some default localization(s) for files containing
translated data, their name convention and environment variable(s)
to set default language. It's not strictly necessary and each user
can have his own implementation but it would help in adding new
translations by final users to any Harbour application which will
respect them. We can use LANG envvar to extract preferred language
and use the same path as executed application looking for files
<appname>-<lang>.hil files though it may create some problems for
OSes which support only 8.3 file names so we can also define that
HB_I18N envvar has higher priority and points to expected translation
file.
* harbour/include/hbextern.ch
- removed old __i18n_*() functions
+ added current i18n functions
219 lines
12 KiB
C
219 lines
12 KiB
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* Header file for the Item API
|
|
*
|
|
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
|
* www - http://www.harbour-project.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this software; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*
|
|
* As a special exception, the Harbour Project gives permission for
|
|
* additional uses of the text contained in its release of Harbour.
|
|
*
|
|
* The exception is that, if you link the Harbour libraries with other
|
|
* files to produce an executable, this does not by itself cause the
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
* Your use of that executable is in no way restricted on account of
|
|
* linking the Harbour library code into it.
|
|
*
|
|
* This exception does not however invalidate any other reasons why
|
|
* the executable file might be covered by the GNU General Public License.
|
|
*
|
|
* This exception applies only to the code released by the Harbour
|
|
* Project under the name Harbour. If you copy code from other
|
|
* Harbour Project or Free Software Foundation releases into a copy of
|
|
* Harbour, as the General Public License permits, the exception does
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
* anyone as to the status of such modified files, you must delete
|
|
* this exception notice from them.
|
|
*
|
|
* If you write modifications of your own for Harbour, it is your choice
|
|
* whether to permit this exception to apply to your modifications.
|
|
* If you do not wish that, delete this exception notice.
|
|
*
|
|
*/
|
|
|
|
#ifndef HB_APIITM_H_
|
|
#define HB_APIITM_H_
|
|
|
|
#include "hbapi.h"
|
|
|
|
HB_EXTERN_BEGIN
|
|
|
|
#define HB_EVAL_PARAM_MAX_ 9
|
|
|
|
typedef struct
|
|
{
|
|
USHORT paramCount;
|
|
PHB_ITEM pItems[ HB_EVAL_PARAM_MAX_ + 1 ];
|
|
} HB_EVALINFO, * PHB_EVALINFO;
|
|
|
|
#ifdef HB_LEGACY_LEVEL
|
|
#define EVALINFO HB_EVALINFO
|
|
#define PEVALINFO PHB_EVALINFO
|
|
#define EVALINFO_PTR PHB_EVALINFO
|
|
#endif
|
|
|
|
extern HB_EXPORT PHB_ITEM hb_evalLaunch ( PHB_EVALINFO pEvalInfo );
|
|
extern HB_EXPORT BOOL hb_evalNew ( PHB_EVALINFO pEvalInfo, PHB_ITEM pItem );
|
|
extern HB_EXPORT BOOL hb_evalPutParam ( PHB_EVALINFO pEvalInfo, PHB_ITEM pItem );
|
|
extern HB_EXPORT BOOL hb_evalRelease ( PHB_EVALINFO pEvalInfo );
|
|
|
|
extern HB_EXPORT void hb_evalBlock( PHB_ITEM pCodeBlock, ... );
|
|
extern HB_EXPORT void hb_evalBlock0( PHB_ITEM pCodeBlock );
|
|
extern HB_EXPORT void hb_evalBlock1( PHB_ITEM pCodeBlock, PHB_ITEM pParam );
|
|
|
|
extern HB_EXPORT BOOL hb_execFromArray ( PHB_ITEM pParam );
|
|
|
|
extern HB_EXPORT PHB_ITEM hb_itemDo ( PHB_ITEM pItem, ULONG ulPCount, ... );
|
|
extern HB_EXPORT PHB_ITEM hb_itemDoC ( const char * szFunc, ULONG ulPCount, ... );
|
|
|
|
extern HB_EXPORT PHB_ITEM hb_itemArrayGet ( PHB_ITEM pArray, ULONG ulIndex );
|
|
extern HB_EXPORT PHB_ITEM hb_itemArrayNew ( ULONG ulLen );
|
|
extern HB_EXPORT PHB_ITEM hb_itemArrayPut ( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem );
|
|
extern HB_EXPORT ULONG hb_itemCopyC ( PHB_ITEM pItem, char * szBuffer, ULONG ulLen );
|
|
extern HB_EXPORT BOOL hb_itemFreeC ( char * szText );
|
|
extern HB_EXPORT char * hb_itemGetC ( PHB_ITEM pItem );
|
|
extern HB_EXPORT char * hb_itemGetCPtr ( PHB_ITEM pItem );
|
|
extern HB_EXPORT ULONG hb_itemGetCLen ( PHB_ITEM pItem );
|
|
extern HB_EXPORT char * hb_itemGetDS ( PHB_ITEM pItem, char * szDate );
|
|
extern HB_EXPORT long hb_itemGetDL ( PHB_ITEM pItem );
|
|
extern HB_EXPORT BOOL hb_itemGetL ( PHB_ITEM pItem );
|
|
extern HB_EXPORT double hb_itemGetND ( PHB_ITEM pItem );
|
|
extern HB_EXPORT double hb_itemGetNDDec ( PHB_ITEM pItem, int * piDec );
|
|
extern HB_EXPORT int hb_itemGetNI ( PHB_ITEM pItem );
|
|
extern HB_EXPORT long hb_itemGetNL ( PHB_ITEM pItem );
|
|
extern HB_EXPORT HB_LONG hb_itemGetNInt ( PHB_ITEM pItem );
|
|
extern HB_EXPORT void hb_itemGetNLen ( PHB_ITEM pItem, int * piWidth, int * piDec );
|
|
extern HB_EXPORT void * hb_itemGetPtr ( PHB_ITEM pItem );
|
|
extern HB_EXPORT void * hb_itemGetPtrGC ( PHB_ITEM pItem, HB_GARBAGE_FUNC_PTR pFunc );
|
|
extern HB_EXPORT PHB_SYMB hb_itemGetSymbol ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemNew ( PHB_ITEM pNull );
|
|
extern HB_EXPORT void hb_itemInit ( PHB_ITEM pItem );
|
|
extern HB_EXPORT USHORT hb_itemPCount ( void );
|
|
extern HB_EXPORT PHB_ITEM hb_itemParam ( USHORT uiParam );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutC ( PHB_ITEM pItem, const char * szText );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCL ( PHB_ITEM pItem, const char * szText, ULONG ulLen );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCConst ( PHB_ITEM pItem, const char * szText );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCLConst( PHB_ITEM pItem, const char * szText, ULONG ulLen );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCPtr2 ( PHB_ITEM pItem, char * szText );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCPtr ( PHB_ITEM pItem, char * szText, ULONG ulLen );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutCLPtr ( PHB_ITEM pItem, char * szText, ULONG ulLen );
|
|
extern HB_EXPORT void hb_itemSetCMemo ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutD ( PHB_ITEM pItem, int iYear, int iMonth, int iDay );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutDS ( PHB_ITEM pItem, const char * szDate );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutDL ( PHB_ITEM pItem, long lJulian );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutL ( PHB_ITEM pItem, BOOL bValue );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutND ( PHB_ITEM pItem, double dNumber );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNI ( PHB_ITEM pItem, int iNumber );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNL ( PHB_ITEM pItem, long lNumber );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNInt ( PHB_ITEM pItem, HB_LONG lNumber );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNIntLen( PHB_ITEM pItem, HB_LONG lNumber, int iWidth );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNLen ( PHB_ITEM pItem, double dNumber, int iWidth, int iDec );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNDLen ( PHB_ITEM pItem, double dNumber, int iWidth, int iDec );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNDDec ( PHB_ITEM pItem, double dNumber, int iDec );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNILen ( PHB_ITEM pItem, int iNumber, int iWidth );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNLLen ( PHB_ITEM pItem, long lNumber, int iWidth );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNumType( PHB_ITEM pItem, double dNumber, int iDec, int iType1, int iType2 );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutPtr ( PHB_ITEM pItem, void * pValue );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutPtrGC ( PHB_ITEM pItem, void * pValue );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutSymbol ( PHB_ITEM pItem, PHB_SYMB pSym );
|
|
extern HB_EXPORT BOOL hb_itemRelease ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemReturn ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemReturnForward( PHB_ITEM pItem );
|
|
extern HB_EXPORT void hb_itemReturnRelease( PHB_ITEM pItem );
|
|
extern HB_EXPORT ULONG hb_itemSize ( PHB_ITEM pItem );
|
|
extern HB_EXPORT HB_TYPE hb_itemType ( PHB_ITEM pItem );
|
|
extern HB_EXPORT char * hb_itemTypeStr ( PHB_ITEM pItem );
|
|
#ifndef HB_LONG_LONG_OFF
|
|
extern HB_EXPORT LONGLONG hb_itemGetNLL ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNLL ( PHB_ITEM pItem, LONGLONG lNumber );
|
|
extern HB_EXPORT PHB_ITEM hb_itemPutNLLLen ( PHB_ITEM pItem, LONGLONG lNumber, int iWidth );
|
|
#endif
|
|
|
|
/* Non Clipper compliant internal API */
|
|
|
|
extern HB_EXPORT PHB_ITEM hb_itemParamPtr ( USHORT uiParam, long lMask );
|
|
extern HB_EXPORT BOOL hb_itemParamStore( USHORT uiParam, PHB_ITEM pItem );
|
|
extern HB_EXPORT BOOL hb_itemParamStoreForward( USHORT uiParam, PHB_ITEM pItem );
|
|
extern HB_EXPORT int hb_itemStrCmp ( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ); /* our string compare */
|
|
extern HB_EXPORT int hb_itemStrICmp ( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ); /* our string compare */
|
|
extern HB_EXPORT void hb_itemCopy ( PHB_ITEM pDest, PHB_ITEM pSource ); /* copies an item to one place to another respecting its containts */
|
|
extern HB_EXPORT void hb_itemCopyToRef ( PHB_ITEM pDest, PHB_ITEM pSource );
|
|
extern HB_EXPORT void hb_itemCopyFromRef( PHB_ITEM pDest, PHB_ITEM pSource );
|
|
extern HB_EXPORT void hb_itemMove ( PHB_ITEM pDest, PHB_ITEM pSource ); /* moves the value of an item without incrementing of reference counters, source is cleared */
|
|
extern HB_EXPORT void hb_itemMoveRef ( PHB_ITEM pDest, PHB_ITEM pSource );
|
|
extern HB_EXPORT void hb_itemMoveToRef ( PHB_ITEM pDest, PHB_ITEM pSource );
|
|
extern HB_EXPORT void hb_itemMoveFromRef( PHB_ITEM pDest, PHB_ITEM pSource );
|
|
extern HB_EXPORT void hb_itemClear ( PHB_ITEM pItem );
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnRef ( PHB_ITEM pItem ); /* de-references passed variable */
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnRefOnce ( PHB_ITEM pItem ); /* de-references passed variable, one step*/
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnRefRefer( PHB_ITEM pItem ); /* de-references passed variable, leaving the last reference */
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnRefWrite( PHB_ITEM pItem, PHB_ITEM pSource ); /* de-references passed variable for writing */
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnShare ( PHB_ITEM pItem ); /* un-share given string item */
|
|
extern HB_EXPORT PHB_ITEM hb_itemUnShareString( PHB_ITEM pItem ); /* un-share given string item - the pItem have to be valid unrefed string item */
|
|
extern HB_EXPORT PHB_ITEM hb_itemReSizeString( PHB_ITEM pItem, ULONG ulSize ); /* Resize string buffer of given string item - the pItem have to be valid unrefed string item */
|
|
extern HB_EXPORT PHB_ITEM hb_itemClone ( PHB_ITEM pItem ); /* clone the given item */
|
|
extern HB_EXPORT char * hb_itemStr ( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ); /* convert a number to a string */
|
|
extern HB_EXPORT char * hb_itemString ( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq ); /* Convert any scalar to a string */
|
|
extern HB_EXPORT BOOL hb_itemStrBuf ( char *szResult, PHB_ITEM pNumber, int iSize, int iDec ); /* convert a number to a string */
|
|
extern HB_EXPORT PHB_ITEM hb_itemValToStr ( PHB_ITEM pItem ); /* Convert any scalar to a string */
|
|
extern HB_EXPORT char * hb_itemPadConv ( PHB_ITEM pItem, ULONG * pulSize, BOOL * bFreeReq );
|
|
extern HB_EXPORT void hb_itemSwap ( PHB_ITEM pItem1, PHB_ITEM pItem2 );
|
|
|
|
extern HB_EXPORT char * hb_itemSerialize( PHB_ITEM pItem, BOOL fNumSize, ULONG *pulSize );
|
|
extern HB_EXPORT PHB_ITEM hb_itemDeserialize( const char ** pBufferPtr, ULONG * pulSize );
|
|
|
|
#if defined( _HB_API_INTERNAL_ )
|
|
|
|
# define hb_itemSetNil( item ) do { \
|
|
if( HB_IS_COMPLEX( item ) ) \
|
|
hb_itemClear( item ); \
|
|
else \
|
|
(item)->type = HB_IT_NIL; \
|
|
} while( 0 )
|
|
|
|
# define hb_itemRawCpy( dst, src ) do { *(dst) = *(src); } while( 0 )
|
|
|
|
#if 0
|
|
# define hb_itemRawMove( dst, src ) do { \
|
|
memcpy( (dst), (src), sizeof( HB_ITEM ) ); \
|
|
(src)->type = HB_IT_NIL; \
|
|
} while( 0 )
|
|
#else /* _HB_API_INTERNAL_ */
|
|
# define hb_itemRawMove( dst, src ) hb_itemMove( (dst), (src) )
|
|
#endif
|
|
|
|
#else
|
|
|
|
# define hb_itemSetNil( item ) hb_itemClear( (item) )
|
|
|
|
# define hb_itemRawMove( dst, src ) hb_itemMove( (dst), (src) )
|
|
|
|
#endif /* _HB_API_INTERNAL_ */
|
|
|
|
/* xHarbour compatible function */
|
|
#define hb_itemForwardValue( dst, src ) hb_itemMove( (dst), (src) )
|
|
#define hb_itemPutCStatic( itm, str ) hb_itemPutCConst( (itm), (str) )
|
|
|
|
HB_EXTERN_END
|
|
|
|
#endif /* HB_APIITM_H_ */
|