* harbour/src/vm/procaddr.c
! removed dummy entry at the end of function table
* harbour/src/common/hbstr.c
* harbour/src/rdd/dbfcdx/dbfcdx1.c
* harbour/src/rdd/hsx/hsx.c
* harbour/contrib/xhb/fparse.c
* pacified warnings
* harbour/include/hbsetup.h
* disabled flatten function attribute in ANDROID builds,
it causes that Android_NDK-GCC GPFs compiling src/vm/procaddr.c
* harbour/include/hbdate.h
* enabled localtime_r() in Android builds
* harbour/src/common/hbgete.c
* enabled setenv() in Android builds
* harbour/src/common/hbtrace.c
! fixed ANDROID_LOG_* flags
; QUESTION: why Android log is used instead of syslog?
It causes that harbour has to be linked with
log library (-llog).
* harbour/src/common/hbprintf.c
* disabled modfl() in Android builds
* harbour/src/rtl/filesys.c
* added hack for missing functions in android libc library
* harbour/src/rtl/diskspac.c
* harbour/src/rtl/disksphb.c
* use statfs instead of statvfs in Android builds
* harbour/contrib/hbct/dattime3.c
* disabled stime() in Android builds
* harbour/contrib/hbmzip/3rd/minizip/ioapi.h
* do not use 64bit FILE functions in Android builds
* harbour/contrib/xhb/hbsyslog.c
* disabled using Android log in Android builds - use standard syslog
instead. This code needs deeper modification to switch to Android log.
; I have just recompiled whole Harbour code for android-3, android-5
and android-9 at ARM using standard Harbour Linux build files.
Android does not have pthread and rt libraries (they are merged
with android c library) so to avoid link errors I simply created
soft links from libpthread.a and librt.a to libc.a.
With this hack could use unmodified hbmk2 and linux .mk files.
BTW exporting HB_CPU="arm" was not enough to switch to cross build
in my x86@64 Linux machine so I had to export HB_HOST_BIN and set
HB_BUILD_3RDEXT="no"
142 lines
6.9 KiB
C
142 lines
6.9 KiB
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* Function to export chosen addresses of public API function
|
|
*
|
|
* Copyright 2010 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
* www - http://harbour-project.org
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this software; see the file COPYING. If not, write to
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
|
*
|
|
* As a special exception, the Harbour Project gives permission for
|
|
* additional uses of the text contained in its release of Harbour.
|
|
*
|
|
* The exception is that, if you link the Harbour libraries with other
|
|
* files to produce an executable, this does not by itself cause the
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
* Your use of that executable is in no way restricted on account of
|
|
* linking the Harbour library code into it.
|
|
*
|
|
* This exception does not however invalidate any other reasons why
|
|
* the executable file might be covered by the GNU General Public License.
|
|
*
|
|
* This exception applies only to the code released by the Harbour
|
|
* Project under the name Harbour. If you copy code from other
|
|
* Harbour Project or Free Software Foundation releases into a copy of
|
|
* Harbour, as the General Public License permits, the exception does
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
* anyone as to the status of such modified files, you must delete
|
|
* this exception notice from them.
|
|
*
|
|
* If you write modifications of your own for Harbour, it is your choice
|
|
* whether to permit this exception to apply to your modifications.
|
|
* If you do not wish that, delete this exception notice.
|
|
*
|
|
*/
|
|
|
|
#include "hbapi.h"
|
|
#include "hbvm.h"
|
|
|
|
PHB_FUNC hb_vmProcAddress( const char * szFuncName )
|
|
{
|
|
typedef struct
|
|
{
|
|
const char * szFuncName;
|
|
PHB_FUNC pFuncAddr;
|
|
}
|
|
HB_FUNC_REF_ADDR;
|
|
|
|
/* NOTE: this table must be well sorted by function names */
|
|
static const HB_FUNC_REF_ADDR s_funcTable[] =
|
|
{
|
|
{ "hb_arrayAdd", ( PHB_FUNC ) hb_arrayAdd },
|
|
{ "hb_arrayDel", ( PHB_FUNC ) hb_arrayDel },
|
|
{ "hb_arrayGet", ( PHB_FUNC ) hb_arrayGet },
|
|
{ "hb_arrayIns", ( PHB_FUNC ) hb_arrayIns },
|
|
{ "hb_arrayIsObject", ( PHB_FUNC ) hb_arrayIsObject },
|
|
{ "hb_arrayLast", ( PHB_FUNC ) hb_arrayLast },
|
|
{ "hb_arrayLen", ( PHB_FUNC ) hb_arrayLen },
|
|
{ "hb_arrayNew", ( PHB_FUNC ) hb_arrayNew },
|
|
{ "hb_arraySet", ( PHB_FUNC ) hb_arraySet },
|
|
{ "hb_arraySize", ( PHB_FUNC ) hb_arraySize },
|
|
{ "hb_extIsArray", ( PHB_FUNC ) hb_extIsArray },
|
|
{ "hb_param", ( PHB_FUNC ) hb_param },
|
|
{ "hb_paramError", ( PHB_FUNC ) hb_paramError },
|
|
{ "hb_parinfa", ( PHB_FUNC ) hb_parinfa },
|
|
{ "hb_parinfo", ( PHB_FUNC ) hb_parinfo },
|
|
{ "hb_parvc", ( PHB_FUNC ) hb_parvc },
|
|
{ "hb_parvclen", ( PHB_FUNC ) hb_parvclen },
|
|
{ "hb_parvcsiz", ( PHB_FUNC ) hb_parvcsiz },
|
|
{ "hb_parvds", ( PHB_FUNC ) hb_parvds },
|
|
{ "hb_parvdsbuff", ( PHB_FUNC ) hb_parvdsbuff },
|
|
{ "hb_parvl", ( PHB_FUNC ) hb_parvl },
|
|
{ "hb_parvnd", ( PHB_FUNC ) hb_parvnd },
|
|
{ "hb_parvni", ( PHB_FUNC ) hb_parvni },
|
|
{ "hb_parvnl", ( PHB_FUNC ) hb_parvnl },
|
|
{ "hb_pcount", ( PHB_FUNC ) hb_pcount },
|
|
{ "hb_ret", ( PHB_FUNC ) hb_ret },
|
|
{ "hb_reta", ( PHB_FUNC ) hb_reta },
|
|
{ "hb_retc", ( PHB_FUNC ) hb_retc },
|
|
{ "hb_retclen", ( PHB_FUNC ) hb_retclen },
|
|
{ "hb_retd", ( PHB_FUNC ) hb_retd },
|
|
{ "hb_retdl", ( PHB_FUNC ) hb_retdl },
|
|
{ "hb_retds", ( PHB_FUNC ) hb_retds },
|
|
{ "hb_retl", ( PHB_FUNC ) hb_retl },
|
|
{ "hb_retnd", ( PHB_FUNC ) hb_retnd },
|
|
{ "hb_retndlen", ( PHB_FUNC ) hb_retndlen },
|
|
{ "hb_retni", ( PHB_FUNC ) hb_retni },
|
|
{ "hb_retnilen", ( PHB_FUNC ) hb_retnilen },
|
|
{ "hb_retnl", ( PHB_FUNC ) hb_retnl },
|
|
{ "hb_retnlen", ( PHB_FUNC ) hb_retnlen },
|
|
{ "hb_retnllen", ( PHB_FUNC ) hb_retnllen },
|
|
{ "hb_storvc", ( PHB_FUNC ) hb_storvc },
|
|
{ "hb_storvclen", ( PHB_FUNC ) hb_storvclen },
|
|
{ "hb_storvds", ( PHB_FUNC ) hb_storvds },
|
|
{ "hb_storvl", ( PHB_FUNC ) hb_storvl },
|
|
{ "hb_storvnd", ( PHB_FUNC ) hb_storvnd },
|
|
{ "hb_storvni", ( PHB_FUNC ) hb_storvni },
|
|
{ "hb_storvnl", ( PHB_FUNC ) hb_storvnl },
|
|
{ "hb_vmExecute", ( PHB_FUNC ) hb_vmExecute },
|
|
{ "hb_vmProcessSymbols", ( PHB_FUNC ) hb_vmProcessDynLibSymbols },
|
|
{ "hb_xalloc", ( PHB_FUNC ) hb_xalloc },
|
|
{ "hb_xfree", ( PHB_FUNC ) hb_xfree },
|
|
{ "hb_xgrab", ( PHB_FUNC ) hb_xgrab },
|
|
{ "hb_xrealloc", ( PHB_FUNC ) hb_xrealloc }
|
|
};
|
|
|
|
unsigned int uiFirst = 0, uiLast = HB_SIZEOFARRAY( s_funcTable ), uiMiddle;
|
|
int iCmp;
|
|
|
|
do
|
|
{
|
|
uiMiddle = ( uiFirst + uiLast ) >> 1;
|
|
iCmp = strcmp( szFuncName, s_funcTable[ uiMiddle ].szFuncName );
|
|
if( iCmp <= 0 )
|
|
uiLast = uiMiddle;
|
|
else
|
|
uiFirst = uiMiddle + 1;
|
|
}
|
|
while( uiFirst < uiLast );
|
|
|
|
if( uiFirst != uiMiddle )
|
|
iCmp = strcmp( szFuncName, s_funcTable[ uiFirst ].szFuncName );
|
|
|
|
return iCmp == 0 ? s_funcTable[ uiFirst ].pFuncAddr : NULL;
|
|
}
|