//===================== habapi.h =============================#ifdef
0/*
* $Id: hbapi.h,v 1.219 2007/09/25 07:32:32 marchuet Exp $
*//*
* Harbour Project source code:
* Header file for the Extend API, Array API, misc API and base declarations
*
* 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.
*
*//* TOFIX: There are several things in this file which are not part of the
standard Harbour API, in other words these things are not
guaranteed to remain unchanged. To avoid confusion these should be
moved to somewhere else (like HBRTL.H). [vszakats] */#ifndef HB_APIEXT_H_
#define HB_APIEXT_H_
#include "hbvmpub.h"HB_EXTERN_BEGIN
// .../* Extend API */extern HB_EXPORT char * hb_parc
( int iParam, ...
);
/* retrieve a string parameter */extern HB_EXPORT char * hb_parcx
( int iParam, ...
);
/* retrieve a string parameter */extern HB_EXPORT ULONG hb_parclen
( int iParam, ...
);
/* retrieve a string parameter length */extern HB_EXPORT ULONG hb_parcsiz
( int iParam, ...
);
/* retrieve a by-reference string parameter length, including terminator */extern HB_EXPORT char * hb_pards
( int iParam, ...
);
/* retrieve a date as a string yyyymmdd */extern HB_EXPORT char * hb_pardts
( int iParam, ...
);
/* retrieve a date as a string yyyymmddhhmmss.ccc */extern HB_EXPORT char * hb_pardsbuff
( char * szDate, int iParam, ...
);
/* retrieve a date as a string yyyymmdd */extern HB_EXPORT char * hb_pardtsbuff
( char * szDateTime, int iParam, ...
);
/* retrieve a date as a string yyyymmddhhmmss.ccc */extern HB_EXPORT LONG hb_pardl
( int iParam, ...
);
/* retrieve a date as long integer - number of days from Julian's day */extern HB_EXPORT LONG hb_part
( int iParam, ...
);
/* retrieve a time part from a datetime as long in milliseconds */extern HB_EXPORT double hb_pardtd
( int iParam, ...
);
/* retrieve a datetime as double - number of days from Julian's day plus time as decimal part of date */extern HB_EXPORT double hb_pardtsec
( int iParam, ...
);
/* retrieve a datetime as double - number of seconds from Julian's day plus time */extern HB_EXPORT ULONG hb_parinfa
( int iParamNum, ULONG uiArrayIndex
);
/* retrieve length or element type of an array parameter */extern HB_EXPORT ULONG hb_parinfo
( int iParam
);
/* Determine the param count or data type */extern HB_EXPORT int hb_parl
( int iParam, ...
);
/* retrieve a logical parameter as an int */extern HB_EXPORT double hb_parnd
( int iParam, ...
);
/* retrieve a numeric parameter as a double */extern HB_EXPORT int hb_parni
( int iParam, ...
);
/* retrieve a numeric parameter as a integer */extern HB_EXPORT LONG hb_parnl
( int iParam, ...
);
/* retrieve a numeric parameter as a LONG */extern HB_EXPORT HB_LONG hb_parnint
( int iParam, ...
);
/* retrieve a numeric parameter as a HB_LONG */extern HB_EXPORT void * hb_parptr
( int iParam, ...
);
/* retrieve a parameter as a pointer */extern HB_EXPORT void * hb_parptrGC
( HB_GARBAGE_FUNC_PTR pFunc, int iParam, ...
);
/* retrieve a parameter as a pointer if it's a pointer to GC allocated block */extern HB_EXPORT PHB_ITEM hb_param
( int iParam, LONG lMask
);
/* retrieve a generic parameter */extern HB_EXPORT PHB_ITEM hb_paramError
( int iParam
);
/* Returns either the generic parameter or a NIL item if param not provided */extern HB_EXPORT BOOL hb_extIsArray
( int iParam
);
extern HB_EXPORT BOOL hb_extIsObject
( int iParam
);
#ifndef HB_LONG_LONG_OFF
extern LONGLONG HB_EXPORT hb_parnll
( int iParam, ...
);
/* retrieve a numeric parameter as a double */#endif
#define hb_retc_buffer
( szText
) hb_retcAdopt
( (szText
) )#define hb_retclen_buffer
( szText, ulLen
) hb_retclenAdopt
( (szText
),
(ulLen
) )#define hb_retc_const
( szText
) hb_retcStatic
( (szText
) )#ifndef HB_ARRAY_COUNTER_DEFAULT_HOLDERS
#define HB_ARRAY_COUNTER_DEFAULT_HOLDERS
1#endif
#define HB_VAR_PARAM_FLAG
255#ifdef HB_API_MACROS
#include "hbapiitm.h" #ifndef HB_COMP_H_
#include "hbstack.h" #endif
#define hb_pcount
() ( ( int
) ( ( * HB_VM_STACK.pBase
)->item.asSymbol.paramcnt
) ) #define hb_ret
() hb_itemClear
( hb_stackReturnItem
() ) #define hb_reta
( ulLen
) hb_arrayNew
( hb_stackReturnItem
(),
(ulLen
) ) #define hb_retc
( szText
) hb_itemPutC
( hb_stackReturnItem
(),
(szText
) ) #define hb_retclen
( szText, ulLen
) hb_itemPutCL
( hb_stackReturnItem
(),
(szText
),
(ulLen
) ) #define hb_retcAdopt
( szText
) hb_itemPutCPtr
( hb_stackReturnItem
(),
(szText
),
( (szText
) ?
strlen( szText
) :
0 ) ) #define hb_retclenAdopt
( szText, ulLen
) hb_itemPutCPtr
( hb_stackReturnItem
(),
(szText
),
(ulLen
) ) #define hb_retcStatic
( szText
) hb_itemPutCStatic
( hb_stackReturnItem
(),
(szText
) ) #define hb_retclenStatic
( szText, ulLen
) hb_itemPutCLStatic
( hb_stackReturnItem
(),
(szText
),
(ulLen
) ) #define hb_retclenAdoptRaw
( szText, ulLen
) hb_itemPutCRaw
( hb_stackReturnItem
(),
(szText
),
(ulLen
) ) #define hb_retds
( szDate
) hb_itemPutDS
( hb_stackReturnItem
(),
(szDate
) ) #define hb_retdts
( szDateTime
) hb_itemPutDTS
( hb_stackReturnItem
(),
(szDateTime
) ) #define hb_retd
( iYear, iMonth, iDay
) hb_itemPutD
( hb_stackReturnItem
(),
(iYear
),
(iMonth
),
(iDay
) ) #define hb_retdl
( lJulian
) hb_itemPutDL
( hb_stackReturnItem
(),
(lJulian
) ) #define hb_retdt
( iYear, iMonth, iDay, iHour, iMin, dSec, iAmPm
) hb_itemPutDT
( hb_stackReturnItem
(),
(iYear
),
(iMonth
),
(iDay
),
(iHour
),
(iMin
),
(dSec
),
(iAmPm
) ) #define hb_retdtd
( dDateTime
) hb_itemPutDTD
( hb_stackReturnItem
(),
(dDateTime
) ) #define hb_retdtl
( lDate, lTime
) hb_itemPutDTL
( hb_stackReturnItem
(),
(lDate
),
(lTime
) ) #define hb_retl
( iLogical
) hb_itemPutL
( hb_stackReturnItem
(),
(iLogical
) ?
TRUE :
FALSE ) #define hb_retnd
( dNumber
) hb_itemPutND
( hb_stackReturnItem
(),
(dNumber
) ) #define hb_retni
( iNumber
) hb_itemPutNI
( hb_stackReturnItem
(),
(iNumber
) ) #define hb_retnl
( lNumber
) hb_itemPutNL
( hb_stackReturnItem
(),
(lNumber
) ) #define hb_retnlen
( dNumber, iWidth, iDec
) hb_itemPutNLen
( hb_stackReturnItem
(),
(dNumber
),
(iWidth
),
(iDec
) ) #define hb_retndlen
( dNumber, iWidth, iDec
) hb_itemPutNDLen
( hb_stackReturnItem
(),
(dNumber
),
(iWidth
),
(iDec
) ) #define hb_retnilen
( iNumber, iWidth
) hb_itemPutNILen
( hb_stackReturnItem
(),
(iNumber
),
(iWidth
) ) #define hb_retnllen
( lNumber, iWidth
) hb_itemPutNLLen
( hb_stackReturnItem
(),
(lNumber
),
(iWidth
) ) #define hb_retptr
( voidPtr
) hb_itemPutPtr
( hb_stackReturnItem
(),
(voidPtr
) ) #define hb_retptrGC
( voidPtr
) hb_itemPutPtrGC
( hb_stackReturnItem
(),
(voidPtr
) ) #define hb_retnint
( llNumber
) hb_itemPutNInt
( hb_stackReturnItem
(),
(llNumber
) ) #define hb_retnintlen
( llNumber, iWidth
) hb_itemPutNIntLen
( hb_stackReturnItem
(),
(llNumber
),
(iWidth
) ) #define hb_retnll
( llNumber
) hb_itemPutNLL
( hb_stackReturnItem
(),
(llNumber
) ) #define hb_retnlllen
( llNumber, iWidth
) hb_itemPutNLLLen
( hb_stackReturnItem
(),
(llNumber
),
(iWidth
) )#else
/* JC1: including thread anyways, because it defines some void macros when not in MT */ #include "thread.h" extern int HB_EXPORT hb_pcount
( void
);
/* returns the number of suplied parameters */ extern void HB_EXPORT hb_ret
( void
);
/* post a NIL return value */ extern void HB_EXPORT hb_retc
( const char * szText
);
/* returns a string */ extern void HB_EXPORT hb_retclen
( const char * szText, ULONG ulLen
);
/* returns a string with a specific length */ extern void HB_EXPORT hb_retcAdopt
( char * szText
);
extern void HB_EXPORT hb_retclenAdopt
( char * szText, ULONG ulLen
);
extern void HB_EXPORT hb_retclenAdoptRaw
( char * szText, ULONG ulLen
);
extern void HB_EXPORT hb_retcStatic
( const char * szText
);
extern void HB_EXPORT hb_retclenStatic
( const char * szText, ULONG ulLen
);
extern void HB_EXPORT hb_retclenRaw
( char * szText, ULONG ulLen
);
extern void HB_EXPORT hb_retds
( const char * szDate
);
/* returns a date, must use yyyymmdd format */ extern void HB_EXPORT hb_retdts
( char * szDateTime
);
/* returns a date, must use yyyymmdd hh:mm:ss.cc format */ extern void HB_EXPORT hb_retd
( int iYear, int iMonth, int iDay
);
/* returns a date */ extern void HB_EXPORT hb_retdl
( LONG lJulian
);
/* returns a LONG value as a julian date */ extern void HB_EXPORT hb_retdt
( int iYear, int iMonth, int iDay, int iHour, int iMin, double dSec, int iAmPm
);
/* returns a datetime */ extern void HB_EXPORT hb_retdtd
( double dDateTime
);
/* returns a datetime as double */ extern void HB_EXPORT hb_retdtl
( LONG lDate, LONG lTime
);
/* returns a datetime as JulianÝs date and seconds */ extern void HB_EXPORT hb_retl
( int iTrueFalse
);
/* returns a logical integer */ extern void HB_EXPORT hb_retnd
( double dNumber
);
/* returns a double */ extern void HB_EXPORT hb_retni
( int iNumber
);
/* returns a integer number */ extern void HB_EXPORT hb_retnl
( LONG lNumber
);
/* returns a LONG number */ extern void HB_EXPORT hb_retnlen
( double dNumber, int iWidth, int iDec
);
/* returns a double, with specific width and decimals */ extern void HB_EXPORT hb_retndlen
( double dNumber, int iWidth, int iDec
);
/* returns a double, with specific width and decimals */ extern void HB_EXPORT hb_retnilen
( int iNumber, int iWidth
);
/* returns a integer number, with specific width */ extern void HB_EXPORT hb_retnllen
( LONG lNumber, int iWidth
);
/* returns a LONG number, with specific width */ extern void HB_EXPORT hb_reta
( ULONG ulLen
);
/* returns an array with a specific length */ extern void HB_EXPORT hb_retptr
( void * voidPtr
);
/* returns a pointer */ extern void HB_EXPORT hb_retptrGC
( void * voidPtr
);
/* returns a pointer to an allocated memory, collected by GC */ extern void HB_EXPORT hb_retnint
( HB_LONG llNumber
);
extern void HB_EXPORT hb_retnintlen
( HB_LONG llNumber, int iWidth
);
#ifndef HB_LONG_LONG_OFF
extern void HB_EXPORT hb_retnll
( LONGLONG llNumber
);
/* returns a long long int */ extern void HB_EXPORT hb_retnlllen
( LONGLONG llNumber, int iWidth
);
/* returns a long long int, with specific width */#endif
#endif
extern void HB_EXPORT hb_storc
( char * szText, int iParam, ...
);
/* stores a szString on a variable by reference */extern void HB_EXPORT hb_storclen
( char * szText, ULONG ulLength, int iParam, ...
);
/* stores a fixed length string on a variable by reference */extern void HB_EXPORT hb_storclenAdopt
( char * szText, ULONG ulLength, int iParam, ...
);
/* stores a fixed length string on a variable by reference */extern void HB_EXPORT hb_stords
( char * szDate, int iParam, ...
);
/* szDate must have yyyymmdd format */extern void HB_EXPORT hb_stordts
( char * szDateTime, int iParam, ...
);
/* szDate must have yyyymmdd format */extern void HB_EXPORT hb_stord
( int iYear, int iMonth, int iDay, int iParam, ...
);
/* stores a Julian's date value on a variable by reference */extern void HB_EXPORT hb_stordt
( int iYear, int iMonth, int iDay, int iHour, int iMin, double dSec, int iAmPm, int iParam, ...
);
/* stores a Julian's date value on a variable by reference */extern void HB_EXPORT hb_stordl
( LONG lJulian, int iParam, ...
);
/* stores a Julian's date value on a variable by reference */extern void HB_EXPORT hb_stordtd
( double dDateTime, int iParam, ...
);
/* stores a date and time double on a variable by reference */extern void HB_EXPORT hb_stordtl
( LONG lDate, LONG lTime, int iParam, ...
);
/* stores a logical integer on a variable by reference */extern void HB_EXPORT hb_storl
( int iLogical, int iParam, ...
);
/* stores a logical integer on a variable by reference */extern void HB_EXPORT hb_storni
( int iValue, int iParam, ...
);
/* stores an integer on a variable by reference */extern void HB_EXPORT hb_stornl
( LONG lValue, int iParam, ...
);
/* stores a LONG on a variable by reference */extern void HB_EXPORT hb_stornint
( HB_LONG lValue, int iParam, ...
);
/* stores a HB_LONG on a variable by reference */extern void HB_EXPORT hb_stornd
( double dValue, int iParam, ...
);
/* stores a double on a variable by reference */extern void HB_EXPORT hb_storptr
( void * pointer, int iParam, ...
);
/* stores a pointer on a variable by reference */// ...#endif