* harbour/harbour.spec
* harbour/make_bsd.sh
* harbour/make_drw.sh
* harbour/make_gnu.sh
* harbour/make_rpm.sh
* harbour/make_tgz.sh
* harbour/bin/hb-func.sh
* harbour/bin/pack_src.sh
* harbour/config/c.cf
* harbour/config/global.cf
* harbour/config/rules.cf
* harbour/config/darwin/gcc.cf
* harbour/config/darwin/global.cf
* harbour/config/dos/djgpp.cf
* harbour/config/dos/global.cf
* harbour/config/dos/install.cf
* harbour/config/dos/owatcom.cf
* harbour/config/hpux/gcc.cf
* harbour/config/hpux/global.cf
* harbour/config/linux/gcc.cf
* harbour/config/linux/global.cf
* harbour/config/linux/owatcom.cf
* harbour/config/sunos/gcc.cf
* harbour/config/w32/watcom.cf
* include ADSRDD by default in RPMs
* updated for new RPM which does not accept some old tags
* set -fPIC on 64bit platforms
+ added /etc/harbour/hb-charmap.def
* updated for new GT system and drivers
* harbour/contrib/dot/pp.prg
* harbour/contrib/dot/pp_harb.ch
* use _APMAIN as startup function
* cleaned direct access to item internals
* harbour/contrib/libct/Makefile
+ harbour/contrib/libct/ctwfunc.c
+ harbour/contrib/libct/ctwin.c
+ harbour/contrib/libct/ctwin.h
* added CT3 like Window System - it's a GT driver which inherits
from the existing one and adds CTW functionality
* harbour/contrib/libct/screen1.c
* updated for GTAPI modifications
* harbour/contrib/libnf/Makefile
* harbour/contrib/libnf/chdir.c
* harbour/contrib/libnf/mkdir.c
* harbour/contrib/libnf/rmdir.c
* use hb_fs*() API functions instead of calling DOS interrupts
Now NF dir functions works on all platforms - it will be nice
to update other functions too.
* harbour/contrib/libnf/dispc.c
* harbour/contrib/libnf/ftattr.c
* updated for GT API modifications, some of this code still depends
on EGA/VGA video buffer so will work only if user will force in GT
using it - it will be nice to rewrite them
* harbour/contrib/odbc/odbc.c
* harbour/contrib/ole/ole2.c
* casting and cleaning direct access to item internals
* harbour/contrib/rdd_ads/ads1.c
* harbour/contrib/rdd_ads/adsfunc.c
* harbour/contrib/rdd_ads/adsmgmnt.c
* synced with xHarbour
* harbour/include/Makefile
* added new header files
+ harbour/include/hbgtinfo.ch
+ added GTI_* defintions for hb_gtInfo() function.
This function works in similar way to dbInfo() in RDD.
The GTI_* definitions are taken from xHarbour "as is" and
they should be cleaned - not all functionality are supported
in Harbour and some others should be implemented in differ
way then in xHarbour.
+ harbour/include/hbgtcore.h
* harbour/include/hbapigt.h
* new GTAPI
hbgtcore.h file should not be included by user code
it's only for internal use in GT drivers
* HB_inkey_enum changed to int - this is bit field not enumerated type.
Many of C/C++ compilers forbid bit operations on enum types and
forcing it by casting which finally exceeds the enum range is defined
as bug because it may badly interacts with some compiler optimizations
* harbour/include/hbapi.h
* harbour/include/hbapicdp.h
* harbour/include/hbapierr.h
* harbour/include/hbapifs.h
* harbour/include/hbapiitm.h
* harbour/include/hbapilng.h
* harbour/include/hbapirdd.h
* harbour/include/hbdate.h
* harbour/include/hbdefs.h
* harbour/include/hbinit.h
* harbour/include/hbpcode.h
* harbour/include/hbrdddbf.h
* harbour/include/hbset.h
* harbour/include/hbstack.h
* harbour/include/hbvm.h
* harbour/include/hbvmopt.h
* harbour/include/hbvmpub.h
* separated internal and external API. Now the definitions for
internal HVM structures and functions are excluded by default
they could be enabled if user include hbvmopt.h before other
header files. Such operation should be done _ONLY_ by core
code - if 3-rd party developers make sth like that then it's
for their own risk and such code may stop to work with next
Harbour versions. Without hbvmopt.h the internal structures
like HB_ITEM, HB_DYNS, ... are mapped to 'void' so there is
no way to access their members so we can modify them in the
future without afford for 3-rd party code.
There is one small exception 'type' should be the first member
for HB_ITEM structure because I used a small ugly hack in
HB_IS_*() macros with castin PHB_ITEM to HB_TYPE* - it works
without speed overhead but if you think that it will be
better/cleaner to not use such tricks then it's enough to
change HB_ITEM_TYPE() definitions in hbvmpub.h - see note.
* cleared the usage of HB_EXPORT - to avoid problems with some C/C++
compilers we agreed that the only one common way of using HB_EXPORT
is adding it ad begining of declaration - please keep this convention
in the future.
+ added new functions:
hb_extIsObject(), hb_codeblockId(), hb_idleSleep(),
hb_fsGetOsHandle(),
hb_dynsymFindSymbol(), hb_dynsymGetSymbol(),
hb_dynsymSymbol(), hb_dynsymName(),
hb_dynsymMemvarHandle(), hb_dynsymAreaHandle(), hb_dynsymSetAreaHandle()
* changed hb_arrayClone() declaration to:
PHB_ITEM hb_arrayClone( PHB_ITEM pArray )
* changed hb_arrayFromParams() declaration to:
PHB_ITEM hb_arrayFromParams( int iLevel )
The previous version needed a pointer to stack relocatable area
so any stack resizing could cause GPF.
* harbour/include/inkey.ch
* added definitions for extended mouse keys/events and some key
combinations
* harbour/source/codepage/uc1250.c
* harbour/source/codepage/uc1251.c
* harbour/source/codepage/uc1253.c
* harbour/source/codepage/uc1257.c
* harbour/source/codepage/uc737.c
* harbour/source/codepage/uc850.c
* harbour/source/codepage/uc852.c
* harbour/source/codepage/uc866.c
* harbour/source/codepage/uc88591b.c
* harbour/source/codepage/uc8859_1.c
* harbour/source/codepage/uc8859_2.c
* harbour/source/codepage/uc8859_5.c
* harbour/source/codepage/uckoi8.c
* harbour/source/codepage/uckoi8u.c
* harbour/source/codepage/ucmaz.c
* updated unicode values for characters in rabge 1-31 to keep
DOS compatibility
* harbour/source/common/expropt1.c
* harbour/source/common/hbarch.c
* harbour/source/common/hbdate.c
* harbour/source/common/hbstr.c
* harbour/source/common/hbver.c
* keep HB_EXPORT at the beginning of function declaration
* harbour/include/hbpcode.h
* harbour/include/hbcomp.h
* harbour/source/compiler/harbour.c
* harbour/source/compiler/harbour.y
* harbour/source/compiler/hbfix.c
+ harbour/source/compiler/hbdead.c
* harbour/source/compiler/hbpcode.c
+ harbour/source/compiler/hbstripl.c
% rewritten jump optimization
! fixed some minor problems
* do not optimize jumps and local variable access by shorter
PCODE version and HB_P_NOOP when jump optimization is
disabled, this is a note I left in source code in few places:
/*
* optimizing jumps here by shorting them and setting HB_P_NOOPs
* only slow down the compilation process for three reasons:
* 1. When it's dummy jump to next instruction we need two passes
* in hb_compOptimizeJumps() to fully remove it
* 2. hb_compOptimizeJumps() also make jump shortcutting in each pass
* 3. When Jump Optimization is disabled (-kJ) then it cause slowness
* at runtime because we will have more HVM loops: first for the
* shorter jump and next for the HB_P_NOOP PCODE(s)
* [druzuz]
*/
+ added support for multi passes in jump/dead code elimination
(hb_compOptimizeJumps())
By default is set upto three passes.
Now hb_compOptimizeJumps() keeps all compiler internal data clean
on exist and can be called any times and does not change other
compiler's functions behaviors
+ added dummy jumps elimination
+ added optimization for:
IF .T.
IF .F.
WHILE .T.
WHILE .F.
etc.
* restored empty BEGIN/RECOVER sequence block elimination
if Jump Optimization is enabled then it marks the block
with HB_P_NOOPS else it cut the generated PCODE
+ added dead code eliminator (new functions hb_compCodeTraceMarkDead()/
hb_compPCodeTrace() - it works only when Jump Optimization is
not disabled)
As a result of the above we have smaller and faster PCODE.
I do not think that we will have meta code support in the reasonable
time and because I need some valid compiler data/structures like
updated table of all jumps for real C code (not PCODE in .c files)
generation then I decide to make some modifications and the above
is in practice a side effect of this work.
* harbour/source/rdd/dbcmd.c
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/rddord.prg
* harbour/source/rdd/workarea.c
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/dbfntx/dbfntx1.c
* harbour/source/rdd/nulsys/nulsys.c
* synced with my modifications in xHarbour
* updated for API modifications
* harbour/source/rtl/Makefile
+ added gtsys.c, gtfunc.c, hbgtcore.c
* harbour/source/rtl/accept.c
* harbour/source/rtl/alert.prg
* harbour/source/rtl/cdpapi.c
* harbour/source/rtl/console.c
* harbour/source/rtl/dates.c
* harbour/source/rtl/do.c
* harbour/source/rtl/errorapi.c
* harbour/source/rtl/errorsys.prg
* harbour/source/rtl/file.c
* harbour/source/rtl/fserror.c
* harbour/source/rtl/fstemp.c
* harbour/source/rtl/hbffind.c
* harbour/source/rtl/idle.c
* harbour/source/rtl/math.c
* harbour/source/rtl/oldclear.c
* harbour/source/rtl/strmatch.c
* harbour/source/rtl/strpeek.c
* harbour/source/rtl/valtype.c
* harbour/source/rtl/xsavescr.c
* updated for API modifications
* cleaned some compiler warnings
* harbour/source/rtl/filesys.c
+ added hb_fsGetOsHandle()
* updated for API modifications
* harbour/source/rtl/gt.c
* harbour/source/rtl/gtapi.c
* harbour/source/rtl/gtapiu.c
+ harbour/source/rtl/gtfunc.c
+ harbour/source/rtl/gtsys.c
+ harbour/source/rtl/hbgtcore.c
* harbour/source/rtl/inkey.c
* harbour/source/rtl/maxrow.c
* harbour/source/rtl/mouseapi.c
* harbour/source/rtl/setcolor.c
* harbour/source/rtl/setposbs.c
* harbour/source/rtl/shadow.c
* new GT API code
* harbour/source/rtl/saverest.c
* changed default behavior in SEVESCREEN/RESTSCREEN with parameters
out of screen range to be Clipper compatible. Added last logical
parameter to keep previous behavior for programs which begins to
use it.
* harbour/source/rtl/seconds.c
* include missing header file to fix C++ compilation
* make hb_secondsCPU global function
* harbour/source/rtl/set.c
* make HB_SET_TYPEAHEAD Clipper compatible
* harbour/source/rtl/gtcgi/Makefile
* harbour/source/rtl/gtcgi/gtcgi.c
- harbour/source/rtl/gtcgi/mousecgi.c
* rewritten for new GT API
some detail behaviors has been changed but I think the current
implementation is better for CGI programs output - please check
and fix me if necessary
* harbour/source/rtl/gtcrs/Makefile
- harbour/source/rtl/gtcrs/charmap.prg
+ harbour/source/rtl/gtcrs/chrmap.c
- harbour/source/rtl/gtcrs/debug.map
- harbour/source/rtl/gtcrs/eterm.map
* harbour/source/rtl/gtcrs/gtcrs.c
+ harbour/source/rtl/gtcrs/gtcrs.h
+ harbour/source/rtl/gtcrs/hb-charmap.def
- harbour/source/rtl/gtcrs/kbdcrs.c
- harbour/source/rtl/gtcrs/keymap.prg
- harbour/source/rtl/gtcrs/linux.map
- harbour/source/rtl/gtcrs/mousecrs.c
* new GTCRS based on my xHarbour and Flagship curses code
Please not that at runtime it looks for a file
/etc/harbour/hb-charmap.def where user can fully tune output
for his terminal. This file is included with proper path in
binaries created by make_rpm.sh and make_tgz.sh
Ryszard I've removed some of your extensions which are no longer
necessary and some other (keyboard sequence redefinition) should
be done in a little bit differ way. I would like to talk about it
when you test current code.
Added support for extended mouse keys (middle button and wheel).
* harbour/source/rtl/gtdos/Makefile
* harbour/source/rtl/gtdos/gtdos.c
- harbour/source/rtl/gtdos/mousedos.c
* rewritten for new GT API
Fixed some small problems, finished mouse code which for DJGPP
is fully Clipper compatible with real mouse SAVE/RESTORE code.
For other compilers it should be updated depending on memory
model and used DPMI driver (if any).
* harbour/source/rtl/gtos2/Makefile
* harbour/source/rtl/gtos2/gtos2.c
- harbour/source/rtl/gtos2/mouseos2.c
* rewritten for new GT API
Fixed some problems and finished the mouse code.
Please test it - I made all modifications without OS2 and
I was not able to make any test. I'm interesting in information
if it works and the speed difference - f.e. results from
tests/vidtest.prg run with previous and current version.
* harbour/source/rtl/gtpca/Makefile
* harbour/source/rtl/gtpca/gtpca.c
- harbour/source/rtl/gtpca/kbdos2.gcc
- harbour/source/rtl/gtpca/mousepca.c
* rewritten for new GT API
and finished so now it's full functional GT driver
I'm interesting in keyboard sequences used by PC-ANSI drivers
in DOS so it will be possible to implement also support for
extended keys input.
* harbour/source/rtl/gtsln/Makefile
* harbour/source/rtl/gtsln/gtsln.c
+ harbour/source/rtl/gtsln/gtsln.h
* harbour/source/rtl/gtsln/kbsln.c
* harbour/source/rtl/gtsln/keytrans.c
* harbour/source/rtl/gtsln/mousesln.c
* rewritten for new GT API basing on current xHarbour code
added support for slang 1.4x patched for UNICODE (Debian
patches used by most of current Linux distributions) and
slang 2.x - It's unicode ready, tries to detect terminal mode
(utf-8/iso) at startup and switch the internal logic to
iso/unicode mode. When compiled with slang 1.4x or 2.x
and terminal is in UTF-8 it can display all characters like
in DOS if only used font have them or good fall-back table is
loaded (f.e. the one created by QRCZAK)
Added support for extended mouse keys (middle button and wheel).
* harbour/source/rtl/gtstd/Makefile
* harbour/source/rtl/gtstd/gtstd.c
- harbour/source/rtl/gtstd/mousestd.c
* rewritten for new GT API
Now it can work as full screen GT driver redrawing the previous
screen contents from internal GT core buffers. I run with this
GT some of my programs and they work quite well ;-) of course
without colors.
* harbour/source/rtl/gtwin/Makefile
* harbour/source/rtl/gtwin/gtwin.c
- harbour/source/rtl/gtwin/mousewin.c
* updated for new GT API
+ harbour/source/rtl/gtxwc/Makefile
+ harbour/source/rtl/gtxwc/gtxwc.c
+ harbour/source/rtl/gtxwc/gtxwc.h
* new XWindow Console GT driver based on my and Giancarlo Niccolai
code form xHarbour - this GT can work in XWindow environment only
and create its own window for console output. It delays the
initialization to the moment when user try to display anything on
the screen so even without X Window system programs which uses this
GT can work as long as use only outstd/outerr output.
* harbour/source/vm/arrays.c
* updated for API modifications
+ added hb_arrayId(),
* changed hb_arrayClone() declaration to:
HB_EXPORT PHB_ITEM hb_arrayClone( PHB_ITEM pSrcArray )
* changed hb_arrayFromParams() declaration to:
PHB_ITEM hb_arrayFromParams( int iLevel )
* harbour/source/vm/arrayshb.c
* updated for API modifications
+ added new parameter iLevel to function HB_APARAMS()
* harbour/source/vm/classes.c
* harbour/source/vm/cmdarg.c
* harbour/source/vm/dynlibhb.c
* harbour/source/vm/estack.c
* harbour/source/vm/fm.c
* harbour/source/vm/garbage.c
* harbour/source/vm/maindll.c
* harbour/source/vm/maindllh.c
* harbour/source/vm/maindllp.c
* harbour/source/vm/mainstd.c
* harbour/source/vm/mainwin.c
* harbour/source/vm/memvars.c
* harbour/source/vm/pcount.c
* harbour/source/vm/proc.c
* updated for API modifications
* harbour/source/vm/codebloc.c
* updated for API modifications
+ added hb_codeblockId()
* harbour/source/vm/dynsym.c
* updated for API modifications
+ added new functions:
hb_dynsymFindSymbol(), hb_dynsymGetSymbol(),
hb_dynsymSymbol(), hb_dynsymName(),
hb_dynsymMemvarHandle(), hb_dynsymAreaHandle(), hb_dynsymSetAreaHandle()
* harbour/source/vm/eval.c
* updated for API modifications
* call hb_vmPushState()/hb_vmPopState() in hb_itemDo()/hb_itemDoC()
functions - it's necessary to make HVM reentrant safe.
* harbour/source/vm/extend.c
* updated for API modifications
+ added hb_extIsObject() similar to existing hb_extIsArray()
* harbour/source/vm/hvm.c
* updated for API modifications
+ added new functions: hb_vmPushState(), hb_vmPopState()
which save/restore HVM state (the top stack value which can be
processed and return item and maybe sth else in the future) making
HVM ready for reentrant.
* harbour/source/vm/itemapi.c
* updated for API modifications
+ added new function:
HB_EXPORT PHB_SYMB hb_itemGetSymbol( PHB_ITEM pItem );
! fixed bug in hb_itemPutNInt()
* harbour/tests/Makefile
* harbour/utils/hbdoc/Makefile
* harbour/utils/hbextern/Makefile
* harbour/utils/hbmake/Makefile
* harbour/utils/hbrun/Makefile
* harbour/utils/hbtest/Makefile
- removed badly added: dbfntx, dbfcdx, dbffpt, hbsix libraries.
what broke GNU make compilation for some compilers
This libraries should be included automatically when RDD lib
is included by *.cf files
Summary:
The whole patch (cvs diff -uN) is ~1.5MB length and I cannot describe
everything in details - sorry but it was too much modifications in
one commit so now just some of general notes.
The header files included as is does not have any information about
internal HVM structures and some functions. In practice only HB_SYMB
is public and it has to be public for .c files generated from .prg
so I force the fixed size of this structure (alignment independent)
by redefining some members to union with void * - it's a little bit
ugly trick but it effectively eliminates the problem of linking
binaries compiled with differ alignment C compiler switches.
The structures like HB_ITEM, HB_CODEBLOCK, HB_STACK, HB_DYNS are not
longer defined and pointers to the defined as void * - like in Clipper
the ITEM structure. It caused that I had to add some new functions
to make some operation still possible to implement. If I missed sth
and any of you will have a problem with your code then please inform
me about it and after a small discussion on Harbour developers list
we can decide if other functions should be added.
The internal API is still accessible. It's enough to include "hbvmopt.h"
file before other header files to enable it. Now only files in
source/vm directory include it.
The 3-rd party code which does not include hbvmopt.h (or tries to
set some internals macros) should be safe for future HVM modifications
and will work also with new binaries so 3-rd party library developers
should remember about it. If they won't then it's only their and
their clients problem not Harbour developers.
With this modifications I also create new GT model which is similar
to the one used by RDD with multi inheritance. It can be quite easy
extended to simultaneously load more then one GT subsystem (sth like
work areas in RDD) but I left it for the future when someone may
need it. hbapigt.h file now contains only information about public
functions and does not have any code which depends on current
internal implementation - it should be backword compatible as long
as somone did not try to use internal GT functions.
The internal GT system use hbgtcore.h file which should not be
included by 3-rd party code as long as someone will not make new
GT driver. The internal GT code is new so I expect that it will
be changed yet in the nearest future (I'm waiting for other developers
feedback) and in such case any 3-rd party GTs will have to be updated.
How it works:
The base GT driver (GTNUL) is fully functional GT driver which
makes all operations on memory buffer. After each screen write
Flush() method is called which check for dispcount() and if
it's 0 then call Refresh() method to update modified area by
Redraw() method. This method is dummy in GTNUL and external
output with this GT can be reached by outstd()/outerr() which
are now redirected to GT methods. A simple GT driver may overload
only Refresh() method to give full screen output.
Application can use only this GT driver and it seems to be very
good choice for GUI and background daemon/service programs.
This GT is loaded at startup then all other GTs can be loaded
later and inherit from the previously loaded GT drivers.
The new GT driver can overload as much method as wants/needs.
Now all GT operations are implemented as GT method so GT driver
can easy change their default behavior, f.e. it may fully overload
color parsing methods and use differ or extended to Clipper color
definitions.
I rewrote all existing GTs to work with new GT model.
OS2 users - please test GTOS2 which I was not able to test and
see the note in Redraw() method. If possible please make some
speed tests.
In fact now there is much more internal operations then it was
before but because they are done on memory only then current
code is much faster in this GT drivers which so far makes all
operations on real video area. I made some tests with GTNUL
and tests/vidtest.prg and the total overhead is minimal. Now
dipbegin()/dispend() in practice does not cost anything so it
gives additional speed improvement in application which extensively
use it.
More then one GT driver can be linked with final binaries and
chose on application startup by //GT<NAME> switch and/or environment
variable HB_GT=<name>
In the RTL is new GT function GTSYS() which works in similar way
to RDDSYS() in RDD subsystem and for linking default GT driver
for given platform. When RTL is compiled the default GT driver
is set to HB_GT_DEFAULT envvar and if not exist to HB_GT_LIB
envvar and if it also does not exist to hard coded platfom GTs
(see source/rtl/gtsys.c and source/rtl/Makefile for rules)
Adding to source code:
ANNOUNCE GTSYS
disable linking the default GT driver and:
REQUEST HB_GT_<name>
for linking given (<name>) GT driver, f.e.: REQUEST HB_GT_WIN
If you are working in SH environment (Linux and other *nixes users,
DJGPP bash, MinGW shell then it's possible to use -gt<name> switch
in hblnk / hbmk scripts to force linking GT drivers (it could be
repeated with different <name>) and the first one becomes the default
one. F.e.:
xhbmk -m -n -w -es2 -gtcrs -gtsln -gtstd -gtpca vidtest.prg
Usually the GT driver are loaded at HVM startup but it's possible
to load it later. I created new GT driver CTW which gives full
CT3 like Window system. The CT3 extended driver change the behavior
of some function in Clipper extended driver, f.e WRITECON() or
SETPOS() with parameters out of screen range. So I implemented it
CTW as RT GTs which is loaded when some of CTWIN function is used
(f.e. WOPEN()/WBOARD()) and inherits from any existing GT driver.
This is full CT3 WIN implementation with all detail behaviors I
found (with some CT3 bug fixes). It does not have any CT3 limitations
and can be used for any virtual screen/window size though I hardcoded
CT3 limitation for backword compatibility. If somone will want to
remove it then it will be enough to delete few lines from ctwin.c
file. I'm not CTWIN Clipper user so maybe I missed some side effects
in this driver and was not able to well test it so if you will find
any incompatibilities then please inform me.
THe default GT buffer uses 32bit character cell internally but
in savescreen/restscreen it uses VGA compatible two bytes character
cell. Some GT drivers may want to use differ character cell.
Now GTCRS and GTSLN use 32bit character cell by default. They
need additional information about character set (box/normal) to
properly display box characters. It is possible to force in this
GT drivers using Clipper compatible character cell by calling:
hb_gtInfo( GTI_COMPATBUFFER, <lCompat> ) -> <lPreviousSeting>
but in may cause that box drawing characters will be lost in
some countries after RESTSCREEN(). It will depend on used code
page.
HB_GTINFO() is new function which works in similar way to DBINFO()
in RDD. It allows to retrieve/change some of GT driver settings.
GTI_* actions are defined in hbgtinfo.ch - it has all GTI_*
definitions used in xHarbour. Now in Harbour only few of them
are implemented.
The new three .prg functions:
HB_SETKEYCP( <cTermCP> [,<cHostCP>] )
HB_SETDISPCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
HB_SETTERMCP( <cTermCP> [,<cHostCP>] [,<lBoxChar>] )
have been added. They set automatic input (HB_SETKEYCP)
and output (HB_SETDISPCP) (or both: HB_SETTERMCP) character
translation. They are also important for some GTs which
informing them about used internal code page for unicode
translation (GTXWC, GTSLN) and/or chosing proper character
set (standard/alternate) for letters and other (f.e. box
drawing characters) (GTCRS, GTSLN),
<cTermCP> is encoding used on external (terminal) side
<cHostCP> is encoding used internally, if not given then
current code page set HB_SETCODEPAGE() is used.
some of GTs which uses unicode output may
ignore <cTermCP>
<lBoxChar> is optional parameter which interacts with dispbox()
output disabling switching to alternate character
set in some GTs. It effectively causes that if internal
(host) code page contains some letters on the box char
positions then they will be shown also by box drawing
functions like dispbox() instead of CP437 characters.
In some cases it could be useful. By default lBoxChar
is not set and GTs which can switch between standard
and alternate character set (GTCRS, GTSLN) will try to
use alternate character set for box drawing functions.
Victor: I removed some of your functions. They can be very easy
implemented with hb_gt_GetChar()/hb_gt_PutChar() but I do not want to
make them part of documented external API because some GT drivers may
want to use absolutely differ color definitions and they will stop to
work so I do not want to make this functions documented external API.
Ryszard: Setting alternative debug keys does not longer work.
I like such possibilities but it should be implemented in differ
way to f.e. using HB_GTINFO interface to allow low level GT driver
extensions, f.e. in *nixes using CTRL+[A-Z] and SIGINT, SIGQUIT,
SIGTSTP signals for real asynchronous setting of debug/cancel flag
without keyboard polling from main HVM loop. I would like to discus
about such more general solution.
*** Please updated non GNU make files ***
1139 lines
47 KiB
C
1139 lines
47 KiB
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* Header file for the RDD API
|
|
*
|
|
* Copyright 1999 {list of individual authors and e-mail addresses}
|
|
* 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_APIRDD_H_
|
|
#define HB_APIRDD_H_
|
|
|
|
#include "hbapifs.h"
|
|
#include "dbinfo.ch" /* Constants for SELF_ORDINFO, SELF_INFO(), SELF_RECINFO() */
|
|
#include "dbstruct.ch" /* Constants for SELF_FIELDINFO() */
|
|
#ifndef HB_CDP_SUPPORT_OFF
|
|
#include "hbapicdp.h"
|
|
#endif
|
|
|
|
HB_EXTERN_BEGIN
|
|
|
|
#ifdef HB_CDP_SUPPORT_OFF
|
|
typedef void * PHB_CODEPAGE
|
|
#endif
|
|
|
|
#define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32
|
|
|
|
#ifndef HARBOUR_MAX_RDD_ALIAS_LENGTH
|
|
#define HARBOUR_MAX_RDD_ALIAS_LENGTH 32
|
|
#endif
|
|
|
|
/* #define HARBOUR_MAX_RDD_FIELDNAME_LENGTH 32 */
|
|
#define HARBOUR_MAX_RDD_AREA_NUM 65535
|
|
|
|
#define HARBOUR_MAX_RDD_RELTEXT_LENGTH 256
|
|
|
|
/* RDD virtual machine integration functions */
|
|
|
|
extern HB_EXPORT USHORT hb_rddInsertAreaNode( char *szDriver );
|
|
extern HB_EXPORT USHORT hb_rddGetCurrentFieldPos( char * szName );
|
|
extern HB_EXPORT void * hb_rddAllocWorkAreaAlias( char * szAlias, int iArea );
|
|
extern HB_EXPORT int hb_rddGetCurrentWorkAreaNumber( void );
|
|
extern HB_EXPORT void * hb_rddGetCurrentWorkAreaPointer( void );
|
|
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaAlias( char * szAlias );
|
|
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaNumber( int iArea );
|
|
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaSymbol( PHB_SYMB pSymAlias );
|
|
extern HB_EXPORT ERRCODE hb_rddGetFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
|
|
extern HB_EXPORT ERRCODE hb_rddPutFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
|
|
extern HB_EXPORT ERRCODE hb_rddFieldGet( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
|
|
extern HB_EXPORT ERRCODE hb_rddFieldPut( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
|
|
extern HB_EXPORT void hb_rddShutDown( void );
|
|
extern HB_EXPORT void hb_rddReleaseCurrentArea( void );
|
|
|
|
|
|
|
|
/* DBCMD errors */
|
|
|
|
#define EDBCMD_SEEK_BADPARAMETER 1001
|
|
#define EDBCMD_NOALIAS 1002
|
|
#define EDBCMD_NOVAR 1003
|
|
#define EDBCMD_USE_BADPARAMETER 1005
|
|
#define EDBCMD_REL_BADPARAMETER 1006
|
|
#define EDBCMD_FIELDNAME_BADPARAMETER 1009
|
|
#define EDBCMD_BADALIAS 1010
|
|
#define EDBCMD_DUPALIAS 1011
|
|
#define EDBCMD_DBCMDBADPARAMETER 1014
|
|
#define EDBCMD_BADPARAMETER 1015
|
|
#define EDBCMD_INFOBADPARAMETER 1032
|
|
#define EDBCMD_DBINFOBADPARAMETER 1034
|
|
#define EDBCMD_DBFILEPUTBADPARAMETER 1041
|
|
#define EDBCMD_DBFILEGETBADPARAMETER 1042
|
|
#define EDBCMD_NOTABLE 2001
|
|
#define EDBCMD_EVAL_BADPARAMETER 2019
|
|
|
|
|
|
|
|
/* Flags for DBTRANSINFO */
|
|
|
|
#define DBTF_MATCH 0x0001
|
|
#define DBTF_PUTREC 0x0002
|
|
|
|
|
|
|
|
/* Codes for Locking methods */
|
|
|
|
#define DBLM_EXCLUSIVE 1
|
|
#define DBLM_MULTIPLE 2
|
|
#define DBLM_FILE 3
|
|
|
|
|
|
/* Codes for RawLock types */
|
|
|
|
#define FILE_LOCK 1
|
|
#define FILE_UNLOCK 2
|
|
#define REC_LOCK 3
|
|
#define REC_UNLOCK 4
|
|
#define HEADER_LOCK 5
|
|
#define HEADER_UNLOCK 6
|
|
#define APPEND_LOCK 7
|
|
#define APPEND_UNLOCK 8
|
|
|
|
|
|
|
|
/*
|
|
* Forward declarations
|
|
*/
|
|
struct _RDDFUNCS;
|
|
struct _AREA;
|
|
struct _RDDNODE;
|
|
|
|
|
|
/*
|
|
* DBFIELDINFO
|
|
* -----------
|
|
* The field structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
BYTE * atomName; /* FIELD (symbol) name */
|
|
HB_TYPE uiType; /* FIELD type */
|
|
USHORT uiTypeExtended; /* FIELD type extended */
|
|
USHORT uiLen; /* Overall FIELD length */
|
|
USHORT uiDec; /* Decimal places of numeric FIELD */
|
|
} DBFIELDINFO;
|
|
|
|
typedef DBFIELDINFO * LPDBFIELDINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBOPENINFO
|
|
* ----------
|
|
* The Open Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
USHORT uiArea; /* Work Area number of the data store */
|
|
BYTE * abName; /* The qualified name of the data store */
|
|
BYTE * atomAlias; /* The logical name of the data store */
|
|
BOOL fShared; /* Share mode of the data store */
|
|
BOOL fReadonly; /* Readonly mode of the data store */
|
|
BYTE * cdpId; /* Id of a codepage */
|
|
ULONG ulConnection; /* connection handler for RDDs which support it */
|
|
void * lpdbHeader; /* Pointer to a header of the data store */
|
|
} DBOPENINFO;
|
|
|
|
typedef DBOPENINFO * LPDBOPENINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBORDERCONDINFO
|
|
* ---------------
|
|
* The Create Order conditional Info structure
|
|
*/
|
|
|
|
typedef struct _DBORDERCONDINFO
|
|
{
|
|
BOOL fActive;
|
|
BYTE * abFor;
|
|
BYTE * abWhile;
|
|
PHB_ITEM itmCobFor;
|
|
PHB_ITEM itmCobWhile;
|
|
PHB_ITEM itmCobEval;
|
|
LONG lStep;
|
|
PHB_ITEM itmStartRecID;
|
|
LONG lNextCount;
|
|
PHB_ITEM itmRecID;
|
|
BOOL fRest;
|
|
BOOL fDescending;
|
|
BOOL fScoped;
|
|
BOOL fAll;
|
|
BOOL fAdditive;
|
|
BOOL fUseCurrent;
|
|
BOOL fCustom;
|
|
BOOL fNoOptimize;
|
|
BOOL fCompound;
|
|
BOOL fUseFilter;
|
|
BOOL fTemporary;
|
|
BOOL fExclusive;
|
|
void * lpvCargo;
|
|
} DBORDERCONDINFO;
|
|
|
|
typedef DBORDERCONDINFO * LPDBORDERCONDINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBORDERCREATE
|
|
* -------------
|
|
* The Create Order Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
BYTE * abConstrName; /* Name of relational integrity constraint */
|
|
BYTE * abTargetName; /* Name of target relation table */
|
|
PHB_ITEM itmRelationKey; /* Array of columns in source table to match target primary key */
|
|
BOOL fEnabled; /* Is constraint enabled ? */
|
|
} DBCONSTRAINTINFO;
|
|
|
|
typedef DBCONSTRAINTINFO * LPDBCONSTRAINTINFO;
|
|
|
|
typedef struct
|
|
{
|
|
LPDBORDERCONDINFO lpdbOrdCondInfo; /* Conditional information */
|
|
BYTE * abBagName; /* Name of the Order bag */
|
|
BYTE * atomBagName; /* Name of the Order */
|
|
PHB_ITEM itmOrder;
|
|
BOOL fUnique; /* Flag to determine if all keys are unique */
|
|
PHB_ITEM itmCobExpr; /* Code block containing the KEY expression */
|
|
PHB_ITEM abExpr; /* String containing the KEY expression */
|
|
LPDBCONSTRAINTINFO lpdbConstraintInfo; /* Relational constraint info */
|
|
} DBORDERCREATEINFO;
|
|
|
|
typedef DBORDERCREATEINFO * LPDBORDERCREATEINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBORDERINFO
|
|
* -----------
|
|
* The Set Index Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
PHB_ITEM atomBagName; /* Name of the Order Bag */
|
|
PHB_ITEM itmOrder; /* Name or Number of the Order */
|
|
PHB_ITEM itmCobExpr; /* Code block containing the KEY expression */
|
|
PHB_ITEM itmResult; /* Operation result */
|
|
PHB_ITEM itmNewVal; /* New Setting */
|
|
BOOL fAllTags; /* Open all tags */
|
|
} DBORDERINFO;
|
|
|
|
typedef DBORDERINFO * LPDBORDERINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBSCOPEINFO
|
|
* -----------
|
|
* The Scope Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
PHB_ITEM itmCobFor; /* Code Block representation of a FOR clause */
|
|
PHB_ITEM lpstrFor; /* String representation of a FOR clause */
|
|
PHB_ITEM itmCobWhile; /* Code Block representation of a WHILE clause */
|
|
PHB_ITEM lpstrWhile; /* String representation of a WHILE clause */
|
|
PHB_ITEM lNext; /* NEXT record */
|
|
PHB_ITEM itmRecID; /* single record ID */
|
|
PHB_ITEM fRest; /* TRUE if start from the current record */
|
|
BOOL fIgnoreFilter; /* process should ignore any filter condition */
|
|
BOOL fIncludeDeleted; /* process should include deleted records */
|
|
BOOL fLast; /* last record of the current scope required */
|
|
BOOL fIgnoreDuplicates; /* process should ignore duplicate key value */
|
|
BOOL fBackword; /* skip backword */
|
|
BOOL fOptimized; /* Is (should be) scope optimized */
|
|
} DBSCOPEINFO;
|
|
|
|
typedef DBSCOPEINFO * LPDBSCOPEINFO;
|
|
|
|
|
|
/*
|
|
* DBORDSCOPEINFO
|
|
* --------------
|
|
* The Order Scope Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
USHORT nScope; /* scope operation: TOPSCOPE/ENDSCOPE */
|
|
PHB_ITEM scopeValue;
|
|
} DBORDSCOPEINFO;
|
|
|
|
typedef DBORDSCOPEINFO * LPDBORDSCOPEINFO;
|
|
|
|
|
|
/*
|
|
* DBFILTERINFO
|
|
* ------------
|
|
* The Filter Info structure
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
PHB_ITEM itmCobExpr; /* Block representation of the FILTER expression */
|
|
PHB_ITEM abFilterText; /* String representation of FILTER expression */
|
|
BOOL fFilter; /* flag to indicate that filter is active */
|
|
BOOL fOptimized; /* Is (should be) filter optimized */
|
|
void * lpvCargo; /* RDD specific extended filter info */
|
|
} DBFILTERINFO;
|
|
|
|
typedef DBFILTERINFO * LPDBFILTERINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBRELINFO
|
|
* ---------
|
|
* The Relationship Info structure
|
|
*/
|
|
|
|
typedef struct _DBRELINFO
|
|
{
|
|
PHB_ITEM itmCobExpr; /* Block representation of the relational SEEK key */
|
|
PHB_ITEM abKey; /* String representation of the relational SEEK key */
|
|
BOOL isScoped; /* Is this relation scoped */
|
|
BOOL isOptimized; /* Is relation optimized */
|
|
struct _AREA * lpaParent; /* The parent of this relation */
|
|
struct _AREA * lpaChild; /* The parents children */
|
|
struct _DBRELINFO * lpdbriNext; /* Next child or parent */
|
|
} DBRELINFO;
|
|
|
|
typedef DBRELINFO * LPDBRELINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBEVALINFO
|
|
* ----------
|
|
* The Evaluation Info structure
|
|
*
|
|
* Contains information necessary for a block evaluation
|
|
* on each record of the workarea
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
PHB_ITEM itmBlock; /* The block to be evaluated */
|
|
PHB_ITEM abBlock; /* String representation of evaluated block */
|
|
DBSCOPEINFO dbsci; /* Scope info that limits the evaluation */
|
|
} DBEVALINFO;
|
|
|
|
typedef DBEVALINFO * LPDBEVALINFO;
|
|
|
|
/*
|
|
* NOTE: If your redefine EVAL() method then you may use itmBlock as
|
|
* string ITEM to make some operations on server side of remote RDD.
|
|
*/
|
|
|
|
|
|
/*
|
|
* DBTRANSITEM
|
|
* -----------
|
|
* The Transfer Item structure
|
|
*
|
|
* Defines a single transfer item (usually a field) from
|
|
* one database to another; used by DBTRANSINFO
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
USHORT uiSource; /* Field index number from the source */
|
|
USHORT uiDest; /* Destination field index number */
|
|
} DBTRANSITEM;
|
|
|
|
typedef DBTRANSITEM * LPDBTRANSITEM;
|
|
|
|
|
|
|
|
/*
|
|
* DBTRANSINFO
|
|
* -----------
|
|
* The Transfer Info structure
|
|
*
|
|
* Defines a global transfer of data items from on workarea
|
|
* to another
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
struct _AREA * lpaSource; /* Pointer to source work area */
|
|
struct _AREA * lpaDest; /* Pointer to dest work area */
|
|
DBSCOPEINFO dbsci; /* Scope to limit transfer */
|
|
USHORT uiFlags; /* Transfer attributes */
|
|
USHORT uiItemCount; /* Number of items below */
|
|
LPDBTRANSITEM lpTransItems; /* Array of items */
|
|
} DBTRANSINFO;
|
|
|
|
typedef DBTRANSINFO * LPDBTRANSINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBSORTITEM
|
|
* ----------
|
|
* The Sort Item Structure
|
|
*
|
|
* An array of items that, together, indicate the key value to
|
|
* use while sorting data. The order of the array determines the
|
|
* order of the sorting.
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
USHORT uiField; /* Index into the workarea->fields structure */
|
|
USHORT uiFlags; /* Sort flags */
|
|
} DBSORTITEM;
|
|
|
|
typedef DBSORTITEM * LPDBSORTITEM;
|
|
|
|
|
|
/* Flags for DBSORTITEM */
|
|
#define SF_ASCEND 1
|
|
#define SF_CASE 2
|
|
#define SF_DESCEND 4
|
|
#define SF_NUM 32
|
|
#define SF_DOUBLE 64
|
|
#define SF_LONG 128
|
|
|
|
|
|
|
|
/*
|
|
* DBSORTINFO
|
|
* ----------
|
|
* The Sort Info Structure
|
|
*
|
|
* Information for a physical sort on the workarea
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
DBTRANSINFO dbtri; /* Destination workarea transfer information */
|
|
LPDBSORTITEM lpdbsItem; /* Fields which compose the key values for the sort */
|
|
USHORT uiItemCount; /* The number of fields above */
|
|
} DBSORTINFO;
|
|
|
|
typedef DBSORTINFO * LPDBSORTINFO;
|
|
|
|
|
|
|
|
/*
|
|
* DBLOCKINFO
|
|
* ----------
|
|
* The Lock Info Structure
|
|
*
|
|
* Information for a record or file lock
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
PHB_ITEM itmRecID;
|
|
USHORT uiMethod;
|
|
BOOL fResult;
|
|
} DBLOCKINFO;
|
|
|
|
typedef DBLOCKINFO * LPDBLOCKINFO;
|
|
|
|
|
|
|
|
/*
|
|
* FIELD
|
|
* -----
|
|
* The Field structure
|
|
*
|
|
* This is the basic unit of access for a workarea
|
|
*/
|
|
|
|
typedef struct _FIELD
|
|
{
|
|
HB_TYPE uiType; /* Field type */
|
|
USHORT uiTypeExtended; /* Field type - extended */
|
|
USHORT uiLen; /* Field length */
|
|
USHORT uiDec; /* Decimal length */
|
|
USHORT uiArea; /* Area this field resides in */
|
|
void * sym; /* Symbol that represents the field */
|
|
struct _FIELD * lpfNext; /* The next field in the list */
|
|
} FIELD;
|
|
|
|
typedef FIELD * LPFIELD;
|
|
|
|
/*
|
|
* prototype for function to evaluate against index keys
|
|
* only for local RDDs (DBFNTX, DBFCDX, ...)
|
|
*/
|
|
typedef void ( * HB_EVALSCOPE_FUNC )( ULONG, BYTE *, ULONG, void * );
|
|
|
|
|
|
/*--------------------* WORKAREA structure *----------------------*/
|
|
|
|
/*
|
|
* WORKAREA
|
|
* --------
|
|
* The Workarea Structure
|
|
*
|
|
* Information to administrate the workarea
|
|
*/
|
|
|
|
typedef struct _AREA
|
|
{
|
|
struct _RDDFUNCS * lprfsHost; /* Virtual method table for this workarea */
|
|
#if 0
|
|
/* I'll add this soon, Druzus */
|
|
struct _RDDFUNCS * lprfsSuper;/* Virtual super method table for this workarea */
|
|
#endif
|
|
USHORT uiArea; /* The number assigned to this workarea */
|
|
void * atomAlias; /* Pointer to the alias symbol for this workarea */
|
|
USHORT uiFieldExtent; /* Total number of fields allocated */
|
|
USHORT uiFieldCount; /* Total number of fields used */
|
|
LPFIELD lpFields; /* Pointer to an array of fields */
|
|
void * lpFieldExtents; /* Void ptr for additional field properties */
|
|
PHB_ITEM valResult; /* All purpose result holder */
|
|
BOOL fTop; /* TRUE if "top" */
|
|
BOOL fBottom; /* TRUE if "bottom" */
|
|
BOOL fBof; /* TRUE if "bof" */
|
|
BOOL fEof; /* TRUE if "eof" */
|
|
BOOL fFound; /* TRUE if "found" */
|
|
DBSCOPEINFO dbsi; /* Info regarding last LOCATE */
|
|
DBFILTERINFO dbfi; /* Filter in effect */
|
|
LPDBORDERCONDINFO lpdbOrdCondInfo;
|
|
LPDBRELINFO lpdbRelations; /* Parent/Child relationships used */
|
|
USHORT uiParents; /* Number of parents for this area */
|
|
USHORT heap;
|
|
USHORT heapSize;
|
|
USHORT rddID;
|
|
USHORT uiMaxFieldNameLength;
|
|
PHB_CODEPAGE cdPage; /* Area's codepage pointer */
|
|
} AREA;
|
|
|
|
typedef AREA * LPAREA;
|
|
|
|
#ifndef AREAP
|
|
#define AREAP LPAREA
|
|
#endif
|
|
|
|
|
|
/*--------------------* Virtual Method Table *----------------------*/
|
|
|
|
typedef USHORT ( * DBENTRYP_V )( AREAP area );
|
|
typedef USHORT ( * DBENTRYP_BP )( AREAP area, BOOL * param );
|
|
typedef USHORT ( * DBENTRYP_B )( AREAP area, BOOL param );
|
|
typedef USHORT ( * DBENTRYP_L )( AREAP area, LONG param );
|
|
typedef USHORT ( * DBENTRYP_UL )( AREAP area, ULONG param );
|
|
typedef USHORT ( * DBENTRYP_I )( AREAP area, PHB_ITEM param );
|
|
typedef USHORT ( * DBENTRYP_SI )( AREAP area, USHORT index, PHB_ITEM param );
|
|
typedef USHORT ( * DBENTRYP_VP )( AREAP area, LPDBOPENINFO param );
|
|
typedef USHORT ( * DBENTRYP_VT )( AREAP area, LPDBTRANSINFO param );
|
|
typedef USHORT ( * DBENTRYP_VF )( AREAP area, LPDBFIELDINFO param );
|
|
typedef USHORT ( * DBENTRYP_VL )( AREAP area, LPDBLOCKINFO param );
|
|
typedef USHORT ( * DBENTRYP_VR )( AREAP area, LPDBRELINFO param );
|
|
typedef USHORT ( * DBENTRYP_VS )( AREAP area, LPDBSORTINFO param );
|
|
typedef USHORT ( * DBENTRYP_VFI )( AREAP area, LPDBFILTERINFO param );
|
|
typedef USHORT ( * DBENTRYP_VEI )( AREAP area, LPDBEVALINFO param );
|
|
typedef USHORT ( * DBENTRYP_VLO )( AREAP area, LPDBSCOPEINFO param );
|
|
typedef USHORT ( * DBENTRYP_VOC )( AREAP area, LPDBORDERCREATEINFO param );
|
|
typedef USHORT ( * DBENTRYP_VOI )( AREAP area, LPDBORDERCONDINFO param );
|
|
typedef USHORT ( * DBENTRYP_VOS )( AREAP area, LPDBORDSCOPEINFO param );
|
|
typedef USHORT ( * DBENTRYP_OI )( AREAP area, LPDBORDERINFO param );
|
|
typedef USHORT ( * DBENTRYP_OII )( AREAP area, USHORT index, LPDBORDERINFO param );
|
|
typedef USHORT ( * DBENTRYP_SP )( AREAP area, USHORT * param );
|
|
typedef USHORT ( * DBENTRYP_P )( AREAP area, BYTE * param );
|
|
typedef USHORT ( * DBENTRYP_PP )( AREAP area, BYTE ** param );
|
|
typedef USHORT ( * DBENTRYP_S )( AREAP area, USHORT param );
|
|
typedef USHORT ( * DBENTRYP_LP )( AREAP area, LONG * param );
|
|
typedef USHORT ( * DBENTRYP_ULP )( AREAP area, ULONG * param );
|
|
typedef USHORT ( * DBENTRYP_SVP )( AREAP area, USHORT index, void * param );
|
|
typedef USHORT ( * DBENTRYP_SVPB )( AREAP area, USHORT index, void * param, USHORT p3 );
|
|
typedef USHORT ( * DBENTRYP_VSP )( AREAP area, USHORT action, ULONG lRecord );
|
|
typedef USHORT ( * DBENTRYP_SVL )( AREAP area, USHORT index, ULONG * param );
|
|
typedef USHORT ( * DBENTRYP_SSI )( AREAP area, USHORT p1, USHORT p2, PHB_ITEM p3 );
|
|
typedef USHORT ( * DBENTRYP_ISI )( AREAP area, PHB_ITEM p1, USHORT p2, PHB_ITEM p3 );
|
|
typedef USHORT ( * DBENTRYP_BIB )( AREAP area, BOOL p1, PHB_ITEM p2, BOOL p3 );
|
|
typedef USHORT ( * DBENTRYP_VPL )( AREAP area, void * p1, LONG p2 );
|
|
typedef USHORT ( * DBENTRYP_VPLP )( AREAP area, void * p1, LONG * p2 );
|
|
typedef USHORT ( * DBENTRYP_LSP )( AREAP area, LONG p1, BOOL * p2 );
|
|
|
|
/* this methods DO USE take a Workarea but an RDDNODE */
|
|
|
|
typedef USHORT ( * DBENTRYP_R )( struct _RDDNODE * pRDD );
|
|
typedef USHORT ( * DBENTRYP_RVV )( struct _RDDNODE * pRDD, PHB_ITEM p1, PHB_ITEM p2 );
|
|
typedef USHORT ( * DBENTRYP_RSLV )( struct _RDDNODE * pRDD, USHORT index, ULONG p1, PHB_ITEM p2 );
|
|
/*--------------------* Virtual Method Table *----------------------*/
|
|
|
|
typedef struct _RDDFUNCS
|
|
{
|
|
/* Movement and positioning methods */
|
|
|
|
DBENTRYP_BP bof; /* Determine logical beginning of file. */
|
|
DBENTRYP_BP eof; /* Determine logical end of file. */
|
|
DBENTRYP_BP found; /* Determine outcome of the last search operation. */
|
|
DBENTRYP_V goBottom; /* Position cursor at the last record. */
|
|
DBENTRYP_UL go; /* Position cursor at a specific physical record. */
|
|
DBENTRYP_I goToId; /* Position the cursor to a specific, physical identity. */
|
|
DBENTRYP_V goTop; /* Position cursor at the first record. */
|
|
DBENTRYP_BIB seek; /* */
|
|
DBENTRYP_L skip; /* Reposition cursor relative to current position. */
|
|
DBENTRYP_L skipFilter; /*-Reposition cursor respecting any filter setting. */
|
|
DBENTRYP_L skipRaw; /* Reposition cursor, regardless of filter. */
|
|
|
|
|
|
/* Data management */
|
|
|
|
DBENTRYP_VF addField; /* Add a field to the WorkArea. */
|
|
DBENTRYP_B append; /* Append a record to the WorkArea. */
|
|
DBENTRYP_I createFields; /*-Add all fields defined in an array to the WorkArea. */
|
|
DBENTRYP_V deleterec; /* Delete a record. */
|
|
DBENTRYP_BP deleted; /* Determine deleted status for a record. */
|
|
DBENTRYP_SP fieldCount; /*-Determine the number of fields in the WorkArea. */
|
|
DBENTRYP_VF fieldDisplay; /* */
|
|
DBENTRYP_SSI fieldInfo; /*-Retrieve information about a field. */
|
|
DBENTRYP_SVP fieldName; /*-Determine the name associated with a field number. */
|
|
DBENTRYP_V flush; /* Write data buffer to the data store. */
|
|
DBENTRYP_PP getRec; /* */
|
|
DBENTRYP_SI getValue; /* Obtain the current value of a field. */
|
|
DBENTRYP_SVL getVarLen; /* Obtain the length of a field value. */
|
|
DBENTRYP_V goCold; /* Perform a write of WorkArea memory to the data store. */
|
|
DBENTRYP_V goHot; /* Mark the WorkArea data buffer as hot. */
|
|
DBENTRYP_P putRec; /* Replace the current record. */
|
|
DBENTRYP_SI putValue; /* Assign a value to a field. */
|
|
DBENTRYP_V recall; /* Undelete the current record. */
|
|
DBENTRYP_ULP reccount; /* Obtain number of records in WorkArea. */
|
|
DBENTRYP_ISI recInfo; /* */
|
|
DBENTRYP_ULP recno; /* Obtain physical row number at current WorkArea cursor position. */
|
|
DBENTRYP_I recid; /* Obtain physical row ID at current WorkArea cursor position. */
|
|
DBENTRYP_S setFieldExtent; /* Establish the extent of the array of fields for a WorkArea. */
|
|
|
|
|
|
/* WorkArea/Database management */
|
|
|
|
DBENTRYP_P alias; /*-Obtain the alias of the WorkArea. */
|
|
DBENTRYP_V close; /* Close the table in the WorkArea. */
|
|
DBENTRYP_VP create; /* Create a data store in the specified WorkArea. */
|
|
DBENTRYP_SI info; /* Retrieve information about the current driver (DBI). */
|
|
DBENTRYP_V newarea; /* Clear the WorkArea for use. */
|
|
DBENTRYP_VP open; /* Open a data store in the WorkArea. */
|
|
DBENTRYP_V release; /*-Release all references to a WorkArea. */
|
|
DBENTRYP_SP structSize; /* Retrieve the size of the WorkArea structure. */
|
|
DBENTRYP_P sysName; /* Obtain the name of replaceable database driver (RDD) subsystem. */
|
|
DBENTRYP_VEI dbEval; /*-Evaluate code block for each record in WorkArea. */
|
|
DBENTRYP_V pack; /* Remove records marked for deletion from a database. */
|
|
DBENTRYP_LSP packRec; /* */
|
|
DBENTRYP_VS sort; /* Physically reorder a database. */
|
|
DBENTRYP_VT trans; /* Copy one or more records from one WorkArea to another. */
|
|
DBENTRYP_VT transRec; /* Copy a record to another WorkArea. */
|
|
DBENTRYP_V zap; /* Physically remove all records from data store. */
|
|
|
|
|
|
/* Relational Methods */
|
|
|
|
DBENTRYP_VR childEnd; /* Report end of relation. */
|
|
DBENTRYP_VR childStart; /* Report initialization of a relation. */
|
|
DBENTRYP_VR childSync; /* Post a pending relational movement. */
|
|
DBENTRYP_V syncChildren; /*-Force relational movement in child WorkAreas. */
|
|
DBENTRYP_V clearRel; /* Clear all relations in the specified WorkArea. */
|
|
DBENTRYP_V forceRel; /* Force relational seeks in the specified WorkArea. */
|
|
DBENTRYP_SVP relArea; /*-Obtain the workarea number of the specified relation. */
|
|
DBENTRYP_VR relEval; /*-Evaluate a block against the relation in specified WorkArea. */
|
|
DBENTRYP_SVP relText; /*-Obtain the character expression of the specified relation. */
|
|
DBENTRYP_VR setRel; /*-Set a relation in the parent file. */
|
|
|
|
|
|
/* Order Management */
|
|
|
|
DBENTRYP_OI orderListAdd; /* */
|
|
DBENTRYP_V orderListClear; /* */
|
|
DBENTRYP_OI orderListDelete; /* */
|
|
DBENTRYP_OI orderListFocus; /* */
|
|
DBENTRYP_V orderListRebuild; /* */
|
|
DBENTRYP_VOI orderCondition; /* */
|
|
DBENTRYP_VOC orderCreate; /* */
|
|
DBENTRYP_OI orderDestroy; /* */
|
|
DBENTRYP_OII orderInfo; /*-Retrieve information about the current order that SELF could not. */
|
|
|
|
|
|
/* Filters and Scope Settings */
|
|
|
|
DBENTRYP_V clearFilter; /*-Clear the active filter expression. */
|
|
DBENTRYP_V clearLocate; /*-Clear the active locate expression. */
|
|
DBENTRYP_V clearScope; /* */
|
|
DBENTRYP_VPLP countScope; /* */
|
|
DBENTRYP_I filterText; /*-Return filter condition of the specified WorkArea. */
|
|
DBENTRYP_SI scopeInfo; /* */
|
|
DBENTRYP_VFI setFilter; /* Set the filter condition for the specified WorkArea. */
|
|
DBENTRYP_VLO setLocate; /*-Set the locate scope for the specified WorkArea. */
|
|
DBENTRYP_VOS setScope; /* */
|
|
DBENTRYP_VPL skipScope; /* */
|
|
DBENTRYP_B locate; /* reposition cursor to postions set by setLocate */
|
|
|
|
|
|
/* Miscellaneous */
|
|
|
|
DBENTRYP_P compile; /*-Compile a character expression. */
|
|
DBENTRYP_I error; /*-Raise a runtime error. */
|
|
DBENTRYP_I evalBlock; /*-Evaluate a code block. */
|
|
|
|
|
|
/* Network operations */
|
|
|
|
DBENTRYP_VSP rawlock; /* Perform a lowlevel network lock in the specified WorkArea. */
|
|
DBENTRYP_VL lock; /* Perform a network lock in the specified WorkArea. */
|
|
DBENTRYP_I unlock; /* Release network locks in the specified WorkArea. */
|
|
|
|
|
|
/* Memofile functions */
|
|
|
|
DBENTRYP_V closeMemFile; /* Close a memo file in the WorkArea. */
|
|
DBENTRYP_VP createMemFile; /* Create a memo file in the WorkArea. */
|
|
DBENTRYP_SVPB getValueFile; /* */
|
|
DBENTRYP_VP openMemFile; /* Open a memo file in the specified WorkArea. */
|
|
DBENTRYP_SVPB putValueFile; /* */
|
|
|
|
|
|
/* Database file header handling */
|
|
|
|
DBENTRYP_V readDBHeader; /* Read the database file header record in the WorkArea. */
|
|
DBENTRYP_V writeDBHeader; /* Write the database file header record in the WorkArea. */
|
|
|
|
|
|
/* non WorkArea functions */
|
|
DBENTRYP_R init; /* init RDD after registration */
|
|
DBENTRYP_R exit; /* unregister RDD */
|
|
DBENTRYP_RVV drop; /* remove table */
|
|
DBENTRYP_RVV exists; /* check if table exist */
|
|
DBENTRYP_RSLV rddInfo; /* RDD info */
|
|
|
|
/* Special and reserved methods */
|
|
|
|
DBENTRYP_SVP whoCares; /* */
|
|
|
|
} RDDFUNCS;
|
|
|
|
typedef RDDFUNCS * PRDDFUNCS;
|
|
|
|
#define RDDFUNCSCOUNT ( sizeof( RDDFUNCS ) / sizeof( DBENTRYP_V ) )
|
|
|
|
/* RDD Node structure */
|
|
typedef struct _RDDNODE
|
|
{
|
|
char szName[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH + 1 ]; /* Name of RDD */
|
|
USHORT uiType; /* Type of RDD */
|
|
USHORT rddID; /* Type of RDD */
|
|
RDDFUNCS pTable; /* Table of functions */
|
|
RDDFUNCS pSuperTable; /* Table of super functions */
|
|
USHORT uiAreaSize; /* Size of the WorkArea */
|
|
void *lpvCargo; /* RDD specific extended data, if used then
|
|
RDD should free it in EXIT() non WA method */
|
|
} RDDNODE;
|
|
|
|
typedef RDDNODE * LPRDDNODE;
|
|
|
|
|
|
/*--------------------* SELF Methods *------------------------*/
|
|
|
|
/* Movement and positioning methods */
|
|
|
|
#define SELF_BOF(w, sp) ((*(w)->lprfsHost->bof)(w, sp))
|
|
#define SELF_EOF(w, sp) ((*(w)->lprfsHost->eof)(w, sp))
|
|
#define SELF_FOUND(w, sp) ((*(w)->lprfsHost->found)(w, sp))
|
|
#define SELF_GOTO(w, l) ((*(w)->lprfsHost->go)(w, l))
|
|
#define SELF_GOTOID(w, sp) ((*(w)->lprfsHost->goToId)(w, sp))
|
|
#define SELF_GOBOTTOM(w) ((*(w)->lprfsHost->goBottom)(w))
|
|
#define SELF_GOTOP(w) ((*(w)->lprfsHost->goTop)(w))
|
|
#define SELF_SEEK(w, i1, v, i2) ((*(w)->lprfsHost->seek)(w, i1, v, i2))
|
|
#define SELF_SKIP(w, l) ((*(w)->lprfsHost->skip)(w, l))
|
|
#define SELF_SKIPFILTER(w, l) ((*(w)->lprfsHost->skipFilter)(w, l))
|
|
#define SELF_SKIPRAW(w, l) ((*(w)->lprfsHost->skipRaw)(w, l))
|
|
|
|
|
|
/* Data management */
|
|
|
|
#define SELF_ADDFIELD(w, ip) ((*(w)->lprfsHost->addField)(w, ip))
|
|
#define SELF_APPEND(w, b) ((*(w)->lprfsHost->append)(w, b))
|
|
#define SELF_CREATEFIELDS(w, v) ((*(w)->lprfsHost->createFields)(w, v))
|
|
#define SELF_DELETE(w) ((*(w)->lprfsHost->deleterec)(w))
|
|
#define SELF_DELETED(w, sp) ((*(w)->lprfsHost->deleted)(w, sp))
|
|
#define SELF_FIELDCOUNT(w, sp) ((*(w)->lprfsHost->fieldCount)(w, sp))
|
|
#define SELF_FIELDDISPLAY(w, sp) ((*(w)->lprfsHost->fieldDisplay)(w, sp))
|
|
#define SELF_FIELDINFO(w,s1,s2,v) ((*(w)->lprfsHost->fieldInfo)(w,s1,s2,v))
|
|
#define SELF_FIELDNAME(w, i, bp) ((*(w)->lprfsHost->fieldName)(w, i, bp))
|
|
#define SELF_FLUSH(w) ((*(w)->lprfsHost->flush)(w))
|
|
#define SELF_GETREC(w, bpp) ((*(w)->lprfsHost->getRec)(w, bpp))
|
|
#define SELF_GETVALUE(w, i, v) ((*(w)->lprfsHost->getValue)(w, i, v))
|
|
#define SELF_GETVARLEN(w, i, lp) ((*(w)->lprfsHost->getVarLen)(w, i, lp))
|
|
#define SELF_GOCOLD(w) ((*(w)->lprfsHost->goCold)(w))
|
|
#define SELF_GOHOT(w) ((*(w)->lprfsHost->goHot)(w))
|
|
#define SELF_PUTVALUE(w, i, v) ((*(w)->lprfsHost->putValue)(w, i, v))
|
|
#define SELF_PUTREC(w, bp) ((*(w)->lprfsHost->putRec)(w, bp))
|
|
#define SELF_RECALL(w) ((*(w)->lprfsHost->recall)(w))
|
|
#define SELF_RECCOUNT(w, lp) ((*(w)->lprfsHost->reccount)(w, lp))
|
|
#define SELF_RECINFO(w,v1,i,v2) ((*(w)->lprfsHost->recInfo)(w,v1,i,v2))
|
|
#define SELF_RECNO(w, lp) ((*(w)->lprfsHost->recno)(w, lp))
|
|
#define SELF_RECID(w, i) ((*(w)->lprfsHost->recid)(w, i))
|
|
#define SELF_SETFIELDEXTENT(w, s) ((*(w)->lprfsHost->setFieldExtent)(w, s))
|
|
|
|
|
|
/* WorkArea/Database management */
|
|
|
|
#define SELF_ALIAS(w, bp) ((*(w)->lprfsHost->alias)(w, bp))
|
|
#define SELF_CLOSE(w) ((*(w)->lprfsHost->close)(w))
|
|
#define SELF_CREATE(w, ip) ((*(w)->lprfsHost->create)(w, ip))
|
|
#define SELF_INFO(w, i, g) ((*(w)->lprfsHost->info)(w, i, g))
|
|
#define SELF_NEW(w) ((*(w)->lprfsHost->newarea)(w))
|
|
#define SELF_OPEN(w, ip) ((*(w)->lprfsHost->open)(w, ip))
|
|
#define SELF_RELEASE(w) ((*(w)->lprfsHost->release)(w))
|
|
#define SELF_STRUCTSIZE(w, sp) ((*(w)->lprfsHost->structSize)(w,sp))
|
|
#define SELF_SYSNAME(w, bp) ((*(w)->lprfsHost->sysName)(w, bp))
|
|
#define SELF_DBEVAL(w, ip) ((*(w)->lprfsHost->dbEval)(w, ip))
|
|
#define SELF_PACK(w) ((*(w)->lprfsHost->pack)(w))
|
|
#define SELF_PACKREC(w, l, sp) ((*(w)->lprfsHost->packRec)(w, l, sp))
|
|
#define SELF_SORT(w, ip) ((*(w)->lprfsHost->sort)(w, ip))
|
|
#define SELF_TRANS(w, ip) ((*(w)->lprfsHost->trans)(w, ip))
|
|
#define SELF_TRANSREC(w, ip) ((*(w)->lprfsHost->transRec)(w, ip))
|
|
#define SELF_ZAP(w) ((*(w)->lprfsHost->zap)(w))
|
|
|
|
|
|
/* Relational Methods */
|
|
|
|
#define SELF_CHILDEND(w, ip) ((*(w)->lprfsHost->childEnd)(w, ip))
|
|
#define SELF_CHILDSTART(w, ip) ((*(w)->lprfsHost->childStart)(w, ip))
|
|
#define SELF_CHILDSYNC(w, ip) ((*(w)->lprfsHost->childSync)(w, ip))
|
|
#define SELF_SYNCCHILDREN(w) ((*(w)->lprfsHost->syncChildren)(w))
|
|
#define SELF_CLEARREL(w) ((*(w)->lprfsHost->clearRel)(w))
|
|
#define SELF_FORCEREL(w) ((*(w)->lprfsHost->forceRel)(w))
|
|
#define SELF_RELAREA(w, s, sp) ((*(w)->lprfsHost->relArea)(w, s, sp))
|
|
#define SELF_RELEVAL(w, ip) ((*(w)->lprfsHost->relEval)(w, ip))
|
|
#define SELF_RELTEXT(w, s, bp) ((*(w)->lprfsHost->relText)(w, s, bp))
|
|
#define SELF_SETREL(w, ip) ((*(w)->lprfsHost->setRel)(w, ip))
|
|
|
|
|
|
/* Order Management */
|
|
|
|
#define SELF_ORDLSTADD(w, lp) ((*(w)->lprfsHost->orderListAdd)(w, lp))
|
|
#define SELF_ORDLSTDELETE(w, lp) ((*(w)->lprfsHost->orderListDelete)(w, lp))
|
|
#define SELF_ORDLSTFOCUS(w, lp) ((*(w)->lprfsHost->orderListFocus)(w,lp))
|
|
#define SELF_ORDLSTREBUILD(w) ((*(w)->lprfsHost->orderListRebuild)(w))
|
|
#define SELF_ORDLSTCLEAR(w) ((*(w)->lprfsHost->orderListClear)(w))
|
|
#define SELF_ORDSETCOND(w, ip) ((*(w)->lprfsHost->orderCondition)(w, ip))
|
|
#define SELF_ORDCREATE(w, ip) ((*(w)->lprfsHost->orderCreate)(w, ip))
|
|
#define SELF_ORDDESTROY(w, p) ((*(w)->lprfsHost->orderDestroy)(w, p))
|
|
#define SELF_ORDINFO(w, i, p) ((*(w)->lprfsHost->orderInfo)(w, i, p))
|
|
#define SELF_ORDEXPR(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_EXPRESSION, p))
|
|
#define SELF_ORDCOND(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_CONDITION, p))
|
|
#define SELF_ORDRECNO(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_RECNO, p))
|
|
#define SELF_ORDPOS(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_POSITION, p))
|
|
#define SELF_ORDNUMBER(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_NUMBER, p))
|
|
#define SELF_ORDNAME(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_NAME, p))
|
|
#define SELF_ORDBAGNAME(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_BAGNAME, p))
|
|
#define SELF_ORDBAGEXT(w, p) ((*(w)->lprfsHost->orderInfo)(w, DBOI_BAGEXT, p))
|
|
|
|
|
|
/* Filters and Scope Settings */
|
|
|
|
#define SELF_CLEARFILTER(w) ((*(w)->lprfsHost->clearFilter)(w))
|
|
#define SELF_CLEARLOCATE(w) ((*(w)->lprfsHost->clearLocate)(w))
|
|
#define SELF_CLEARSCOPE(w) ((*(w)->lprfsHost->clearScope)(w))
|
|
#define SELF_COUNTSCOPE(w,ip,lp) ((*(w)->lprfsHost->countScope)(w,ip,lp))
|
|
#define SELF_FILTERTEXT(w, bp) ((*(w)->lprfsHost->filterText)(w, bp))
|
|
#define SELF_SCOPEINFO(w,i,v) ((*(w)->lprfsHost->scopeInfo)(w,i,v))
|
|
#define SELF_SETFILTER(w, ip) ((*(w)->lprfsHost->setFilter)(w, ip))
|
|
#define SELF_SETLOCATE(w, ip) ((*(w)->lprfsHost->setLocate)(w, ip))
|
|
#define SELF_SETSCOPE(w, ip) ((*(w)->lprfsHost->setScope)(w, ip))
|
|
#define SELF_SKIPSCOPE(w, bp, l) ((*(w)->lprfsHost->skipScope)(w, bp, l))
|
|
#define SELF_LOCATE(w, b) ((*(w)->lprfsHost->locate)(w, b))
|
|
|
|
|
|
/* Miscellaneous */
|
|
|
|
#define SELF_COMPILE(w, bp) ((*(w)->lprfsHost->compile)(w, bp))
|
|
#define SELF_ERROR(w, ip) ((*(w)->lprfsHost->error)(w, ip))
|
|
#define SELF_EVALBLOCK(w, v) ((*(w)->lprfsHost->evalBlock)(w, v))
|
|
|
|
|
|
/* Network operations */
|
|
|
|
#define SELF_GETLOCKS(w, g) ((*(w)->lprfsHost->info)(w, DBI_GETLOCKARRAY, g))
|
|
#define SELF_RAWLOCK(w, i, l) ((*(w)->lprfsHost->rawlock)(w, i, l))
|
|
#define SELF_LOCK(w, sp) ((*(w)->lprfsHost->lock)(w, sp))
|
|
#define SELF_UNLOCK(w, i) ((*(w)->lprfsHost->unlock)(w, i))
|
|
|
|
|
|
/* Memofile functions */
|
|
|
|
#define SELF_CLOSEMEMFILE(w) ((*(w)->lprfsHost->closeMemFile)(w))
|
|
#define SELF_CREATEMEMFILE(w,bp) ((*(w)->lprfsHost->createMemFile)(w,bp))
|
|
#define SELF_GETVALUEFILE(w,i,bp,u) ((*(w)->lprfsHost->getValueFile)(w,i,bp,u))
|
|
#define SELF_OPENMEMFILE(w,bp) ((*(w)->lprfsHost->openMemFile)(w,bp))
|
|
#define SELF_PUTVALUEFILE(w,i,bp,u) ((*(w)->lprfsHost->putValueFile)(w,i,bp,u))
|
|
|
|
|
|
/* Database file header handling */
|
|
|
|
#define SELF_READDBHEADER(w) ((*(w)->lprfsHost->readDBHeader)(w))
|
|
#define SELF_WRITEDBHEADER(w) ((*(w)->lprfsHost->writeDBHeader)(w))
|
|
|
|
|
|
/* Info operations */
|
|
|
|
#define SELF_RECSIZE(w, lp) ((*(w)->lprfsHost->info)(w, DBI_GETRECSIZE, lp))
|
|
#define SELF_HEADERSIZE(w, fp) ((*(w)->lprfsHost->info)(w, DBI_GETHEADERSIZE, fp))
|
|
#define SELF_LUPDATE(w, fp) ((*(w)->lprfsHost->info)(w, DBI_LASTUPDATE, fp ))
|
|
#define SELF_SETDELIM(w, fp) ((*(w)->lprfsHost->info)(w, DBI_SETDELIMITER, fp))
|
|
#define SELF_GETDELIM(w, fp) ((*(w)->lprfsHost->info)(w, DBI_GETDELIMITER, fp))
|
|
#define SELF_TABLEEXT(w, fp) ((*(w)->lprfsHost->info)(w, DBI_TABLEEXT, fp))
|
|
|
|
#define SELF_RDDNODE(w) hb_rddGetNode((w)->rddID)
|
|
|
|
/* non WorkArea functions */
|
|
#define SELF_INIT(r) ((*(r)->pTable.init)(r))
|
|
#define SELF_EXIT(r) ((*(r)->pTable.exit)(r))
|
|
#define SELF_DROP(r, it, ii) ((*(r)->pTable.drop)(r, it, ii))
|
|
#define SELF_EXISTS(r, it, ii) ((*(r)->pTable.exists)(r, it, ii))
|
|
#define SELF_RDDINFO(r, i, l, g) ((*(r)->pTable.rddInfo)(r, i, l, g))
|
|
|
|
|
|
/*--------------------* SUPER Methods *------------------------*/
|
|
|
|
|
|
/* Movement and positioning methods */
|
|
|
|
#define SUPER_BOF(w, sp) ((*(SUPERTABLE)->bof)(w, sp))
|
|
#define SUPER_EOF(w, sp) ((*(SUPERTABLE)->eof)(w, sp))
|
|
#define SUPER_FOUND(w, sp) ((*(SUPERTABLE)->found)(w, sp))
|
|
#define SUPER_GOTO(w, l) ((*(SUPERTABLE)->go)(w, l))
|
|
#define SUPER_GOTOID(w, sp) ((*(SUPERTABLE)->goToId)(w, sp))
|
|
#define SUPER_GOBOTTOM(w) ((*(SUPERTABLE)->goBottom)(w))
|
|
#define SUPER_GOTOP(w) ((*(SUPERTABLE)->goTop)(w))
|
|
#define SUPER_SEEK(w, i1, v, i2) ((*(SUPERTABLE)->seek)(w, i1, v, i2))
|
|
#define SUPER_SKIP(w, l) ((*(SUPERTABLE)->skip)(w, l))
|
|
#define SUPER_SKIPFILTER(w, l) ((*(SUPERTABLE)->skipFilter)(w, l))
|
|
#define SUPER_SKIPRAW(w, l) ((*(SUPERTABLE)->skipRaw)(w, l))
|
|
|
|
|
|
/* Data management */
|
|
|
|
#define SUPER_ADDFIELD(w, ip) ((*(SUPERTABLE)->addField)(w, ip))
|
|
#define SUPER_APPEND(w, b) ((*(SUPERTABLE)->append)(w, b))
|
|
#define SUPER_CREATEFIELDS(w, v) ((*(SUPERTABLE)->createFields)(w, v))
|
|
#define SUPER_DELETE(w) ((*(SUPERTABLE)->deleterec)(w))
|
|
#define SUPER_DELETED(w, sp) ((*(SUPERTABLE)->deleted)(w, sp))
|
|
#define SUPER_FIELDCOUNT(w, sp) ((*(SUPERTABLE)->fieldCount)(w, sp))
|
|
#define SUPER_FIELDDISPLAY(w, sp) ((*(SUPERTABLE)->fieldDisplay)(w, sp))
|
|
#define SUPER_FIELDINFO(w,s1,s2,v) ((*(SUPERTABLE)->fieldInfo)(w,s1,s2,v))
|
|
#define SUPER_FIELDNAME(w, i, bp) ((*(SUPERTABLE)->fieldName)(w, i, bp))
|
|
#define SUPER_FLUSH(w) ((*(SUPERTABLE)->flush)(w))
|
|
#define SUPER_GETREC(w, bpp) ((*(SUPERTABLE)->getRec)(w, bpp))
|
|
#define SUPER_GETVALUE(w, i, v) ((*(SUPERTABLE)->getValue)(w, i, v))
|
|
#define SUPER_GETVARLEN(w, i, lp) ((*(SUPERTABLE)->getVarLen)(w, i, lp))
|
|
#define SUPER_GOCOLD(w) ((*(SUPERTABLE)->goCold)(w))
|
|
#define SUPER_GOHOT(w) ((*(SUPERTABLE)->goHot)(w))
|
|
#define SUPER_PUTVALUE(w, i, v) ((*(SUPERTABLE)->putValue)(w, i, v))
|
|
#define SUPER_PUTREC(w, bp) ((*(SUPERTABLE)->putRec)(w, bp))
|
|
#define SUPER_RECALL(w) ((*(SUPERTABLE)->recall)(w))
|
|
#define SUPER_RECCOUNT(w, lp) ((*(SUPERTABLE)->reccount)(w, lp))
|
|
#define SUPER_RECINFO(w,v1,i,v2) ((*(SUPERTABLE)->recInfo)(w,v1,i,v2))
|
|
#define SUPER_RECNO(w, lp) ((*(SUPERTABLE)->recno)(w, lp))
|
|
#define SUPER_RECID(w, i) ((*(SUPERTABLE)->recid)(w, i))
|
|
#define SUPER_SETFIELDEXTENT(w, s) ((*(SUPERTABLE)->setFieldExtent)(w, s))
|
|
|
|
|
|
/* WorkArea/Database management */
|
|
|
|
#define SUPER_ALIAS(w, bp) ((*(SUPERTABLE)->alias)(w, bp))
|
|
#define SUPER_CLOSE(w) ((*(SUPERTABLE)->close)(w))
|
|
#define SUPER_CREATE(w, ip) ((*(SUPERTABLE)->create)(w, ip))
|
|
#define SUPER_INFO(w, i, g) ((*(SUPERTABLE)->info)(w, i, g))
|
|
#define SUPER_NEW(w) ((*(SUPERTABLE)->newarea)(w))
|
|
#define SUPER_OPEN(w, ip) ((*(SUPERTABLE)->open)(w, ip))
|
|
#define SUPER_RELEASE(w) ((*(SUPERTABLE)->release)(w))
|
|
#define SUPER_STRUCTSIZE(w, sp) ((*(SUPERTABLE)->structSize)(w, sp))
|
|
#define SUPER_SYSNAME(w, bp) ((*(SUPERTABLE)->sysName)(w, bp))
|
|
#define SUPER_DBEVAL(w, ip) ((*(SUPERTABLE)->dbEval)(w, ip))
|
|
#define SUPER_PACK(w) ((*(SUPERTABLE)->pack)(w))
|
|
#define SUPER_PACKREC(w, l, sp) ((*(SUPERTABLE)->packRec)(w, l, sp))
|
|
#define SUPER_SORT(w, ip) ((*(SUPERTABLE)->sort)(w, ip))
|
|
#define SUPER_TRANS(w, ip) ((*(SUPERTABLE)->trans)(w, ip))
|
|
#define SUPER_TRANSREC(w, ip) ((*(SUPERTABLE)->transRec)(w, ip))
|
|
#define SUPER_ZAP(w) ((*(SUPERTABLE)->zap)(w))
|
|
|
|
|
|
/* Relational Methods */
|
|
|
|
#define SUPER_CHILDEND(w, ip) ((*(SUPERTABLE)->childEnd)(w, ip))
|
|
#define SUPER_CHILDSTART(w, ip) ((*(SUPERTABLE)->childStart)(w, ip))
|
|
#define SUPER_CHILDSYNC(w, ip) ((*(SUPERTABLE)->childSync)(w, ip))
|
|
#define SUPER_SYNCCHILDREN(w) ((*(SUPERTABLE)->syncChildren)(w))
|
|
#define SUPER_CLEARREL(w) ((*(SUPERTABLE)->clearRel)(w))
|
|
#define SUPER_FORCEREL(w) ((*(SUPERTABLE)->forceRel)(w))
|
|
#define SUPER_RELAREA(w, s, sp) ((*(SUPERTABLE)->relArea)(w, s, sp))
|
|
#define SUPER_RELEVAL(w, ip) ((*(SUPERTABLE)->relEval)(w, ip))
|
|
#define SUPER_RELTEXT(w, s, bp) ((*(SUPERTABLE)->relText)(w, s, bp))
|
|
#define SUPER_SETREL(w, ip) ((*(SUPERTABLE)->setRel)(w, ip))
|
|
|
|
|
|
/* Order Management */
|
|
|
|
#define SUPER_ORDLSTADD(w, lp) ((*(SUPERTABLE)->orderListAdd)(w, lp))
|
|
#define SUPER_ORDLSTDELETE(w, lp) ((*(SUPERTABLE)->orderListDelete)(w, lp))
|
|
#define SUPER_ORDLSTFOCUS(w, lp) ((*(SUPERTABLE)->orderListFocus)(w, lp))
|
|
#define SUPER_ORDLSTREBUILD(w) ((*(SUPERTABLE)->orderListRebuild)(w))
|
|
#define SUPER_ORDLSTCLEAR(w) ((*(SUPERTABLE)->orderListClear)(w))
|
|
#define SUPER_ORDSETCOND(w,ip) ((*(SUPERTABLE)->orderCondition)(w, ip))
|
|
#define SUPER_ORDCREATE(w, ip) ((*(SUPERTABLE)->orderCreate)(w, ip))
|
|
#define SUPER_ORDDELETE(w, ip) ((*(SUPERTABLE)->orderDelete)(w, ip))
|
|
#define SUPER_ORDINFO(w, i, p) ((*(SUPERTABLE)->orderInfo)(w, i, p))
|
|
#define SUPER_ORDEXPR(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_EXPRESSION, p))
|
|
#define SUPER_ORDCOND(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_CONDITION, p))
|
|
#define SUPER_ORDRECNO(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_RECNO, p))
|
|
#define SUPER_ORDPOS(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_POSITION, p))
|
|
#define SUPER_ORDNUMBER(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_NUMBER, p))
|
|
#define SUPER_ORDNAME(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_NAME, p))
|
|
#define SUPER_ORDBAGNAME(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_BAGNAME, p))
|
|
#define SUPER_ORDBAGEXT(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_BAGEXT, p))
|
|
|
|
|
|
/* Filters and Scope Settings */
|
|
|
|
#define SUPER_CLEARFILTER(w) ((*(SUPERTABLE)->clearFilter)(w))
|
|
#define SUPER_CLEARLOCATE(w) ((*(SUPERTABLE)->clearLocate)(w))
|
|
#define SUPER_CLEARSCOPE(w) ((*(SUPERTABLE)->clearScope)(w))
|
|
#define SUPER_COUNTSCOPE(w,ip,lp) ((*(SUPERTABLE)->countScope)(w,ip,lp))
|
|
#define SUPER_FILTERTEXT(w, bp) ((*(SUPERTABLE)->filterText)(w, bp))
|
|
#define SUPER_SCOPEINFO(w,i,v) ((*(SUPERTABLE)->scopeInfo)(w,i,v))
|
|
#define SUPER_SETFILTER(w, ip) ((*(SUPERTABLE)->setFilter)(w, ip))
|
|
#define SUPER_SETLOCATE(w, ip) ((*(SUPERTABLE)->setLocate)(w, ip))
|
|
#define SUPER_SETSCOPE(w, ip) ((*(SUPERTABLE)->setScope)(w, ip))
|
|
#define SUPER_SKIPSCOPE(w, bp, l) ((*(SUPERTABLE)->skipScope)(w, bp, l))
|
|
#define SUPER_LOCATE(w, b) ((*(SUPERTABLE)->locate)(w, b))
|
|
|
|
|
|
/* Miscellaneous */
|
|
|
|
#define SUPER_COMPILE(w, bp) ((*(SUPERTABLE)->compile)(w, bp))
|
|
#define SUPER_ERROR(w, ip) ((*(SUPERTABLE)->error)(w, ip))
|
|
#define SUPER_EVALBLOCK(w, v) ((*(SUPERTABLE)->evalBlock)(w, v))
|
|
|
|
|
|
/* Network operations */
|
|
|
|
#define SUPER_GETLOCKS(w, g) ((*(SUPERTABLE)->info)(w, DBI_GETLOCKARRAY, g))
|
|
#define SUPER_RAWLOCK(w, i, l) ((*(SUPERTABLE)->rawlock)(w, i, l))
|
|
#define SUPER_LOCK(w, sp) ((*(SUPERTABLE)->lock)(w, sp))
|
|
#define SUPER_UNLOCK(w, i) ((*(SUPERTABLE)->unlock)(w, i))
|
|
|
|
|
|
/* Memofile functions */
|
|
|
|
#define SUPER_CLOSEMEMFILE(w) ((*(SUPERTABLE)->closeMemFile)(w))
|
|
#define SUPER_CREATEMEMFILE(w,bp) ((*(SUPERTABLE)->createMemFile)(w,bp))
|
|
#define SUPER_GETVALUEFILE(w,i,bp,u) ((*(SUPERTABLE)->getValueFile)(w,i,bp,u))
|
|
#define SUPER_OPENMEMFILE(w,bp) ((*(SUPERTABLE)->openMemFile)(w,bp))
|
|
#define SUPER_PUTVALUEFILE(w,i,bp,u) ((*(SUPERTABLE)->putValueFile)(w,i,bp,u))
|
|
|
|
|
|
/* Database file header handling */
|
|
|
|
#define SUPER_READDBHEADER(w) ((*(SUPERTABLE)->readDBHeader)(w))
|
|
#define SUPER_WRITEDBHEADER(w) ((*(SUPERTABLE)->writeDBHeader)(w))
|
|
|
|
|
|
/* Info operations */
|
|
|
|
#define SUPER_RECSIZE(w, lp) ((*(SUPERTABLE)->info)(w, DBI_GETRECSIZE, lp))
|
|
#define SUPER_HEADERSIZE(w, fp) ((*(SUPERTABLE)->info)(w, DBI_GETHEADERSIZE, fp))
|
|
#define SUPER_LUPDATE(w, fp) ((*(SUPERTABLE)->info)(w, DBI_LASTUPDATE, fp ))
|
|
#define SUPER_SETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_SETDELIMITER, fp))
|
|
#define SUPER_GETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_GETDELIMITER, fp))
|
|
#define SUPER_TABLEEXT(w, fp) ((*(SUPERTABLE)->info)(w, DBI_TABLEEXT, fp))
|
|
|
|
/* non WorkArea functions */
|
|
#define SUPER_INIT(r) ((*(SUPERTABLE)->init)(r))
|
|
#define SUPER_EXIT(r) ((*(SUPERTABLE)->exit)(r))
|
|
#define SUPER_DROP(r, it, ii) ((*(SUPERTABLE)->drop)(r, it, ii))
|
|
#define SUPER_EXISTS(r, it, ii) ((*(SUPERTABLE)->exists)(r, it, ii))
|
|
#define SUPER_RDDINFO(r, i, l, g) ((*(SUPERTABLE)->rddInfo)(r, i, l, g))
|
|
|
|
#define ISSUPER_INIT(r) ((SUPERTABLE)->init != NULL)
|
|
#define ISSUPER_EXIT(r) ((SUPERTABLE)->exit != NULL)
|
|
|
|
/*
|
|
* PROTOTYPES
|
|
* ----------
|
|
*/
|
|
extern HB_EXPORT int hb_rddRegister( char * szDriver, USHORT uiType );
|
|
extern HB_EXPORT ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName );
|
|
extern HB_EXPORT LPRDDNODE hb_rddGetNode( USHORT uiNode );
|
|
#if 0
|
|
extern HB_EXPORT ERRCODE hb_rddDisinherit( BYTE * drvName );
|
|
extern HB_EXPORT USHORT hb_rddExtendType( HB_TYPE fieldType );
|
|
extern HB_EXPORT HB_TYPE hb_rddFieldType( USHORT extendType );
|
|
#endif
|
|
|
|
typedef short (* WACALLBACK )( AREA *, int );
|
|
extern HB_EXPORT ERRCODE hb_rddIterateWorkAreas ( WACALLBACK pCallBack, int data );
|
|
extern HB_EXPORT USHORT hb_rddFieldIndex( AREAP pArea, char * szName );
|
|
extern HB_EXPORT USHORT hb_rddFieldExpIndex( AREAP pArea, char * szField );
|
|
extern HB_EXPORT ERRCODE hb_rddGetTempAlias( char * szAliasTmp );
|
|
|
|
HB_EXTERN_END
|
|
|
|
#endif /* HB_APIRDD_H_ */
|