*** empty log message ***
This commit is contained in:
@@ -1,8 +1,63 @@
|
||||
19990805-17:10 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* source/rtl/setcolor.c
|
||||
! #includes "extend.h" instead of "pcode.h"
|
||||
* source/compiler/harbour.y
|
||||
include/hb_vmpub.c
|
||||
% New header file which contains only those definitions which are
|
||||
a must to compile a Harbour generated C file.
|
||||
* source/rtl/natmsg/msghe862.c
|
||||
source/rtl/natmsg/msghewin.c
|
||||
source/rtl/msgxxx.c
|
||||
+ Hebrew language files added
|
||||
(Posted by Chen Kedem <niki@synel.co.il>)
|
||||
* source/rtl/Makefile
|
||||
source/rtl/menu.prg (removed)
|
||||
source/rtl/menuto.prg (added)
|
||||
tests/working/testmenu.prg (removed)
|
||||
tests/working/menutest.prg (added)
|
||||
tests/working/Makefile
|
||||
+ New MENU TO implementation (Phil Barnett)
|
||||
which is highly Clipper compatible. (nesting, color and setting
|
||||
buffering, setkey, some side effects simulated, output redir behav.)
|
||||
"~" hotkey char support removed, since there's no such in Clipper.
|
||||
+ Test includes recursive capability
|
||||
! Test added to Makefile
|
||||
* source/rtl/achoice.prg
|
||||
+ Added SETKEY() handling.
|
||||
* source/rtl/alert.prg
|
||||
! HARBOUR_STRICT_CLIPPER_COMPATIBILITY mode bug fixed.
|
||||
* include/extend.h
|
||||
- Removed obsolete SYMBOL type.
|
||||
* include/pcode.h
|
||||
source/compiler/harbour.y
|
||||
- #include "extend.h" removed from pcode.h
|
||||
* include/hbdefs.h
|
||||
include/extend.h
|
||||
include/filesys.h
|
||||
include/rddapi.h
|
||||
include/rddapi.h
|
||||
source/rdd/dbf1.c
|
||||
source/rdd/dbfntx\dbfntx1.c
|
||||
source/rdd/dbcmd.c
|
||||
source/rtl/gt\gtos2.c
|
||||
source/rtl/copyfile.c
|
||||
source/rtl/environ.c
|
||||
source/rtl/filesys.c
|
||||
source/runner/runner.c
|
||||
source/vm/hvm.c
|
||||
source/tools/hb_f.c
|
||||
Non Harbour standard, sparsly used and redundant types removed.
|
||||
- PBYTE -> BYTE * (few occurences)
|
||||
BYTEP -> BYTE * (few occurences, non standard)
|
||||
PVOID -> void * (1 occurence)
|
||||
FARPP -> void ** (few occurences)
|
||||
FARP -> void * (few occurences)
|
||||
|
||||
19990805-04:47 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* source/rtl/console.c - Small var naming change.
|
||||
* source/rtl/achoice.prg
|
||||
! Fixed: SET DEVICE is no longer redirecting it's output.
|
||||
% Optimialized color handling. (Thanks to Paul Tucker)
|
||||
% Optimalized color handling. (Thanks to Paul Tucker)
|
||||
|
||||
19990804-14:30 EDT Paul Tucker <ptucker@sympatico.ca>
|
||||
* source/rtl/filesys.c
|
||||
@@ -44,18 +99,18 @@
|
||||
|
||||
Wed Aug 04 12:25:12 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
|
||||
* source/rdd/dbcmd.c:
|
||||
Got rid of the bell (0x07) character printed in error messages; it
|
||||
tends to screw up in some consoles.
|
||||
Changed hb_rddRegister() to return an int rather than a bool, so
|
||||
now it is possible to return different status values.
|
||||
Now trying to register the same RDD more than once is a NOOP.
|
||||
|
||||
* source/rdd/dbfntx/dbfntx0.prg:
|
||||
KLUDGE ALARM: since the DBFNTX driver depends on the DBF driver,
|
||||
and the order of INIT procedures is not guaranteed (and is
|
||||
actually the wrong order under gcc/Win32), I forced the
|
||||
initialization of DBF before DBFNTX.
|
||||
* source/rdd/dbcmd.c:
|
||||
Got rid of the bell (0x07) character printed in error messages; it
|
||||
tends to screw up in some consoles.
|
||||
Changed hb_rddRegister() to return an int rather than a bool, so
|
||||
now it is possible to return different status values.
|
||||
Now trying to register the same RDD more than once is a NOOP.
|
||||
|
||||
* source/rdd/dbfntx/dbfntx0.prg:
|
||||
KLUDGE ALARM: since the DBFNTX driver depends on the DBF driver,
|
||||
and the order of INIT procedures is not guaranteed (and is
|
||||
actually the wrong order under gcc/Win32), I forced the
|
||||
initialization of DBF before DBFNTX.
|
||||
|
||||
19990804-17:30 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* source/rtl/msgxxx.c
|
||||
@@ -87,7 +142,7 @@ Wed Aug 04 12:25:12 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
+ Language API initial implementation.
|
||||
* source/rtl/vm/ForTest()
|
||||
- Removed the "internal error" which stated that there will
|
||||
be infinite loop if STEP 0 is used, Clipper just goes into an
|
||||
be infinite loop if STEP 0 is used, Clipper just goes into an
|
||||
ininite loop.
|
||||
! Changed printf() to a standard error is STEP expression is not numeric.
|
||||
* include/errorapi.h
|
||||
@@ -142,27 +197,27 @@ Wed Aug 04 12:25:12 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
+ CVS tags added.
|
||||
* source/rtl/Makefile
|
||||
+ Added tget*.prg
|
||||
|
||||
|
||||
Wed Aug 04 11:00:07 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
|
||||
* source/tools/stringsx.c:
|
||||
* source/rtl/Makefile:
|
||||
* source/rtl/stringsx.c:
|
||||
Moved STRTOKEN from tools/ to rtl/, even though it is not a 100%
|
||||
Clipper standard function. The reason is because we will probably
|
||||
be using this function a lot (such as Antonio did in TGet.prg).
|
||||
|
||||
* source/rtl/gt/gtwin.c:
|
||||
* source/vm/hvm.c:
|
||||
Fixed two minor warnings.
|
||||
* source/tools/stringsx.c:
|
||||
* source/rtl/Makefile:
|
||||
* source/rtl/stringsx.c:
|
||||
Moved STRTOKEN from tools/ to rtl/, even though it is not a 100%
|
||||
Clipper standard function. The reason is because we will probably
|
||||
be using this function a lot (such as Antonio did in TGet.prg).
|
||||
|
||||
* source/rtl/gt/gtwin.c:
|
||||
* source/vm/hvm.c:
|
||||
Fixed two minor warnings.
|
||||
|
||||
Wed Aug 04 10:12:24 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
|
||||
* config/win32/gcc.cf:
|
||||
Got rid of -( and -).
|
||||
* config/win32/gcc.cf:
|
||||
Got rid of -( and -).
|
||||
|
||||
* tests/working/Makefile:
|
||||
Corrected the order of the libraries to link against.
|
||||
* tests/working/Makefile:
|
||||
Corrected the order of the libraries to link against.
|
||||
|
||||
199908.04-16:32 GMT+3 Alexander Kresin
|
||||
* source/hbpp/table.c
|
||||
@@ -304,13 +359,13 @@ Wed Aug 04 10:12:24 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
|
||||
Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
|
||||
* include/rddapi.h:
|
||||
Changed all #ifdef 0 with #if 0, assuming the original intent was
|
||||
to comment those sections out.
|
||||
* include/rddapi.h:
|
||||
Changed all #ifdef 0 with #if 0, assuming the original intent was
|
||||
to comment those sections out.
|
||||
|
||||
* source/rtl/gt/gtwin.c:
|
||||
Moved an unused variable within the commented out portion of the
|
||||
code where it was used.
|
||||
* source/rtl/gt/gtwin.c:
|
||||
Moved an unused variable within the commented out portion of the
|
||||
code where it was used.
|
||||
|
||||
19990803-14:55 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
! source/rtl/strings.c - ASC() fixed. It could return negative values
|
||||
@@ -393,19 +448,19 @@ Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
19990803-05:30 GMT+2 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*tests/working/Makefile
|
||||
+ added possibility to build a single file. Usage:
|
||||
make PM=file
|
||||
make PM=file.prg
|
||||
PM can be replaced with pm
|
||||
+ added possibility to build a single file. Usage:
|
||||
make PM=file
|
||||
make PM=file.prg
|
||||
PM can be replaced with pm
|
||||
|
||||
*source/compiler/harbour.y
|
||||
* DO .. WITH .. statement passes variables by reference now
|
||||
* DO .. WITH .. statement passes variables by reference now
|
||||
|
||||
*source/vm/hvm.c
|
||||
* added reporting of line numbers in some internal errors
|
||||
* added reporting of line numbers in some internal errors
|
||||
|
||||
*source/compiler/harbour.l
|
||||
* corrected missed line continuation with BREAK; EXIT; and LOOP;
|
||||
* corrected missed line continuation with BREAK; EXIT; and LOOP;
|
||||
|
||||
19990802-20:00 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
* config/os2/icc.cf
|
||||
@@ -458,26 +513,26 @@ Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
* tests/working/dates4.prg
|
||||
* Changed CHR(10) to CHR(13)+CHR(10)
|
||||
* tests/working/dirtest.prg
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
use the result to determine whether to use CR,LF or LF.
|
||||
* tests/working/inherit.prg
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
use the result to determine whether to use CR,LF or LF.
|
||||
* tests/working/inkeytst.prg
|
||||
+ Added two command line parameters: If the first one is
|
||||
present, only the last test will be run. If the second
|
||||
one is present, extended keyboard codes are allowed.
|
||||
* tests/working/longstr2.prg
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
use the result to determine whether to use CR,LF or LF.
|
||||
* tests/working/readfile.prg
|
||||
* Changed from having newline differ based on Clipper vs.
|
||||
Harbour to having it differ based on DOS vs. Unix.
|
||||
* tests/working/round.prg
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
use the result to determine whether to use CR,LF or LF.
|
||||
* tests/working/seconds.prg
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
* Attempt to determine if running on a DOS type system and
|
||||
use the result to determine whether to use CR,LF or LF.
|
||||
* tests/working/set_num.prg
|
||||
* Changed CHR(10) to CHR(13)+CHR(10)
|
||||
@@ -487,7 +542,7 @@ Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
source/rtl/dates.c - const keyword added.
|
||||
- include/ctoharb.h - extern StackShow() removed.
|
||||
- include/set.h - HARBOUR externs removed.
|
||||
* include/extend.h hb_item*() moved to
|
||||
* include/extend.h hb_item*() moved to
|
||||
include/itemapi.h
|
||||
source/rtl/console.c
|
||||
source/rtl/transfrm.c
|
||||
@@ -616,16 +671,16 @@ Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
+ hb_gt_DispBegin hb_gt_DispEnd hb_gt_ScreenBuffer hb_gt_SetMode
|
||||
* makefile.vc
|
||||
+ added do
|
||||
|
||||
|
||||
19990802-06:30 GMT+2 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/tools/strfmt.c
|
||||
* added (char *) type cast to call for hb_xgrab()
|
||||
* added (char *) type cast to call for hb_xgrab()
|
||||
|
||||
*config/dos/djgpp.cf
|
||||
*config/linux/gcc.cf
|
||||
* changed to link correctly regardless the libraries order
|
||||
(the GCC linker searches the library only once by default)
|
||||
* changed to link correctly regardless the libraries order
|
||||
(the GCC linker searches the library only once by default)
|
||||
|
||||
*source/rtl/classes.c
|
||||
*source/rtl/dates.c
|
||||
@@ -670,8 +725,8 @@ Tue Aug 03 11:20:17 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
|
||||
statement
|
||||
|
||||
*source/rtl/Makefile
|
||||
+ added new file do.c
|
||||
|
||||
+ added new file do.c
|
||||
|
||||
19990801-21:58 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
% source/rtl/descend.c
|
||||
#include <ctype.h> removed
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef struct
|
||||
SYMBOLSCOPE cScope; /* the scope of the symbol */
|
||||
PHB_FUNC pFunPtr; /* function address for function symbol table entries */
|
||||
struct _DYNSYM * pDynSym; /* pointer to its dynamic symbol if defined */
|
||||
} HB_SYMB, * PHB_SYMB, * HB_SYMB_PTR, SYMBOL, * PSYMBOL, * SYMBOL_PTR;
|
||||
} HB_SYMB, * PHB_SYMB, * HB_SYMB_PTR;
|
||||
|
||||
/* Harbour Functions scope */
|
||||
#define FS_PUBLIC 0
|
||||
@@ -60,7 +60,7 @@ typedef struct
|
||||
#define FS_MESSAGE 32
|
||||
#define FS_MEMVAR 128
|
||||
|
||||
extern void VirtualMachine( PBYTE pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
|
||||
extern void VirtualMachine( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
|
||||
extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
|
||||
|
||||
/* items types */
|
||||
@@ -145,7 +145,7 @@ struct hb_struMemvar
|
||||
|
||||
struct hb_struPointer
|
||||
{
|
||||
PVOID value;
|
||||
void * value;
|
||||
};
|
||||
|
||||
struct hb_struRefer
|
||||
|
||||
@@ -51,28 +51,27 @@
|
||||
#include "fileio.ch"
|
||||
|
||||
typedef int FHANDLE;
|
||||
typedef PBYTE BYTEP;
|
||||
|
||||
extern BOOL hb_fsChDir ( BYTEP fpDirName );
|
||||
extern USHORT hb_fsChDrv ( BYTEP nDrive );
|
||||
extern BOOL hb_fsChDir ( BYTE * fpDirName );
|
||||
extern USHORT hb_fsChDrv ( BYTE * nDrive );
|
||||
extern void hb_fsClose ( FHANDLE hFileHandle );
|
||||
extern void hb_fsCommit ( FHANDLE hFileHandle );
|
||||
extern FHANDLE hb_fsCreate ( BYTEP fpFilename, USHORT uiAttribute );
|
||||
extern BYTEP hb_fsCurDir ( USHORT uiDrive );
|
||||
extern FHANDLE hb_fsCreate ( BYTE * fpFilename, USHORT uiAttribute );
|
||||
extern BYTE * hb_fsCurDir ( USHORT uiDrive );
|
||||
extern BYTE hb_fsCurDrv ( void );
|
||||
extern void hb_fsDelete ( BYTEP fpFilename );
|
||||
extern void hb_fsDelete ( BYTE * fpFilename );
|
||||
extern USHORT hb_fsError ( void );
|
||||
extern FHANDLE hb_fsExtOpen ( BYTEP fpFilename, BYTEP fpDefExt,
|
||||
USHORT uiFlags, BYTEP fpPaths, PHB_ITEM pError );
|
||||
extern FHANDLE hb_fsExtOpen ( BYTE * fpFilename, BYTE * fpDefExt,
|
||||
USHORT uiFlags, BYTE * fpPaths, PHB_ITEM pError );
|
||||
extern USHORT hb_fsIsDrv ( BYTE nDrive );
|
||||
extern BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart,
|
||||
ULONG ulLength, USHORT uiMode );
|
||||
extern BOOL hb_fsMkDir ( BYTEP fpDirName );
|
||||
extern FHANDLE hb_fsOpen ( BYTEP fpFilename, USHORT uiFlags );
|
||||
extern USHORT hb_fsRead ( FHANDLE hFileHandle, BYTEP fpBuff, USHORT uiCount );
|
||||
extern BOOL hb_fsRmDir ( BYTEP fpDirName );
|
||||
extern void hb_fsRename ( BYTEP fpOldName, BYTEP fpNewName );
|
||||
extern BOOL hb_fsMkDir ( BYTE * fpDirName );
|
||||
extern FHANDLE hb_fsOpen ( BYTE * fpFilename, USHORT uiFlags );
|
||||
extern USHORT hb_fsRead ( FHANDLE hFileHandle, BYTE * fpBuff, USHORT uiCount );
|
||||
extern BOOL hb_fsRmDir ( BYTE * fpDirName );
|
||||
extern void hb_fsRename ( BYTE * fpOldName, BYTE * fpNewName );
|
||||
extern ULONG hb_fsSeek ( FHANDLE hFileHandle, LONG lOffset, USHORT uiMode );
|
||||
extern USHORT hb_fsWrite ( FHANDLE hFileHandle, BYTEP fpBuff, USHORT uiCount );
|
||||
extern USHORT hb_fsWrite ( FHANDLE hFileHandle, BYTE * fpBuff, USHORT uiCount );
|
||||
|
||||
#endif /* HB_FILESYS_H_ */
|
||||
|
||||
87
harbour/include/hb_vmpub.h
Normal file
87
harbour/include/hb_vmpub.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* This is the header file which is included to every */
|
||||
/* Harbour generated C source file */
|
||||
|
||||
/*
|
||||
Copyright(C) 1999 by Antonio Linares.
|
||||
|
||||
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 of the License, 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 program; if not, write to:
|
||||
|
||||
The Free Software Foundation, Inc.,
|
||||
675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
You can contact me at: alinares@fivetech.com
|
||||
*/
|
||||
|
||||
#ifndef HB_VMPUB_H_
|
||||
#define HB_VMPUB_H_
|
||||
|
||||
#include "pcode.h"
|
||||
|
||||
/* Dummy definitions */
|
||||
|
||||
typedef void * PDYNSYM;
|
||||
|
||||
/* Parts copied from hbdefs.h */
|
||||
|
||||
typedef unsigned char BYTE; /* 1 byte unsigned */
|
||||
typedef unsigned short int WORD;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define pascal __attribute__ ((stdcall))
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define HARBOUR void
|
||||
#else
|
||||
#ifdef __IBMCPP__
|
||||
#define HARBOUR void
|
||||
#else
|
||||
#define HARBOUR void pascal
|
||||
#endif
|
||||
#endif
|
||||
typedef void * PHB_FUNC;
|
||||
|
||||
typedef char SYMBOLSCOPE; /* stores symbol's scope */
|
||||
|
||||
/* Parts copied from extend.h */
|
||||
|
||||
/* symbol support structure */
|
||||
typedef struct
|
||||
{
|
||||
char * szName; /* the name of the symbol */
|
||||
SYMBOLSCOPE cScope; /* the scope of the symbol */
|
||||
PHB_FUNC pFunPtr; /* function address for function symbol table entries */
|
||||
PDYNSYM pDynSym; /* pointer to its dynamic symbol if defined */
|
||||
} HB_SYMB, * PHB_SYMB;
|
||||
|
||||
extern void VirtualMachine( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
|
||||
|
||||
/* Harbour Functions scope */
|
||||
#define FS_PUBLIC 0
|
||||
#define FS_STATIC 2
|
||||
#define FS_INIT 8
|
||||
#define FS_EXIT 16
|
||||
#define FS_INITEXIT ( FS_INIT | FS_EXIT )
|
||||
#define FS_MESSAGE 32
|
||||
#define FS_MEMVAR 128
|
||||
|
||||
/* This should always follow the type declarations */
|
||||
|
||||
#include "init.h"
|
||||
|
||||
#endif /* HB_VMPUB_H_ */
|
||||
@@ -32,11 +32,8 @@
|
||||
|
||||
#if ! defined(HB_DONT_DEFINE_BASIC_TYPES)
|
||||
|
||||
#undef PVOID
|
||||
typedef void * PVOID;
|
||||
|
||||
#undef BYTE
|
||||
typedef unsigned char BYTE, * PBYTE; /* 1 byte unsigned */
|
||||
typedef unsigned char BYTE; /* 1 byte unsigned */
|
||||
|
||||
#undef WORD /* 2 bytes unsigned */
|
||||
typedef unsigned short int WORD;
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#ifndef HB_PCODE_H_
|
||||
#define HB_PCODE_H_
|
||||
|
||||
#include "extend.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HB_P_AND, /* peforms the logical AND of two latest stack values, removes them and places result */
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "filesys.h"
|
||||
|
||||
typedef USHORT ERRCODE;
|
||||
typedef void * FARP;
|
||||
|
||||
/* RDD method return codes */
|
||||
|
||||
@@ -127,7 +126,7 @@ typedef FILEINFO * LPFILEINFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BYTEP atomName; /* FIELD (symbol) name */
|
||||
BYTE * atomName; /* FIELD (symbol) name */
|
||||
USHORT uiType; /* FIELD type */
|
||||
USHORT typeExtended; /* FIELD type extended */
|
||||
USHORT uiLen; /* Overall FIELD length */
|
||||
@@ -146,12 +145,12 @@ typedef DBFIELDINFO * LPDBFIELDINFO;
|
||||
typedef struct
|
||||
{
|
||||
USHORT uiArea; /* Work Area number of the data store */
|
||||
BYTEP abName; /* The qualified name of the data store */
|
||||
BYTEP atomAlias; /* The logical name 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 */
|
||||
|
||||
FARP lpdbHeader; /* Pointer to a header of the data store */
|
||||
void * lpdbHeader; /* Pointer to a header of the data store */
|
||||
} DBOPENINFO;
|
||||
|
||||
typedef DBOPENINFO * LPDBOPENINFO;
|
||||
@@ -167,7 +166,7 @@ typedef DBOPENINFO * LPDBOPENINFO;
|
||||
typedef struct _DBORDERCONDINFO
|
||||
{
|
||||
BOOL fActive;
|
||||
BYTEP abFor;
|
||||
BYTE * abFor;
|
||||
PHB_ITEM itmCobFor;
|
||||
PHB_ITEM itmCobWhile;
|
||||
PHB_ITEM itmCobEval;
|
||||
@@ -184,7 +183,7 @@ typedef struct _DBORDERCONDINFO
|
||||
BOOL fUseCurrent;
|
||||
BOOL fCustom;
|
||||
BOOL fNoOptimize;
|
||||
FARP lpvCargo;
|
||||
void * lpvCargo;
|
||||
|
||||
} DBORDERCONDINFO;
|
||||
|
||||
@@ -203,8 +202,8 @@ typedef DBORDERCONDINFO * LPDBORDERCONDINFO;
|
||||
typedef struct
|
||||
{
|
||||
LPDBORDERCONDINFO lpdbOrdCondInfo; /* Conditional information */
|
||||
BYTEP abBagName; /* Name of the Order bag */
|
||||
BYTEP atomBagName; /* Name of the Order */
|
||||
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 */
|
||||
/* las claves con £nicas */
|
||||
@@ -469,7 +468,7 @@ typedef struct _FIELD
|
||||
USHORT uiLen; /* Field length */
|
||||
USHORT uiDec; /* Decimal length */
|
||||
USHORT uiArea; /* Area this field resides in */
|
||||
FARP sym; /* Symbol that represents the field */
|
||||
void * sym; /* Symbol that represents the field */
|
||||
|
||||
struct _FIELD *lpfNext; /* The next field in the list */
|
||||
|
||||
@@ -495,13 +494,13 @@ typedef struct _AREA
|
||||
struct _RDDFUNCS * lprfsHost; /* Virtual method table for this workarea */
|
||||
|
||||
USHORT uiArea; /* The number assigned to this workarea */
|
||||
// FARP atomAlias; /* Pointer to the alias symbol for 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 */
|
||||
|
||||
// FARP lpFieldExtents; /* Void ptr for additional field properties */
|
||||
// void * lpFieldExtents; /* Void ptr for additional field properties */
|
||||
|
||||
// PHB_ITEM valResult; /* All purpose result holder */
|
||||
|
||||
@@ -547,11 +546,11 @@ typedef USHORT ( * DBENTRYP_SP )( AREAP area, USHORT * param );
|
||||
#if 0
|
||||
typedef USHORT ( * DBENTRYP_S )( AREAP area, USHORT param);
|
||||
typedef USHORT ( * DBENTRYP_LP )( AREAP area, LONGP param);
|
||||
typedef USHORT ( * DBENTRYP_PP )( AREAP area, FARPP param);
|
||||
typedef USHORT ( * DBENTRYP_SVP )( AREAP area, USHORT index, FARP param);
|
||||
typedef USHORT ( * DBENTRYP_SVPB )( AREAP area, USHORT index, FARP param, USHORT mode);
|
||||
typedef USHORT ( * DBENTRYP_VPL )( AREAP area, FARP p1, LONG p2);
|
||||
typedef USHORT ( * DBENTRYP_VPLP )( AREAP area, FARP p1, LONGP p2);
|
||||
typedef USHORT ( * DBENTRYP_PP )( AREAP area, void ** param);
|
||||
typedef USHORT ( * DBENTRYP_SVP )( AREAP area, USHORT index, void * param);
|
||||
typedef USHORT ( * DBENTRYP_SVPB )( AREAP area, USHORT index, void * param, USHORT mode);
|
||||
typedef USHORT ( * DBENTRYP_VPL )( AREAP area, void * p1, LONG p2);
|
||||
typedef USHORT ( * DBENTRYP_VPLP )( AREAP area, void * p1, LONGP p2);
|
||||
typedef USHORT ( * DBENTRYP_LSP )( AREAP area, LONG p1, USHORTP p2);
|
||||
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);
|
||||
@@ -1016,8 +1015,8 @@ typedef RDDFUNCS * PRDDFUNCS;
|
||||
* PROTOTYPES
|
||||
* ----------
|
||||
*/
|
||||
extern ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, PBYTE szDrvName );
|
||||
extern ERRCODE hb_rddDisinherit( BYTEP drvName );
|
||||
extern ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName );
|
||||
extern ERRCODE hb_rddDisinherit( BYTE * drvName );
|
||||
extern USHORT hb_rddExtendType( USHORT fieldType );
|
||||
extern USHORT hb_rddFieldType( USHORT extendType );
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <malloc.h> /* required for allocating and freeing memory */
|
||||
#include <ctype.h>
|
||||
#include "hbsetup.h" /* main configuration file */
|
||||
#include "extend.h"
|
||||
#include "pcode.h" /* pcode values */
|
||||
#include "hbdefs.h" /* our defined types */
|
||||
#include "compiler.h"
|
||||
@@ -2172,8 +2173,7 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag
|
||||
if( ! _bQuiet )
|
||||
printf( "\nGenerating C language output...\n" );
|
||||
|
||||
fprintf( yyc, "#include \"pcode.h\"\n" );
|
||||
fprintf( yyc, "#include \"init.h\"\n\n" );
|
||||
fprintf( yyc, "#include \"hb_vmpub.h\"\n\n\n" );
|
||||
|
||||
if( ! _bStartProc )
|
||||
pFunc = pFunc->pNext; /* No implicit starting procedure */
|
||||
|
||||
@@ -138,9 +138,9 @@ static void hb_CloseAll( void )
|
||||
pCurrArea = pWorkAreas;
|
||||
pWorkAreas = pWorkAreas->pNext;
|
||||
if( !( ( AREAP ) pCurrArea->pArea )->lprfsHost )
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
else
|
||||
SELF_CLOSE( ( AREAP ) pCurrArea->pArea );
|
||||
SELF_CLOSE( ( AREAP ) pCurrArea->pArea );
|
||||
|
||||
SELF_RELEASE( ( AREAP ) pCurrArea->pArea );
|
||||
hb_xfree( pCurrArea->pArea );
|
||||
@@ -159,7 +159,7 @@ static LPRDDNODE hb_FindRddNode( char * szDriver )
|
||||
while( pRddNode )
|
||||
{
|
||||
if( strcmp( pRddNode->szName, szDriver ) == 0 ) /* Matched RDD */
|
||||
return pRddNode;
|
||||
return pRddNode;
|
||||
pRddNode = pRddNode->pNext;
|
||||
}
|
||||
return 0;
|
||||
@@ -208,7 +208,7 @@ static int hb_rddRegister( char * szDriver, USHORT uiType )
|
||||
{
|
||||
pRddNode = pRddList;
|
||||
while( pRddNode->pNext )
|
||||
pRddNode = pRddNode->pNext; /* Locate the last RDD node */
|
||||
pRddNode = pRddNode->pNext; /* Locate the last RDD node */
|
||||
pRddNode->pNext = pRddNewNode; /* Add the new RDD node */
|
||||
}
|
||||
return 0; /* Ok */
|
||||
@@ -228,9 +228,9 @@ static void hb_SelectFirstAvailable( void )
|
||||
while( pAreaNode )
|
||||
{
|
||||
if( ( ( AREAP ) pAreaNode->pArea )->uiArea > uiCurrArea )
|
||||
break;
|
||||
break;
|
||||
else if( ( ( AREAP ) pAreaNode->pArea )->uiArea == uiCurrArea )
|
||||
uiCurrArea++;
|
||||
uiCurrArea++;
|
||||
pAreaNode = pAreaNode->pNext;
|
||||
}
|
||||
pCurrArea = 0; /* Selected WorkArea must be created */
|
||||
@@ -298,21 +298,21 @@ static ERRCODE StructSize( AREAP pArea, USHORT * uiSize )
|
||||
}
|
||||
|
||||
static RDDFUNCS defTable = { Bof,
|
||||
Eof,
|
||||
Found,
|
||||
UnSupported_V,
|
||||
UnSupported_L,
|
||||
UnSupported_V,
|
||||
Skip,
|
||||
Close,
|
||||
Open, /* Not defCreate */
|
||||
Open,
|
||||
Release,
|
||||
StructSize,
|
||||
UnSupported_V
|
||||
};
|
||||
Eof,
|
||||
Found,
|
||||
UnSupported_V,
|
||||
UnSupported_L,
|
||||
UnSupported_V,
|
||||
Skip,
|
||||
Close,
|
||||
Open, /* Not defCreate */
|
||||
Open,
|
||||
Release,
|
||||
StructSize,
|
||||
UnSupported_V
|
||||
};
|
||||
|
||||
ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, PBYTE szDrvName )
|
||||
ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName )
|
||||
{
|
||||
char * szSuperName;
|
||||
LPRDDNODE pRddNode;
|
||||
@@ -333,9 +333,9 @@ ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTa
|
||||
pRddNode = hb_FindRddNode( szSuperName );
|
||||
hb_xfree( szSuperName );
|
||||
if( !pRddNode )
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
memcpy( pTable, &pRddNode->pTable, sizeof( RDDFUNCS ) );
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTa
|
||||
for( uiCount = 0; uiCount < RDDFUNCSCOUNT; uiCount++ )
|
||||
{
|
||||
if( * pSubFunction )
|
||||
* pFunction = * pSubFunction;
|
||||
* pFunction = * pSubFunction;
|
||||
pFunction += 1;
|
||||
pSubFunction += 1;
|
||||
}
|
||||
@@ -383,9 +383,9 @@ HARBOUR HB_DBCLOSEAREA( void )
|
||||
else
|
||||
{
|
||||
if( pCurrArea->pPrev )
|
||||
pCurrArea->pPrev->pNext = pCurrArea->pNext;
|
||||
pCurrArea->pPrev->pNext = pCurrArea->pNext;
|
||||
if( pCurrArea->pNext )
|
||||
pCurrArea->pNext->pPrev = pCurrArea->pPrev;
|
||||
pCurrArea->pNext->pPrev = pCurrArea->pPrev;
|
||||
}
|
||||
|
||||
hb_xfree( pCurrArea->pArea );
|
||||
@@ -423,45 +423,45 @@ HARBOUR HB_DBCREATE( void )
|
||||
pFieldDesc = pStruct->item.asArray.value->pItems + uiSize;
|
||||
if( pFieldDesc->item.asArray.value->ulLen != 4 )
|
||||
{
|
||||
hb_xfree( pFields );
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
return;
|
||||
hb_xfree( pFields );
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
return;
|
||||
}
|
||||
|
||||
/* TODO: change to a symbol */
|
||||
pField->sym = ( FARP ) hb_arrayGetString( pFieldDesc, 1 );
|
||||
pField->sym = ( void * ) hb_arrayGetString( pFieldDesc, 1 );
|
||||
|
||||
if( strlen( ( char * ) pField->sym ) == 0 )
|
||||
{
|
||||
hb_xfree( pFields );
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
return;
|
||||
hb_xfree( pFields );
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
return;
|
||||
}
|
||||
|
||||
pField->uiLen = 0;
|
||||
pField->uiType = toupper( hb_arrayGetString( pFieldDesc, 2 )[ 0 ] );
|
||||
if( pField->uiType == 'N' )
|
||||
{
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 );
|
||||
pField->uiDec = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 4 );
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 );
|
||||
pField->uiDec = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pField->uiType == 'L' || pField->uiType == 'D' ||
|
||||
pField->uiType == 'M' )
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 );
|
||||
else if( pField->uiType == 'C' )
|
||||
{
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 ) +
|
||||
( ( USHORT ) hb_arrayGetDouble( pFieldDesc, 4 ) << 8 );
|
||||
}
|
||||
pField->uiDec = 0;
|
||||
if( pField->uiType == 'L' || pField->uiType == 'D' ||
|
||||
pField->uiType == 'M' )
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 );
|
||||
else if( pField->uiType == 'C' )
|
||||
{
|
||||
pField->uiLen = ( USHORT ) hb_arrayGetDouble( pFieldDesc, 3 ) +
|
||||
( ( USHORT ) hb_arrayGetDouble( pFieldDesc, 4 ) << 8 );
|
||||
}
|
||||
pField->uiDec = 0;
|
||||
}
|
||||
if( pField->uiLen == 0 )
|
||||
{
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
hb_xfree( pFields );
|
||||
return;
|
||||
MyError( "DBCMD/1014 Argument error", "DBCREATE" );
|
||||
hb_xfree( pFields );
|
||||
return;
|
||||
}
|
||||
|
||||
pField->uiArea = 0;
|
||||
@@ -470,9 +470,9 @@ HARBOUR HB_DBCREATE( void )
|
||||
pPrevField = pField; /* Link the field */
|
||||
pField++;
|
||||
if( uiSize < ( pStruct->item.asArray.value->ulLen - 1 ) )
|
||||
pPrevField->lpfNext = pField;
|
||||
pPrevField->lpfNext = pField;
|
||||
else
|
||||
pPrevField->lpfNext = 0;
|
||||
pPrevField->lpfNext = 0;
|
||||
}
|
||||
uiFieldCount = uiSize;
|
||||
|
||||
@@ -506,7 +506,7 @@ HARBOUR HB_DBCREATE( void )
|
||||
pTempArea->lpFields = pFields;
|
||||
pTempArea->lpFileInfo = 0;
|
||||
|
||||
pInfo.abName = ( PBYTE ) szFileName;
|
||||
pInfo.abName = ( BYTE * ) szFileName;
|
||||
if( SELF_CREATE( ( AREAP ) pTempArea, &pInfo ) == FAILURE )
|
||||
MyError( "DBCMD/1015 Create error", "DBCREATE" );
|
||||
|
||||
@@ -569,8 +569,8 @@ HARBOUR HB_DBSELECTAREA( void )
|
||||
szAlias = hb_parc( 1 );
|
||||
if( ( uiNewArea = hb_FindAlias( szAlias ) ) == 0 )
|
||||
{
|
||||
MyError( "DBCMD/1002 Alias not found", szAlias );
|
||||
return;
|
||||
MyError( "DBCMD/1002 Alias not found", szAlias );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if( !ISNUM( 1 ) )
|
||||
@@ -591,8 +591,8 @@ HARBOUR HB_DBSELECTAREA( void )
|
||||
{
|
||||
if( ( ( AREAP ) pAreaNode->pArea )->uiArea == uiCurrArea )
|
||||
{
|
||||
pCurrArea = pAreaNode; /* Select a valid WorkArea */
|
||||
return;
|
||||
pCurrArea = pAreaNode; /* Select a valid WorkArea */
|
||||
return;
|
||||
}
|
||||
pAreaNode = pAreaNode->pNext;
|
||||
}
|
||||
@@ -622,10 +622,10 @@ HARBOUR HB_DBSKIP( void )
|
||||
pItem = hb_param( 1, IT_NUMERIC );
|
||||
if( pItem )
|
||||
{
|
||||
if( pItem->type == IT_INTEGER )
|
||||
lToSkip = pItem->item.asInteger.value;
|
||||
else if( pItem->type == IT_LONG )
|
||||
lToSkip = pItem->item.asLong.value;
|
||||
if( pItem->type == IT_INTEGER )
|
||||
lToSkip = pItem->item.asInteger.value;
|
||||
else if( pItem->type == IT_LONG )
|
||||
lToSkip = pItem->item.asLong.value;
|
||||
}
|
||||
SELF_SKIP( ( AREAP ) pCurrArea->pArea, lToSkip );
|
||||
}
|
||||
@@ -650,13 +650,13 @@ HARBOUR HB_DBUSEAREA( void )
|
||||
SELF_RELEASE( ( AREAP ) pCurrArea->pArea );
|
||||
|
||||
if( pWorkAreas == pCurrArea ) /* Empty list */
|
||||
pWorkAreas = 0;
|
||||
pWorkAreas = 0;
|
||||
else
|
||||
{
|
||||
if( pCurrArea->pPrev )
|
||||
pCurrArea->pPrev->pNext = pCurrArea->pNext;
|
||||
if( pCurrArea->pNext )
|
||||
pCurrArea->pNext->pPrev = pCurrArea->pPrev;
|
||||
if( pCurrArea->pPrev )
|
||||
pCurrArea->pPrev->pNext = pCurrArea->pNext;
|
||||
if( pCurrArea->pNext )
|
||||
pCurrArea->pNext->pPrev = pCurrArea->pPrev;
|
||||
}
|
||||
|
||||
hb_xfree( pCurrArea->pArea );
|
||||
@@ -702,7 +702,7 @@ HARBOUR HB_DBUSEAREA( void )
|
||||
/* Need more space? */
|
||||
SELF_STRUCTSIZE( ( AREAP ) pCurrArea->pArea, &uiSize );
|
||||
if( uiSize > sizeof( AREA ) ) /* Size of Area changed */
|
||||
pCurrArea->pArea = ( AREAP ) hb_xrealloc( pCurrArea->pArea, uiSize );
|
||||
pCurrArea->pArea = ( AREAP ) hb_xrealloc( pCurrArea->pArea, uiSize );
|
||||
|
||||
pRddNode->uiAreaSize = uiSize; /* Update the size of WorkArea */
|
||||
}
|
||||
@@ -726,8 +726,8 @@ HARBOUR HB_DBUSEAREA( void )
|
||||
}
|
||||
|
||||
pInfo.uiArea = uiCurrArea;
|
||||
pInfo.abName = ( PBYTE ) szFileName;
|
||||
pInfo.atomAlias = ( PBYTE ) szAlias;
|
||||
pInfo.abName = ( BYTE * ) szFileName;
|
||||
pInfo.atomAlias = ( BYTE * ) szAlias;
|
||||
pInfo.fShared = ISLOG( 5 ) ? hb_parl( 5 ) : !hb_set.HB_SET_EXCLUSIVE;
|
||||
pInfo.fReadonly = ISLOG( 6 ) ? hb_parl( 6 ) : FALSE;
|
||||
|
||||
@@ -746,12 +746,12 @@ HARBOUR HB_DBUSEAREA( void )
|
||||
{
|
||||
if( ( ( AREAP ) pAreaNode->pArea )->uiArea > uiCurrArea )
|
||||
{
|
||||
/* Insert the new WorkArea node */
|
||||
pCurrArea->pPrev = pAreaNode->pPrev;
|
||||
pCurrArea->pNext = pAreaNode;
|
||||
pAreaNode->pPrev = pCurrArea;
|
||||
if( pCurrArea->pPrev )
|
||||
pCurrArea->pPrev->pNext = pCurrArea;
|
||||
/* Insert the new WorkArea node */
|
||||
pCurrArea->pPrev = pAreaNode->pPrev;
|
||||
pCurrArea->pNext = pAreaNode;
|
||||
pAreaNode->pPrev = pCurrArea;
|
||||
if( pCurrArea->pPrev )
|
||||
pCurrArea->pPrev->pNext = pCurrArea;
|
||||
}
|
||||
pAreaNode = pAreaNode->pNext;
|
||||
}
|
||||
@@ -766,9 +766,9 @@ HARBOUR HB_EOF( void )
|
||||
if( pCurrArea )
|
||||
{
|
||||
if( !( ( AREAP ) pCurrArea->pArea )->lprfsHost )
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
else
|
||||
SELF_EOF( ( AREAP ) pCurrArea->pArea, &bEof );
|
||||
SELF_EOF( ( AREAP ) pCurrArea->pArea, &bEof );
|
||||
}
|
||||
hb_retl( bEof );
|
||||
}
|
||||
@@ -780,9 +780,9 @@ HARBOUR HB_FOUND( void )
|
||||
if( pCurrArea )
|
||||
{
|
||||
if( !( ( AREAP ) pCurrArea->pArea )->lprfsHost )
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
MyError( "No table error ", "9xxxx" );
|
||||
else
|
||||
SELF_FOUND( ( AREAP ) pCurrArea->pArea, &bFound );
|
||||
SELF_FOUND( ( AREAP ) pCurrArea->pArea, &bFound );
|
||||
}
|
||||
hb_retl( bFound );
|
||||
}
|
||||
@@ -801,7 +801,7 @@ HARBOUR HB_RDDLIST( void )
|
||||
while( pRddNode )
|
||||
{
|
||||
if( ( uiType == 0 ) || ( pRddNode->uiType == uiType ) )
|
||||
hb_arrayAdd( &stack.Return, hb_itemPutC( pName, pRddNode->szName ) );
|
||||
hb_arrayAdd( &stack.Return, hb_itemPutC( pName, pRddNode->szName ) );
|
||||
pRddNode = pRddNode->pNext;
|
||||
}
|
||||
hb_itemRelease( pName );
|
||||
@@ -825,7 +825,7 @@ HARBOUR HB_RDDREGISTER( void )
|
||||
* > 1: error
|
||||
*/
|
||||
if( hb_rddRegister( szDriver, hb_parni( 2 ) ) <= 1 )
|
||||
return;
|
||||
return;
|
||||
}
|
||||
MyError( "Internal error", "RDDREGISTER" );
|
||||
}
|
||||
|
||||
@@ -159,23 +159,23 @@ static ERRCODE WriteDBHeader( AREAP pArea )
|
||||
{
|
||||
switch( pField->uiType )
|
||||
{
|
||||
case 'C':
|
||||
case 'N':
|
||||
pHeader.uiRecordLen += pField->uiLen;
|
||||
break;
|
||||
case 'C':
|
||||
case 'N':
|
||||
pHeader.uiRecordLen += pField->uiLen;
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
pHeader.uiRecordLen += 10;
|
||||
pHeader.bVersion = 0x83;
|
||||
break;
|
||||
case 'M':
|
||||
pHeader.uiRecordLen += 10;
|
||||
pHeader.bVersion = 0x83;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
pHeader.uiRecordLen += 8;
|
||||
break;
|
||||
case 'D':
|
||||
pHeader.uiRecordLen += 8;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
pHeader.uiRecordLen += 1;
|
||||
break;
|
||||
case 'L':
|
||||
pHeader.uiRecordLen += 1;
|
||||
break;
|
||||
}
|
||||
pField++;
|
||||
}
|
||||
@@ -188,8 +188,8 @@ static ERRCODE WriteDBHeader( AREAP pArea )
|
||||
pHeader.uiHeaderLen = ( USHORT ) ( 32 * ( pArea->uiFieldCount + 1 ) + 1 );
|
||||
pHeader.bHasTag = 0;
|
||||
pHeader.ulRecords = 0;
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTEP ) &pHeader,
|
||||
sizeof( DBFHEADER ) ) != sizeof( DBFHEADER ) )
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTE * ) &pHeader,
|
||||
sizeof( DBFHEADER ) ) != sizeof( DBFHEADER ) )
|
||||
return FAILURE;
|
||||
|
||||
pField = pArea->lpFields;
|
||||
@@ -201,37 +201,37 @@ static ERRCODE WriteDBHeader( AREAP pArea )
|
||||
pDBField.bType = pField->uiType;
|
||||
switch( pDBField.bType )
|
||||
{
|
||||
case 'C':
|
||||
pDBField.bLen = pField->uiLen & 0xFF;
|
||||
pDBField.bDec = pField->uiLen >> 8;
|
||||
break;
|
||||
case 'C':
|
||||
pDBField.bLen = pField->uiLen & 0xFF;
|
||||
pDBField.bDec = pField->uiLen >> 8;
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
pDBField.bLen = 10;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
case 'M':
|
||||
pDBField.bLen = 10;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
pDBField.bLen = 8;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
case 'D':
|
||||
pDBField.bLen = 8;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
pDBField.bLen = 1;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
case 'L':
|
||||
pDBField.bLen = 1;
|
||||
pDBField.bDec = 0;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
pDBField.bLen = pField->uiLen;
|
||||
pDBField.bDec = pField->uiDec;
|
||||
break;
|
||||
case 'N':
|
||||
pDBField.bLen = pField->uiLen;
|
||||
pDBField.bDec = pField->uiDec;
|
||||
break;
|
||||
}
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTEP ) &pDBField,
|
||||
sizeof( DBFFIELD ) ) != sizeof( DBFFIELD ) )
|
||||
return FAILURE;
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTE * ) &pDBField,
|
||||
sizeof( DBFFIELD ) ) != sizeof( DBFFIELD ) )
|
||||
return FAILURE;
|
||||
pField++;
|
||||
}
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTEP ) "\15\32", 2 ) != 2 )
|
||||
if( hb_fsWrite( pArea->lpFileInfo->hFile, ( BYTE * ) "\15\32", 2 ) != 2 )
|
||||
return FAILURE;
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -239,19 +239,19 @@ static ERRCODE WriteDBHeader( AREAP pArea )
|
||||
static RDDFUNCS dbfSuper = { 0 };
|
||||
|
||||
static RDDFUNCS dbfTable = { Bof,
|
||||
Eof,
|
||||
Found,
|
||||
GoBottom,
|
||||
GoTo,
|
||||
GoTop,
|
||||
Skip,
|
||||
Close,
|
||||
Create,
|
||||
Open,
|
||||
0, /* Super Release */
|
||||
0, /* Super StructSize */
|
||||
WriteDBHeader
|
||||
};
|
||||
Eof,
|
||||
Found,
|
||||
GoBottom,
|
||||
GoTo,
|
||||
GoTop,
|
||||
Skip,
|
||||
Close,
|
||||
Create,
|
||||
Open,
|
||||
0, /* Super Release */
|
||||
0, /* Super StructSize */
|
||||
WriteDBHeader
|
||||
};
|
||||
|
||||
HARBOUR HB__DBF( void )
|
||||
{
|
||||
|
||||
@@ -95,19 +95,19 @@ static ERRCODE Open( AREAP pArea, LPDBOPENINFO pOpenInfo )
|
||||
static RDDFUNCS ntxSuper = { 0 };
|
||||
|
||||
static RDDFUNCS ntxTable = { Bof,
|
||||
Eof,
|
||||
Found,
|
||||
GoBottom,
|
||||
GoTo,
|
||||
GoTop,
|
||||
Skip,
|
||||
Close,
|
||||
0, /* Super Create */
|
||||
Open,
|
||||
0, /* Super Release */
|
||||
0, /* Super StructSize */
|
||||
0 /* Super WriteDBHeader */
|
||||
};
|
||||
Eof,
|
||||
Found,
|
||||
GoBottom,
|
||||
GoTo,
|
||||
GoTop,
|
||||
Skip,
|
||||
Close,
|
||||
0, /* Super Create */
|
||||
Open,
|
||||
0, /* Super Release */
|
||||
0, /* Super StructSize */
|
||||
0 /* Super WriteDBHeader */
|
||||
};
|
||||
|
||||
HARBOUR HB__DBFNTX( void )
|
||||
{
|
||||
@@ -122,7 +122,7 @@ HARBOUR HB_DBFNTX_GETFUNCTABLE( void )
|
||||
* uiCount = RDDFUNCSCOUNT;
|
||||
pTable = ( RDDFUNCS * ) hb_parnl( 2 );
|
||||
if( pTable )
|
||||
hb_retni( hb_rddInherit( pTable, &ntxTable, &ntxSuper, ( PBYTE ) "DBF" ) );
|
||||
hb_retni( hb_rddInherit( pTable, &ntxTable, &ntxSuper, ( BYTE * ) "DBF" ) );
|
||||
else
|
||||
hb_retni( FAILURE );
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ PRG_SOURCES=\
|
||||
devoutp.prg \
|
||||
error.prg \
|
||||
errorsys.prg \
|
||||
menu.prg \
|
||||
menuto.prg \
|
||||
objfunc.prg \
|
||||
setkey.prg \
|
||||
tclass.prg \
|
||||
|
||||
@@ -203,6 +203,16 @@ function achoice( nTop, nLft, nBtm, nRyt, acItems, xSelect, xUserFunc, nPos, nHi
|
||||
endif
|
||||
|
||||
do case
|
||||
|
||||
case ( bAction := setkey( nKey ) ) <> NIL
|
||||
|
||||
eval( bAction, procname( 1 ), procline( 1 ), "" )
|
||||
if empty( nextkey() )
|
||||
keyboard chr( 255 )
|
||||
inkey()
|
||||
nKey := 0
|
||||
endif
|
||||
|
||||
case ( ( nKey == K_ESC ) .or. ( nMode == AC_NOITEM ) ) .and. ( !lUserFunc )
|
||||
nMode := AC_ABORT
|
||||
nPos := 0
|
||||
|
||||
@@ -55,6 +55,12 @@ FUNCTION Alert(xMessage, aOptions, cColorNorm, nDelay)
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
|
||||
DO WHILE (nPos := At(';', xMessage)) != 0
|
||||
AAdd(aSay, Left(xMessage, nPos - 1))
|
||||
xMessage := SubStr(xMessage, nPos + 1)
|
||||
ENDDO
|
||||
AAdd(aSay, xMessage)
|
||||
|
||||
#else
|
||||
|
||||
DO CASE
|
||||
|
||||
@@ -78,7 +78,7 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal)
|
||||
|
||||
*ulWrittenTotal = 0L;
|
||||
|
||||
while ((fhndSource = hb_fsOpen((BYTEP)szSource, FO_READ)) == FS_ERROR)
|
||||
while ((fhndSource = hb_fsOpen(( BYTE * ) szSource, FO_READ)) == FS_ERROR)
|
||||
{
|
||||
if (hb_errorRT_BASE_Ext1(EG_OPEN, 2012, NULL, szSource, hb_fsError(), EF_CANDEFAULT | EF_CANRETRY ) == E_DEFAULT)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal)
|
||||
|
||||
if (fhndSource != FS_ERROR)
|
||||
{
|
||||
while ((fhndDest = hb_fsCreate((BYTEP)szDest, FC_NORMAL)) == FS_ERROR)
|
||||
while ((fhndDest = hb_fsCreate(( BYTE * ) szDest, FC_NORMAL)) == FS_ERROR)
|
||||
{
|
||||
if (hb_errorRT_BASE_Ext1(EG_CREATE, 2012, NULL, szDest, hb_fsError(), EF_CANDEFAULT | EF_CANRETRY ) == E_DEFAULT)
|
||||
{
|
||||
@@ -104,11 +104,11 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal)
|
||||
struct stat struFileInfo;
|
||||
int iSuccess = fstat( fhndSource, &struFileInfo );
|
||||
#endif
|
||||
PBYTE buffer;
|
||||
BYTE * buffer;
|
||||
USHORT usRead;
|
||||
USHORT usWritten;
|
||||
|
||||
buffer = (PBYTE)hb_xgrab( BUFFER_SIZE );
|
||||
buffer = (BYTE * ) hb_xgrab( BUFFER_SIZE );
|
||||
|
||||
/* QUESTION: Does Clipper throw an error on read or write operation ? */
|
||||
/* QUESTION: What is the E_DEFAULT behaviour on that error ? */
|
||||
|
||||
@@ -71,7 +71,7 @@ HARBOUR HB_OS(void)
|
||||
#ifdef __IBMCPP__
|
||||
|
||||
unsigned long aulQSV [QSV_MAX] = {0};
|
||||
APIRET rc= DosQuerySysInfo (1L, QSV_MAX, (PVOID) aulQSV, sizeof (ULONG) * QSV_MAX);
|
||||
APIRET rc= DosQuerySysInfo (1L, QSV_MAX, (void *) aulQSV, sizeof (ULONG) * QSV_MAX);
|
||||
if (!rc)
|
||||
{
|
||||
hb_osmajor = aulQSV [QSV_VERSION_MAJOR] / 10;
|
||||
|
||||
@@ -242,7 +242,7 @@ static void convert_create_flags( int flags, int *result_flags, unsigned *result
|
||||
* FILESYS.API FUNCTIONS --
|
||||
*/
|
||||
|
||||
FHANDLE hb_fsOpen ( BYTEP name, USHORT flags )
|
||||
FHANDLE hb_fsOpen ( BYTE * name, USHORT flags )
|
||||
{
|
||||
FHANDLE handle;
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -262,7 +262,7 @@ FHANDLE hb_fsOpen ( BYTEP name, USHORT flags )
|
||||
return handle;
|
||||
}
|
||||
|
||||
FHANDLE hb_fsCreate ( BYTEP name, USHORT flags )
|
||||
FHANDLE hb_fsCreate ( BYTE * name, USHORT flags )
|
||||
{
|
||||
FHANDLE handle;
|
||||
int oflag;
|
||||
@@ -312,7 +312,7 @@ void hb_fsClose ( FHANDLE handle )
|
||||
#endif
|
||||
}
|
||||
|
||||
USHORT hb_fsRead ( FHANDLE handle, BYTEP buff, USHORT count )
|
||||
USHORT hb_fsRead ( FHANDLE handle, BYTE * buff, USHORT count )
|
||||
{
|
||||
USHORT bytes;
|
||||
#if defined( HAVE_POSIX_IO )
|
||||
@@ -334,7 +334,7 @@ USHORT hb_fsRead ( FHANDLE handle, BYTEP buff, USHORT count )
|
||||
return bytes;
|
||||
}
|
||||
|
||||
USHORT hb_fsWrite ( FHANDLE handle, BYTEP buff, USHORT count )
|
||||
USHORT hb_fsWrite ( FHANDLE handle, BYTE * buff, USHORT count )
|
||||
{
|
||||
USHORT bytes;
|
||||
#if defined( HAVE_POSIX_IO )
|
||||
@@ -379,7 +379,7 @@ USHORT hb_fsError ( void )
|
||||
return last_error;
|
||||
}
|
||||
|
||||
void hb_fsDelete ( BYTEP name )
|
||||
void hb_fsDelete ( BYTE * name )
|
||||
{
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
errno = 0;
|
||||
@@ -396,7 +396,7 @@ void hb_fsDelete ( BYTEP name )
|
||||
#endif
|
||||
}
|
||||
|
||||
void hb_fsRename ( BYTEP older, BYTEP newer )
|
||||
void hb_fsRename ( BYTE * older, BYTE * newer )
|
||||
{
|
||||
#if defined(HAVE_POSIX_IO) || defined( _MSC_VER )
|
||||
errno = 0;
|
||||
@@ -449,7 +449,7 @@ void hb_fsCommit ( FHANDLE handle )
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL hb_fsMkDir ( BYTEP name )
|
||||
BOOL hb_fsMkDir ( BYTE * name )
|
||||
{
|
||||
int result;
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -467,7 +467,7 @@ BOOL hb_fsMkDir ( BYTEP name )
|
||||
return (result ? FALSE : TRUE );
|
||||
}
|
||||
|
||||
BOOL hb_fsChDir ( BYTEP name )
|
||||
BOOL hb_fsChDir ( BYTE * name )
|
||||
{
|
||||
int result;
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -481,7 +481,7 @@ BOOL hb_fsChDir ( BYTEP name )
|
||||
return (result ? FALSE : TRUE );
|
||||
}
|
||||
|
||||
BOOL hb_fsRmDir ( BYTEP name )
|
||||
BOOL hb_fsRmDir ( BYTE * name )
|
||||
{
|
||||
int result;
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -497,7 +497,7 @@ BOOL hb_fsRmDir ( BYTEP name )
|
||||
|
||||
/* TODO: Make it thread safe */
|
||||
|
||||
BYTEP hb_fsCurDir ( USHORT uiDrive )
|
||||
BYTE * hb_fsCurDir ( USHORT uiDrive )
|
||||
{
|
||||
static char cwd_buff[PATH_MAX+1];
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -509,14 +509,14 @@ BYTEP hb_fsCurDir ( USHORT uiDrive )
|
||||
last_error = FS_ERROR;
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
BYTEP dmm = (BYTEP)cwd_buff;
|
||||
BYTE * dmm = ( BYTE * )cwd_buff;
|
||||
#endif
|
||||
return (BYTEP)cwd_buff;
|
||||
return ( BYTE * )cwd_buff;
|
||||
}
|
||||
|
||||
/* TODO: Implement nDrive */
|
||||
|
||||
USHORT hb_fsChDrv ( BYTEP nDrive )
|
||||
USHORT hb_fsChDrv ( BYTE * nDrive )
|
||||
{
|
||||
USHORT result;
|
||||
#if defined(HAVE_POSIX_IO)
|
||||
@@ -562,8 +562,8 @@ USHORT hb_fsIsDrv ( BYTE nDrive )
|
||||
}
|
||||
|
||||
/* TODO: Implement hb_fsExtOpen */
|
||||
FHANDLE hb_fsExtOpen( BYTEP fpFilename, BYTEP fpDefExt,
|
||||
USHORT uiFlags, BYTEP fpPaths, PHB_ITEM pError )
|
||||
FHANDLE hb_fsExtOpen( BYTE * fpFilename, BYTE * fpDefExt,
|
||||
USHORT uiFlags, BYTE * fpPaths, PHB_ITEM pError )
|
||||
{
|
||||
return FS_ERROR;
|
||||
}
|
||||
@@ -587,7 +587,7 @@ HARBOUR HB_FOPEN( void )
|
||||
else
|
||||
open_flags = 0;
|
||||
|
||||
file_handle = hb_fsOpen( (BYTEP)hb_parc(1), open_flags );
|
||||
file_handle = hb_fsOpen( ( BYTE * )hb_parc(1), open_flags );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -613,7 +613,7 @@ HARBOUR HB_FCREATE( void )
|
||||
else
|
||||
create_flags = 0;
|
||||
|
||||
file_handle = hb_fsCreate( (BYTEP)hb_parc(1), create_flags );
|
||||
file_handle = hb_fsCreate( ( BYTE * )hb_parc(1), create_flags );
|
||||
}
|
||||
|
||||
hb_retni(file_handle);
|
||||
@@ -630,7 +630,7 @@ HARBOUR HB_FREAD( void )
|
||||
|
||||
if( arg1_it && arg2_it && arg3_it )
|
||||
{
|
||||
bytes = hb_fsRead(hb_parni(1), (BYTEP)hb_parc(2), hb_parnl(3) );
|
||||
bytes = hb_fsRead(hb_parni(1), ( BYTE * )hb_parc(2), hb_parnl(3) );
|
||||
}
|
||||
|
||||
hb_retnl(bytes);
|
||||
@@ -648,7 +648,7 @@ HARBOUR HB_FWRITE( void )
|
||||
if( arg1_it && arg2_it )
|
||||
{
|
||||
bytes = (arg3_it ? hb_parnl(3) : hb_parclen( 2 ) );
|
||||
bytes = hb_fsWrite( hb_parni(1), (BYTEP)hb_parc(2), bytes);
|
||||
bytes = hb_fsWrite( hb_parni(1), ( BYTE * )hb_parc(2), bytes);
|
||||
}
|
||||
|
||||
hb_retnl(bytes);
|
||||
@@ -680,7 +680,7 @@ HARBOUR HB_FERASE( void )
|
||||
|
||||
if( arg1_it )
|
||||
{
|
||||
hb_fsDelete( (BYTEP)hb_parc(1) );
|
||||
hb_fsDelete( ( BYTE * )hb_parc(1) );
|
||||
}
|
||||
|
||||
hb_retni(last_error=0);
|
||||
@@ -694,7 +694,7 @@ HARBOUR HB_FRENAME( void )
|
||||
|
||||
if( arg1_it && arg2_it )
|
||||
{
|
||||
hb_fsRename( (BYTEP)hb_parc(1), (BYTEP)hb_parc(2) );
|
||||
hb_fsRename( ( BYTE * )hb_parc(1), ( BYTE * )hb_parc(2) );
|
||||
}
|
||||
|
||||
hb_retni(last_error);
|
||||
|
||||
@@ -105,7 +105,7 @@ int hb_gt_GetCursorStyle(void)
|
||||
|
||||
void hb_gt_Puts(char cRow, char cCol, char attr, char *str, int len)
|
||||
{
|
||||
VioWrtCharStrAtt(str, (USHORT) len, (USHORT) cRow, (USHORT) cCol, (PBYTE) &attr, 0);
|
||||
VioWrtCharStrAtt(str, (USHORT) len, (USHORT) cRow, (USHORT) cCol, (BYTE *) &attr, 0);
|
||||
}
|
||||
|
||||
void hb_gt_GetText(char cTop, char cLeft, char cBottom, char cRight, char *dest)
|
||||
@@ -115,7 +115,7 @@ void hb_gt_GetText(char cTop, char cLeft, char cBottom, char cRight, char *dest)
|
||||
width = (USHORT) ((cRight - cLeft + 1) * 2);
|
||||
for (y = cTop; y <= cBottom; y++)
|
||||
{
|
||||
VioReadCellStr((PBYTE) dest, &width, (USHORT) cLeft, (USHORT) y, 0);
|
||||
VioReadCellStr((BYTE *) dest, &width, (USHORT) cLeft, (USHORT) y, 0);
|
||||
dest += width;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ void hb_gt_PutText(char cTop, char cLeft, char cBottom, char cRight, char *srce)
|
||||
width = (USHORT) ((cRight - cLeft + 1) * 2);
|
||||
for (y = cTop; y <= cBottom; y++)
|
||||
{
|
||||
VioWrtCellStr((PBYTE) srce, width, (USHORT) cLeft, (USHORT) y, 0);
|
||||
VioWrtCellStr((BYTE *) srce, width, (USHORT) cLeft, (USHORT) y, 0);
|
||||
srce += width;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
|
||||
Copyright(C) 1999 by Andi Jahja
|
||||
|
||||
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 of the License, 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 program; if not, write to:
|
||||
|
||||
The Free Software Foundation, Inc.,
|
||||
675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
You can contact me at: andij@aonlippo.co.id
|
||||
*/
|
||||
|
||||
#command @ <row>, <col> PROMPT <prompt> [MESSAGE <msg>] ;
|
||||
=> __AtPrompt( <row>, <col>, <prompt> , <msg> )
|
||||
|
||||
#command MENU TO <v> ;
|
||||
=> <v> := __MenuTo( {|_1| if(PCount() == 0, <v>, <v> := _1)}, #<v> )
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
static aMenu := {}
|
||||
********************************************************************************
|
||||
function __atprompt(nrow, ncol, citem, cmessage)
|
||||
********************************************************************************
|
||||
local nmarkpos, citemkey
|
||||
|
||||
nmarkpos := at("~", citem)
|
||||
citemkey := if(nmarkpos > 0, lower(substr(citem, nmarkpos + 1, 1)), "")
|
||||
aadd(amenu, { nrow, ncol, citem, citemkey, cmessage, setcolor() })
|
||||
sayitem(nrow, ncol, citem, setcolor())
|
||||
|
||||
return nil
|
||||
|
||||
********************************************************************************
|
||||
function __menuto(bvarblock, cvarname)
|
||||
********************************************************************************
|
||||
local athismenu := amenu
|
||||
local nselect, ncurrent, nprevious := 0
|
||||
local chighlight
|
||||
local nkey
|
||||
local ncursor := setcursor(0)
|
||||
|
||||
amenu := {}
|
||||
|
||||
if len(athismenu) == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
nselect := eval(bvarblock)
|
||||
if valtype(nselect) <> "N"
|
||||
nselect := 1
|
||||
elseif (nselect := int(nselect)) < 1 .or. nselect > len(athismenu)
|
||||
nselect := 1
|
||||
endif
|
||||
|
||||
ncurrent := nselect
|
||||
|
||||
do while ncurrent > 0
|
||||
|
||||
if ncurrent <> nprevious
|
||||
chighlight := athismenu[ncurrent][6]
|
||||
chighlight := substr(chighlight, at(",", chighlight) + 1)
|
||||
chighlight := left(chighlight, at(",", chighlight))
|
||||
sayitem(athismenu[ncurrent][1], athismenu[ncurrent][2], ;
|
||||
athismenu[ncurrent][3], chighlight)
|
||||
saymessage(athismenu[ncurrent][5])
|
||||
nprevious := ncurrent
|
||||
endif
|
||||
|
||||
setpos(athismenu[ncurrent][1], athismenu[ncurrent][2])
|
||||
nkey := inkey(0)
|
||||
|
||||
do case
|
||||
case nkey == K_ENTER .or. nKey == K_PGUP .or. nKey == K_PGDN
|
||||
nselect := ncurrent
|
||||
ncurrent := 0
|
||||
case nkey == K_ESC
|
||||
nselect := 0
|
||||
ncurrent := 0
|
||||
case nkey == K_UP .or. nKey == K_LEFT
|
||||
if --ncurrent < 1
|
||||
ncurrent := if(set(_SET_WRAP), len(athismenu), 1)
|
||||
endif
|
||||
case nkey == K_DOWN .or. nKey == K_RIGHT
|
||||
if ++ncurrent > len(athismenu)
|
||||
ncurrent := if(set(_SET_WRAP), 1, len(athismenu))
|
||||
endif
|
||||
case nkey == K_HOME
|
||||
ncurrent := 1
|
||||
case nkey == K_END
|
||||
ncurrent := len(athismenu)
|
||||
case nkey >= 32 .and. nkey <= 127
|
||||
if (nselect := ascan(athismenu, { |aitem| aitem[4] == lower(chr(nkey)) })) > 0
|
||||
ncurrent := 0
|
||||
endif
|
||||
endcase
|
||||
|
||||
if ncurrent <> nprevious
|
||||
sayitem(athismenu[nprevious][1], athismenu[nprevious][2], ;
|
||||
athismenu[nprevious][3], athismenu[nprevious][6])
|
||||
if athismenu[nprevious][5] <> nil
|
||||
saymessage(space(len(athismenu[nprevious][5])))
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
setcursor(ncursor)
|
||||
return nselect
|
||||
|
||||
********************************************************************************
|
||||
static function sayitem(nrow, ncol, ctext, ccolor)
|
||||
********************************************************************************
|
||||
local csavecolor, cshorttext, nmarkpos, nmarkidx, ncommapos
|
||||
|
||||
ccolor := trim(ccolor)
|
||||
csavecolor := setcolor(ccolor)
|
||||
cshorttext := strtran(ctext, "~")
|
||||
@ nrow, ncol say cshorttext
|
||||
|
||||
if (nmarkpos := at("~", ctext)) > 0
|
||||
|
||||
for nmarkidx := 1 to 4
|
||||
ncommapos := at(",", ccolor)
|
||||
ccolor := if(ncommapos > 0, substr(ccolor, ncommapos + 1), "")
|
||||
next
|
||||
|
||||
if .not. ccolor == ""
|
||||
setcolor(ccolor)
|
||||
@ nrow, ncol + nmarkpos - 1 say substr(ctext, nmarkpos + 1, 1)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
setcolor(csavecolor)
|
||||
return nil
|
||||
|
||||
********************************************************************************
|
||||
static function saymessage(cmessage)
|
||||
********************************************************************************
|
||||
local nrow, ncol
|
||||
|
||||
if cmessage == nil .or. (nrow := set(_SET_MESSAGE)) == 0
|
||||
return nil
|
||||
endif
|
||||
|
||||
ncol := if(set(_SET_MCENTER), int((maxcol() - len(cmessage)) / 2), 0)
|
||||
|
||||
@ nrow, ncol say cmessage
|
||||
|
||||
return nil
|
||||
216
harbour/source/rtl/menuto.prg
Normal file
216
harbour/source/rtl/menuto.prg
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
Harbour Project source code
|
||||
www - http://www.Harbour-Project.org
|
||||
|
||||
A pure Clipper emulation of the PROMPT/MENU TO commands.
|
||||
|
||||
Author: Phil Barnett <philb@iag.net>
|
||||
Released to Public Domain
|
||||
*/
|
||||
|
||||
/* NOTE: Recursive use is acceptable */
|
||||
|
||||
#include "setcurs.ch"
|
||||
#include "inkey.ch"
|
||||
#include "color.ch"
|
||||
|
||||
static aLevel := {}
|
||||
static nPointer := 1
|
||||
|
||||
procedure __AtPrompt( nCol, nRow, cPrompt, cMsg )
|
||||
|
||||
local nMsgLen := 0
|
||||
|
||||
// gather message data
|
||||
if valtype( cMsg ) == 'C' .and. !empty( cMsg )
|
||||
if len( cMsg ) > maxcol() + 1
|
||||
cMsg := left( cMsg, maxcol() + 1 ) // message too long to display
|
||||
endif
|
||||
nMsgLen := max( nMsgLen, len( cMsg ) )
|
||||
endif
|
||||
|
||||
if nPointer < 1
|
||||
nPointer := 1
|
||||
endif
|
||||
|
||||
// add the current level empty array.
|
||||
do while len( aLevel ) < nPointer
|
||||
aadd( aLevel, {} )
|
||||
enddo
|
||||
|
||||
// add to the static array
|
||||
aadd( aLevel[ nPointer ], { nCol, nRow, cPrompt, cMsg, len( cPrompt ), nMsgLen } )
|
||||
|
||||
// put this prompt on the screen right now
|
||||
setpos( nCol, nRow )
|
||||
dispout( cPrompt )
|
||||
|
||||
return
|
||||
|
||||
function __MenuTo( bBlock, cVariable )
|
||||
|
||||
local nKey
|
||||
local y
|
||||
local q
|
||||
local n := eval( bBlock )
|
||||
local nArrLen := len( aLevel[ nPointer ] )
|
||||
local nMsgRow := set( _SET_MESSAGE )
|
||||
local lSetMCenter := set( _SET_MCENTER )
|
||||
local nMaxCol := maxcol() + 1
|
||||
local lDoMessage := nMsgRow > 0
|
||||
local lGotMessage := .f.
|
||||
local nMsgCol := int( ( nMaxCol - aLevel[ nPointer ] [ len( aLevel ) ] [ 6 ] ) / 2 )
|
||||
local nSaveCsr := setcursor( SC_NONE )
|
||||
|
||||
ColorSelect( CLR_STANDARD )
|
||||
|
||||
nPointer ++
|
||||
|
||||
if len( aLevel[ nPointer - 1 ] ) == 0
|
||||
|
||||
n := 0
|
||||
|
||||
else
|
||||
|
||||
if !( ValType( n ) == "N" ) .OR. n < 1
|
||||
n := 1
|
||||
elseif n > len( aLevel[ nPointer - 1 ] )
|
||||
n := len( aLevel[ nPointer - 1 ] )
|
||||
endif
|
||||
|
||||
for y := 1 to nArrLen
|
||||
if valtype( aLevel[ nPointer - 1, y, 4 ] ) $ 'CB'
|
||||
lGotMessage := .t.
|
||||
exit
|
||||
endif
|
||||
next
|
||||
|
||||
do while .t.
|
||||
|
||||
// were there any messages?
|
||||
if lGotMessage .and. lDoMessage
|
||||
|
||||
if valtype( aLevel[ nPointer - 1, n, 4 ] ) == 'B'
|
||||
// Code Block messages ( yes, they are documented! )
|
||||
|
||||
eval( aLevel[ nPointer - 1, n, 4 ] )
|
||||
|
||||
elseif valtype( aLevel[ nPointer - 1, n, 4 ] ) == 'C'
|
||||
// Character messages
|
||||
|
||||
// set the display location
|
||||
if lSetMCenter
|
||||
|
||||
// erase the current message row
|
||||
dispbox( nMsgRow, nMsgCol, ;
|
||||
nMsgRow, nMsgCol + aLevel[ nPointer - 1, n, 6 ] )
|
||||
|
||||
setpos( nMsgRow, ( nMaxcol - len( aLevel[ nPointer - 1, n, 4 ] ) ) / 2 )
|
||||
|
||||
else
|
||||
|
||||
// erase the current message row
|
||||
dispbox( nMsgRow, 0, ;
|
||||
nMsgRow, aLevel[ nPointer - 1, n, 6 ], ' ' )
|
||||
|
||||
setpos( nMsgRow, 0 )
|
||||
|
||||
endif
|
||||
|
||||
if len( aLevel[ nPointer - 1, n, 4 ] ) > 0
|
||||
|
||||
// display the message
|
||||
dispout( aLevel[ nPointer - 1, n, 4 ] )
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
// save the current row
|
||||
q := n
|
||||
|
||||
ColorSelect( CLR_ENHANCED )
|
||||
|
||||
// highlight the prompt
|
||||
setpos( aLevel[ nPointer - 1, n, 1 ], aLevel[ nPointer - 1, n, 2 ] )
|
||||
dispout( aLevel[ nPointer - 1, n, 3 ] )
|
||||
|
||||
ColorSelect( CLR_STANDARD )
|
||||
|
||||
setpos( aLevel[ nPointer - 1, n, 1 ], aLevel[ nPointer - 1, n, 2 ] )
|
||||
|
||||
// wait for a keystroke
|
||||
nKey := inkey( 0 )
|
||||
|
||||
// check for keystrokes
|
||||
do case
|
||||
case ( bAction := setkey( nKey ) ) <> NIL
|
||||
|
||||
eval( bAction, procname( 1 ), procline( 1 ), Upper( cVariable ) )
|
||||
if empty( nextkey() )
|
||||
keyboard chr( 255 )
|
||||
inkey()
|
||||
nKey := 0
|
||||
endif
|
||||
|
||||
case nKey == K_DOWN .or. nKey == K_RIGHT
|
||||
n ++
|
||||
if n > nArrLen
|
||||
if set( _SET_WRAP )
|
||||
n := 1
|
||||
else
|
||||
n := nArrLen
|
||||
endif
|
||||
endif
|
||||
case nKey == K_UP .or. nKey == K_LEFT
|
||||
n --
|
||||
if n < 1
|
||||
if set( _SET_WRAP )
|
||||
n := nArrLen
|
||||
else
|
||||
n := 1
|
||||
endif
|
||||
endif
|
||||
case nKey == K_ENTER .or. nKey == K_PGUP .or. nKey == K_PGDN
|
||||
exit
|
||||
case nKey == K_ESC
|
||||
n := 0
|
||||
exit
|
||||
case nKey == K_HOME
|
||||
n := 1
|
||||
case nKey == K_END
|
||||
n := nArrLen
|
||||
otherwise
|
||||
// did user hit a hot key?
|
||||
for y := 1 to nArrLen
|
||||
if upper( left( ltrim( aLevel[ nPointer - 1, y, 3 ] ), 1 ) ) == upper( chr( nKey ) )
|
||||
n := y
|
||||
exit
|
||||
endif
|
||||
next
|
||||
endcase
|
||||
|
||||
// unhighlight the prompt
|
||||
setpos( aLevel[ nPointer - 1, q, 1 ], aLevel[ nPointer - 1, q, 2 ] )
|
||||
dispout( aLevel[ nPointer - 1, q, 3 ] )
|
||||
|
||||
enddo
|
||||
|
||||
endif
|
||||
|
||||
nPointer --
|
||||
|
||||
asize( aLevel, nPointer - 1 )
|
||||
|
||||
setcursor( nSaveCsr )
|
||||
|
||||
eval( bBlock, n )
|
||||
|
||||
return n
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#include "natmsg/msgpl852.c"
|
||||
#elif defined(HARBOUR_LANGUAGE_PLMAZ)
|
||||
#include "natmsg/msgplmaz.c"
|
||||
#elif defined(HARBOUR_LANGUAGE_HE862)
|
||||
#include "natmsg/msghe862.c"
|
||||
#elif defined(HARBOUR_LANGUAGE_HEWIN)
|
||||
#include "natmsg/msghewin.c"
|
||||
#else
|
||||
#include "natmsg/msgen.c"
|
||||
#endif
|
||||
|
||||
92
harbour/source/rtl/natmsg/msghe862.c
Normal file
92
harbour/source/rtl/natmsg/msghe862.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* Language Support Module */
|
||||
|
||||
/* Language name: Hebrew - Dos */
|
||||
/* ISO language code (2 chars): HE */
|
||||
/* Codepage: 862 */
|
||||
|
||||
#include "hbdefs.h"
|
||||
|
||||
char *hb_monthsname[ 12 ] =
|
||||
{
|
||||
"˜€…<EFBFBD>‰",
|
||||
"˜€…˜<EFBFBD>”",
|
||||
"•˜Ž",
|
||||
"Œ‰˜”€",
|
||||
"‰€Ž",
|
||||
"‰<EFBFBD>…‰",
|
||||
"‰Œ…‰",
|
||||
"ˆ‘…‚…€",
|
||||
"˜<EFBFBD>Žˆ”‘",
|
||||
"˜<EFBFBD>…ˆ—…€",
|
||||
"˜<EFBFBD>Ž<EFBFBD>…<EFBFBD>",
|
||||
"˜<EFBFBD>Ž–ƒ"
|
||||
};
|
||||
|
||||
char *hb_daysname[ 7 ] =
|
||||
{
|
||||
"<EFBFBD>…™€˜",
|
||||
"‰<EFBFBD>™",
|
||||
"‰™‰Œ™",
|
||||
"‰’‰<EFBFBD>˜",
|
||||
"‰™‰Ž‡",
|
||||
"‰™‰™",
|
||||
"š<EFBFBD>™"
|
||||
};
|
||||
|
||||
char *hb_errorsGeneric[] =
|
||||
{
|
||||
"„’…ƒ‰ €Œ „€‰‚™",
|
||||
"Argument error",
|
||||
"Bound error",
|
||||
"String overflow",
|
||||
"Numeric overflow",
|
||||
"‘”€<EFBFBD> „—…Œ‡",
|
||||
"Numeric error",
|
||||
"˜‰<EFBFBD>‡š š€‰‚™",
|
||||
"Operation too complex",
|
||||
"",
|
||||
"",
|
||||
"<EFBFBD>…˜‹† —‰”‘Ž <20>‰€",
|
||||
"š˜ƒ‚…Ž €Œ „‰–—<E28093>…”",
|
||||
"No exported method",
|
||||
"<EFBFBD>‰‰— €Œ „<>š™Ž",
|
||||
"Alias does not exists",
|
||||
"No exported variable",
|
||||
"Incorrect alias name",
|
||||
"Duplicated alias name",
|
||||
"",
|
||||
"•<EFBFBD>…— š˜‰–‰ <20>ކ<C5BD> „€‰‚™",
|
||||
"„‡‰š” <20>ކ<C5BD> „€‰‚™",
|
||||
"„˜‰‚‘ <20>ކ<C5BD> „€‰‚™",
|
||||
"„€‰˜— <20>ކ<C5BD> „€‰‚™",
|
||||
"„<EFBFBD>‰š‹ <20>ކ<C5BD> „€‰‚™",
|
||||
"„‘”ƒ„ š€‰‚™",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"š‹Žš<EFBFBD> „<>‰€ š€† „Œ…’”",
|
||||
"Limit exeeded",
|
||||
"<EFBFBD>‰—š €Œ …€ ™<>…™Ž ‘—<E28098>‰€",
|
||||
"Incorrect type of data",
|
||||
"Data width too long",
|
||||
"Workarea not in use",
|
||||
"Workarea not indexed",
|
||||
"Exclusive use required",
|
||||
"„Œ‰’<EFBFBD> „™…˜ƒ",
|
||||
"„˜…‘€ „<>‰š‹ šŒ…’”",
|
||||
"Append lock failed",
|
||||
"„Œ™‹<EFBFBD> „Œ‰’<E280B0> šŒ…’”",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"<EFBFBD>‰˜ˆŽ˜” Œ™ ‰…‚™ ˜”‘Ž",
|
||||
"Š˜’ŽŒ „™‰‚",
|
||||
"array assign",
|
||||
"Š˜’Ž €Œ",
|
||||
"conditional"
|
||||
};
|
||||
92
harbour/source/rtl/natmsg/msghewin.c
Normal file
92
harbour/source/rtl/natmsg/msghewin.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* Language Support Module */
|
||||
|
||||
/* Language name: Hebrew - Windows */
|
||||
/* ISO language code (2 chars): HE */
|
||||
/* Codepage: 1255 */
|
||||
|
||||
#include "hbdefs.h"
|
||||
|
||||
char *hb_monthsname[ 12 ] =
|
||||
{
|
||||
"ינואר",
|
||||
"פברואר",
|
||||
"מרץ",
|
||||
"אפריל",
|
||||
"מאי",
|
||||
"יוני",
|
||||
"יולי",
|
||||
"אוגוסט",
|
||||
"ספטמבר",
|
||||
"אוקטובר",
|
||||
"נובמבר",
|
||||
"דצמבר"
|
||||
};
|
||||
|
||||
char *hb_daysname[ 7 ] =
|
||||
{
|
||||
"ראשון",
|
||||
"שני",
|
||||
"שלישי",
|
||||
"רביעי",
|
||||
"חמישי",
|
||||
"שישי",
|
||||
"שבת"
|
||||
};
|
||||
|
||||
char *hb_errorsGeneric[] =
|
||||
{
|
||||
"שגיאה לא ידועה",
|
||||
"Argument error",
|
||||
"Bound error",
|
||||
"String overflow",
|
||||
"Numeric overflow",
|
||||
"חלוקה באפס",
|
||||
"Numeric error",
|
||||
"שגיאת תחביר",
|
||||
"Operation too complex",
|
||||
"",
|
||||
"",
|
||||
"אין מספיק זכרון",
|
||||
"פונקציה לא מוגדרת",
|
||||
"No exported method",
|
||||
"משתנה לא קיים",
|
||||
"Alias does not exists",
|
||||
"No exported variable",
|
||||
"Incorrect alias name",
|
||||
"Duplicated alias name",
|
||||
"",
|
||||
"שגיאה בזמן יצירת קובץ",
|
||||
"שגיאה בזמן פתיחה",
|
||||
"שגיאה בזמן סגירה",
|
||||
"שגיאה בזמן קריאה",
|
||||
"שגיאה בזמן כתיבה",
|
||||
"שגיאת הדפסה",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"פעולה זאת אינה נתמכת",
|
||||
"Limit exeeded",
|
||||
"אינקס משובש או לא תקין",
|
||||
"Incorrect type of data",
|
||||
"Data width too long",
|
||||
"Workarea not in use",
|
||||
"Workarea not indexed",
|
||||
"Exclusive use required",
|
||||
"דרושה נעילה",
|
||||
"פעולת כתיבה אסורה",
|
||||
"Append lock failed",
|
||||
"פעולת נעילה נכשלה",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"מספר שגוי של פרמטרים",
|
||||
"גישה למערך",
|
||||
"array assign",
|
||||
"לא מערך",
|
||||
"conditional"
|
||||
};
|
||||
@@ -22,7 +22,7 @@
|
||||
You can contact me at: ptucker@sympatico.ca
|
||||
*/
|
||||
|
||||
#include "pcode.h"
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "set.h"
|
||||
#ifdef HARBOUR_USE_GTAPI
|
||||
@@ -31,6 +31,17 @@
|
||||
static char old_string[ sizeof( hb_set.HB_SET_COLOR ) ];
|
||||
#endif
|
||||
|
||||
HARBOUR HB_SETCOLOR( void );
|
||||
HARBOUR HB_COLORSELECT( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( SETCOLOR__InitSymbols )
|
||||
{ "SETCOLOR" , FS_PUBLIC, HB_SETCOLOR , 0 },
|
||||
{ "COLORSELECT" , FS_PUBLIC, HB_COLORSELECT, 0 }
|
||||
HB_INIT_SYMBOLS_END( SETCOLOR__InitSymbols );
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup SETCOLOR__InitSymbols
|
||||
#endif
|
||||
|
||||
char *hb_setColor( char *sColor )
|
||||
{
|
||||
#ifdef HARBOUR_USE_GTAPI
|
||||
@@ -57,17 +68,6 @@ char *hb_setColor( char *sColor )
|
||||
#endif
|
||||
}
|
||||
|
||||
HARBOUR HB_SETCOLOR( void );
|
||||
HARBOUR HB_COLORSELECT( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( SETCOLOR__InitSymbols )
|
||||
{ "SETCOLOR" , FS_PUBLIC, HB_SETCOLOR , 0 },
|
||||
{ "COLORSELECT" , FS_PUBLIC, HB_COLORSELECT, 0 }
|
||||
HB_INIT_SYMBOLS_END( SETCOLOR__InitSymbols );
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup SETCOLOR__InitSymbols
|
||||
#endif
|
||||
|
||||
HARBOUR HB_SETCOLOR( void )
|
||||
{
|
||||
hb_retc( hb_setColor( hb_pcount() ? hb_parc(1) : NULL ) );
|
||||
|
||||
@@ -53,7 +53,7 @@ static BYTE prgFunction[] = { 0x68, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
typedef union
|
||||
{
|
||||
PBYTE pAsmData; /* The assembler bytes */
|
||||
BYTE * pAsmData; /* The assembler bytes */
|
||||
PHB_FUNC pFunPtr; /* The (dynamic) harbour
|
||||
function */
|
||||
} ASM_CALL, *PASM_CALL;
|
||||
@@ -62,7 +62,7 @@ typedef struct
|
||||
{
|
||||
char *szName; /* Name of the function */
|
||||
PASM_CALL pAsmCall; /* Assembler call */
|
||||
PBYTE pCode; /* P-code */
|
||||
BYTE * pCode; /* P-code */
|
||||
} DYNFUNC, *PDYNFUNC;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ typedef struct
|
||||
FindSymbol */
|
||||
|
||||
HARBOUR HB_HB_RUN();
|
||||
static PASM_CALL CreateFun( PHB_SYMB, PBYTE ); /* Create a dynamic function*/
|
||||
static PASM_CALL CreateFun( PHB_SYMB, BYTE * ); /* Create a dynamic function*/
|
||||
static ULONG FindSymbol( char *, PDYNFUNC, ULONG );
|
||||
static void HRB_FileClose( FILE * );
|
||||
static void HRB_FileRead ( char *, int, int, FILE * );
|
||||
@@ -153,7 +153,7 @@ HARBOUR HB_HB_RUN( void )
|
||||
pDynFunc[ ul ].szName = ReadId( file );
|
||||
|
||||
ulSize = ReadLong( file ) + 1; /* Read size of function */
|
||||
pDynFunc[ ul ].pCode = ( PBYTE )hb_xgrab( ulSize );
|
||||
pDynFunc[ ul ].pCode = ( BYTE * )hb_xgrab( ulSize );
|
||||
HRB_FileRead( pDynFunc[ ul ].pCode, 1, ulSize, file );
|
||||
/* Read the block */
|
||||
|
||||
@@ -383,7 +383,7 @@ static void HRB_FileClose( FILE *file )
|
||||
|
||||
|
||||
/* Patch an address of the dynamic function */
|
||||
static void Patch( PBYTE pCode, ULONG ulOffset, void *Address )
|
||||
static void Patch( BYTE * pCode, ULONG ulOffset, void *Address )
|
||||
{
|
||||
/* #if 32 bits and low byte first */
|
||||
|
||||
@@ -400,7 +400,7 @@ static void Patch( PBYTE pCode, ULONG ulOffset, void *Address )
|
||||
|
||||
|
||||
/* Intel specific ?? Patch an address relative to the next instruction */
|
||||
static void PatchRelative( PBYTE pCode, ULONG ulOffset,
|
||||
static void PatchRelative( BYTE * pCode, ULONG ulOffset,
|
||||
void *Address, ULONG ulNext )
|
||||
{
|
||||
/* #if 32 bits and low byte first */
|
||||
@@ -435,11 +435,11 @@ static void PatchRelative( PBYTE pCode, ULONG ulOffset,
|
||||
If a .PRG contains 10 functions, 10 dynamic functions are created which
|
||||
are all the same :-) except for 2 pointers.
|
||||
*/
|
||||
static PASM_CALL CreateFun( PHB_SYMB pSymbols, PBYTE pCode )
|
||||
static PASM_CALL CreateFun( PHB_SYMB pSymbols, BYTE * pCode )
|
||||
{
|
||||
PASM_CALL asmRet = (PASM_CALL) hb_xgrab( sizeof( ASM_CALL ) );
|
||||
|
||||
asmRet->pAsmData = (PBYTE) hb_xgrab( sizeof( prgFunction ) );
|
||||
asmRet->pAsmData = (BYTE * ) hb_xgrab( sizeof( prgFunction ) );
|
||||
memcpy( asmRet->pAsmData, prgFunction, sizeof( prgFunction ) );
|
||||
/* Copy new assembler code in */
|
||||
/* #if INTEL32 */
|
||||
|
||||
@@ -58,7 +58,7 @@ HARBOUR HB_HB_FUSE( void )
|
||||
else
|
||||
open_flags = 0;
|
||||
|
||||
handles[area] = hb_fsOpen( (BYTEP) hb_parc(1), open_flags );
|
||||
handles[area] = hb_fsOpen( ( BYTE * ) hb_parc(1), open_flags );
|
||||
offset[area] = 0;
|
||||
recno[area] = 1;
|
||||
b = ( char * )hb_xgrab( b_size );
|
||||
@@ -117,7 +117,7 @@ long hb_hbfskip( int recs )
|
||||
if ( recs > 0 ) {
|
||||
for (y = 0; y < recs; y++ ) {
|
||||
hb_fsSeek( handles[area], offset[area], SEEK_SET );
|
||||
read_len = hb_fsRead( handles[area], (BYTEP) b, b_size );
|
||||
read_len = hb_fsRead( handles[area], ( BYTE * ) b, b_size );
|
||||
for (x = 0; x < read_len; x++ ) {
|
||||
if ( ((*(b + x) == 13) && (*(b + x + 1) == 10)) ||
|
||||
((*(b + x) == 10) && (*(b + x + 1) == 13)) ) {
|
||||
@@ -151,7 +151,7 @@ long hb_hbfskip( int recs )
|
||||
}
|
||||
|
||||
hb_fsSeek( handles[area], read_pos, SEEK_SET );
|
||||
read_len = hb_fsRead( handles[area], (BYTEP) b, read_len );
|
||||
read_len = hb_fsRead( handles[area], ( BYTE * ) b, read_len );
|
||||
|
||||
for (x = read_len - 4; x >= 0; x-- ) {
|
||||
if ( ((*(b + x) == 13) && (*(b + x + 1) == 10)) ||
|
||||
@@ -181,7 +181,7 @@ HARBOUR HB_HB_FREADLN( void )
|
||||
long read;
|
||||
|
||||
hb_fsSeek( handles[area], offset[area], SEEK_SET );
|
||||
read = hb_fsRead( handles[area], (BYTEP) b, b_size );
|
||||
read = hb_fsRead( handles[area], ( BYTE * ) b, b_size );
|
||||
|
||||
for ( x = 0; x < b_size; x++ ) {
|
||||
if ( ((*(b + x) == 13) && (*(b + x + 1) == 10)) ||
|
||||
@@ -249,7 +249,7 @@ HARBOUR HB_HB_FGOBOTTOM(void)
|
||||
do {
|
||||
|
||||
hb_fsSeek( handles[area], offset[area], SEEK_SET );
|
||||
len = hb_fsRead( handles[area], (BYTEP) c, c_size );
|
||||
len = hb_fsRead( handles[area], ( BYTE * ) c, c_size );
|
||||
for ( x = 0; x < len; x++ ) {
|
||||
if ( ((*(c + x) == 13) && (*(c + x + 1) == 10)) ||
|
||||
((*(c + x) == 10) && (*(c + x + 1) == 13)) ||
|
||||
|
||||
@@ -264,7 +264,7 @@ int main( int argc, char * argv[] )
|
||||
return bErrorLevel;
|
||||
}
|
||||
|
||||
void VirtualMachine( PBYTE pCode, PHB_SYMB pSymbols )
|
||||
void VirtualMachine( BYTE * pCode, PHB_SYMB pSymbols )
|
||||
{
|
||||
BYTE bCode;
|
||||
WORD w = 0, wParams, wSize;
|
||||
|
||||
@@ -80,6 +80,7 @@ PRG_SOURCES=\
|
||||
mankala.prg \
|
||||
mathtest.prg \
|
||||
memvar.prg \
|
||||
menutest.prg \
|
||||
mtran.prg \
|
||||
multiarg.prg \
|
||||
nums.prg \
|
||||
|
||||
70
harbour/tests/working/menutest.prg
Normal file
70
harbour/tests/working/menutest.prg
Normal file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
procedure main()
|
||||
|
||||
memvar ptestvar
|
||||
|
||||
local testvar
|
||||
|
||||
set key K_F8 to RECURSE()
|
||||
|
||||
clear screen
|
||||
|
||||
@ 1, 10 prompt 'Menu Item 1' message 'Menu Message 1'
|
||||
@ 2, 10 prompt 'Menu Item 2' message 'Menu Message 2'
|
||||
@ 3, 10 prompt 'Menu Item 3' message 'Menu Message 3'
|
||||
@ 4, 10 prompt 'Menu Item 4' message 'Menu Message 4'
|
||||
|
||||
@ 6, 10 say 'Testing with LOCAL parameter'
|
||||
@ 7, 10 say 'Press F8 to recurse into MENU TO'
|
||||
|
||||
menu to testvar
|
||||
|
||||
@ 9, 10 say 'Your Choice = ' + str( testvar, 1 )
|
||||
|
||||
Inkey(0)
|
||||
|
||||
set key K_F8 to RECURSE()
|
||||
|
||||
clear screen
|
||||
|
||||
@ 1, 10 prompt 'Menu Item 1' message 'Menu Message 1'
|
||||
@ 2, 10 prompt 'Menu Item 2' message 'Menu Message 2'
|
||||
@ 3, 10 prompt 'Menu Item 3' message 'Menu Message 3'
|
||||
@ 4, 10 prompt 'Menu Item 4' message 'Menu Message 4'
|
||||
|
||||
@ 6, 10 say 'Testing with MEMVAR parameter'
|
||||
@ 7, 10 say 'Press F8 to recurse into MENU TO'
|
||||
|
||||
menu to ptestvar
|
||||
|
||||
@ 9, 10 say 'Your Choice = ' + str( ptestvar, 1 )
|
||||
|
||||
return
|
||||
|
||||
procedure RECURSE()
|
||||
|
||||
local testvar
|
||||
|
||||
set key K_F8 to
|
||||
|
||||
@ 6, 10 say ' '
|
||||
|
||||
@ 1, 50 prompt 'Menu Item 1' message 'Menu Message 1'
|
||||
@ 2, 50 prompt 'Menu Item 2' message 'Menu Message 2'
|
||||
@ 3, 50 prompt 'Menu Item 3' message 'Menu Message 3'
|
||||
@ 4, 50 prompt 'Menu Item 4' message 'Menu Message 4'
|
||||
|
||||
menu to testvar
|
||||
|
||||
@ 7, 10 say 'Press F8 to recurse into MENU TO'
|
||||
|
||||
@ 9, 50 say 'Your Choice = ' + str( testvar, 1 )
|
||||
|
||||
set key K_F8 to RECURSE()
|
||||
|
||||
return
|
||||
@@ -1,46 +0,0 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
// Harbour menuto
|
||||
|
||||
#command @ <row>, <col> PROMPT <prompt> [MESSAGE <msg>] ;
|
||||
=> __AtPrompt( <row>, <col>, <prompt> , <msg> )
|
||||
|
||||
#command MENU TO <v> ;
|
||||
=> <v> := __MenuTo( {|_1| if(PCount() == 0, <v>, <v> := _1)}, #<v> )
|
||||
|
||||
#include "box.ch"
|
||||
********************************************************************************
|
||||
function main()
|
||||
********************************************************************************
|
||||
local nchoice
|
||||
local amenu := {"Option ~One","Option ~Two","Option T~hree","Option ~Four"}
|
||||
local i
|
||||
local ccolor
|
||||
local scr := savescreen(0,0,maxrow(),maxcol())
|
||||
|
||||
set wrap on
|
||||
set message to 24
|
||||
|
||||
scroll()
|
||||
|
||||
ccolor := setcolor("w+/n,w+/b,b/n,w+/n,gr+/n")
|
||||
|
||||
dispbox( 10, 13, 10 + len( amenu) + 1, 30, B_SINGLE + ' ' )
|
||||
|
||||
for i := 1 to len( amenu )
|
||||
@10+i,15 prompt amenu[i] message "This Is " + strtran(amenu[i],"~","")
|
||||
next
|
||||
|
||||
menu to nchoice
|
||||
|
||||
qout("You Have Chosen Option " + str(nchoice,1) + " !")
|
||||
|
||||
inkey(0)
|
||||
|
||||
setcolor( ccolor )
|
||||
|
||||
restscreen(0,0,maxrow(),maxcol(),scr)
|
||||
|
||||
return nil
|
||||
Reference in New Issue
Block a user