Files
harbour-core/harbour/contrib/xhb/xhbcomp.prg
Viktor Szakats 924db6f7ed 2012-06-11 15:31 UTC+0200 Viktor Szakats (harbour syenar.net)
* include/harbour.hbx
  * src/vm/dynsym.c
    + added HB_ISFUNCTION( <cName> ) -> <lExists>
      uses Przemek's code from hbfship/ISFUNCTION() with minor
      adaptation for VM.
      Use it instead of __DYNSISFUN() and TYPE( <cName> ) == "UI".

  * include/harbour.hbx
    * formatted HB_IS*() functions used for type checking

  * contrib/hbfship/isfunc.c
    % converted ISFUNCTION() to wrapper for HB_ISFUNCTION()

  * contrib/hbide/ideplugins.prg
  * contrib/hbrun/hbrun.prg
  * contrib/hbxpp/xppop.prg
  * contrib/xhb/xhbcomp.prg
  * contrib/xhb/xhberr.prg
  * examples/hbdoc/hbdoc.prg
    % Using HB_ISFUNCTION() instead of __DYNSISFUN() and TYPE( <cName> ) == "UI"
2012-06-11 13:32:11 +00:00

141 lines
4.8 KiB
Plaintext

/*
* $Id$
*/
/*
* Harbour Project source code:
* xhb compatibility functions
*
* Copyright 2007 Viktor Szakats (harbour syenar.net)
* 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 "common.ch"
#include "hbclass.ch"
ANNOUNCE XHB_LIB
/* It's a hack which directly manipulates class definition.
* It should not be used in user code. [druzus]
*/
#xcommand OPTIONAL INHERIT <!className!> => ;
IF hb_IsFunction( <"className"> ) ;;
AAdd( oClass:asSuper, @__<className>() ) ;;
ENDIF
INIT PROCEDURE xhb_Init()
/* Add calls to do initial settings to Harbour to be more compatible with xhb. */
ASSOCIATE CLASS _Character WITH TYPE Character
ASSOCIATE CLASS _Numeric WITH TYPE Numeric
ASSOCIATE CLASS _Array WITH TYPE Array
ASSOCIATE CLASS _Hash WITH TYPE Hash
ASSOCIATE CLASS _Block WITH TYPE Block
RETURN
CREATE CLASS Character FUNCTION _Character
OPTIONAL INHERIT HBCharacter
OPERATOR "[]" FUNCTION XHB_INDEX()
OPERATOR "+" FUNCTION XHB_PLUS()
OPERATOR "-" FUNCTION XHB_MINUS()
OPERATOR "*" FUNCTION XHB_MULT()
OPERATOR "/" FUNCTION XHB_DIV()
OPERATOR "%" FUNCTION XHB_MOD()
OPERATOR "^" FUNCTION XHB_POW()
OPERATOR "++" FUNCTION XHB_INC()
OPERATOR "--" FUNCTION XHB_DEC()
OPERATOR "==" FUNCTION XHB_EEQUAL()
OPERATOR "=" FUNCTION XHB_EQUAL()
OPERATOR "<>" FUNCTION XHB_NOTEQUAL()
OPERATOR "<" FUNCTION XHB_LESS()
OPERATOR "<=" FUNCTION XHB_LESSEQ()
OPERATOR ">" FUNCTION XHB_GREATER()
OPERATOR ">=" FUNCTION XHB_GREATEREQ()
ENDCLASS
CREATE CLASS Numeric FUNCTION _Numeric
OPTIONAL INHERIT HBNumeric
OPERATOR "+" FUNCTION XHB_PLUS()
OPERATOR "-" FUNCTION XHB_MINUS()
OPERATOR "*" FUNCTION XHB_MULT()
OPERATOR "/" FUNCTION XHB_DIV()
OPERATOR "%" FUNCTION XHB_MOD()
OPERATOR "^" FUNCTION XHB_POW()
OPERATOR "++" FUNCTION XHB_INC()
OPERATOR "--" FUNCTION XHB_DEC()
OPERATOR "==" FUNCTION XHB_EEQUAL()
OPERATOR "=" FUNCTION XHB_EQUAL()
OPERATOR "<>" FUNCTION XHB_NOTEQUAL()
OPERATOR "<" FUNCTION XHB_LESS()
OPERATOR "<=" FUNCTION XHB_LESSEQ()
OPERATOR ">" FUNCTION XHB_GREATER()
OPERATOR ">=" FUNCTION XHB_GREATEREQ()
ENDCLASS
CREATE CLASS Array FUNCTION _Array
OPTIONAL INHERIT HBArray
OPERATOR "[]" FUNCTION XHB_INDEX()
OPERATOR "$$" FUNCTION XHB_INCLUDE()
ENDCLASS
CREATE CLASS Hash INHERIT __HBHash FUNCTION _Hash
OPTIONAL INHERIT HBHash
ON ERROR FUNCTION XHB_HASHERROR()
OPERATOR "+" FUNCTION XHB_PLUS()
OPERATOR "-" FUNCTION XHB_MINUS()
OPERATOR "$$" FUNCTION XHB_INCLUDE()
OPERATOR "=" FUNCTION XHB_EQUAL()
OPERATOR "<>" FUNCTION XHB_NOTEQUAL()
ENDCLASS
CREATE CLASS Block FUNCTION _Block
OPTIONAL INHERIT HBBlock
OPERATOR "==" FUNCTION XHB_EEQUAL()
ENDCLASS