From 6803114466279b8a70bbc1a2d26e97efc3f48a0b Mon Sep 17 00:00:00 2001 From: Patrick Mast Date: Sun, 20 Jan 2002 22:57:10 +0000 Subject: [PATCH] Added files in /contrib/apollo --- harbour/contrib/apollo/apollo.c | 69 ++++++++---- harbour/contrib/apollo/apollo1.prg | 16 +++ harbour/contrib/apollo/changelog | 87 ++++++++++++++ harbour/contrib/apollo/test/apollo.ch | 150 +++++++++++++++++++++++++ harbour/contrib/apollo/test/apollo.prg | 34 +----- 5 files changed, 300 insertions(+), 56 deletions(-) create mode 100644 harbour/contrib/apollo/changelog create mode 100644 harbour/contrib/apollo/test/apollo.ch diff --git a/harbour/contrib/apollo/apollo.c b/harbour/contrib/apollo/apollo.c index 173d771201..68d4e02231 100644 --- a/harbour/contrib/apollo/apollo.c +++ b/harbour/contrib/apollo/apollo.c @@ -275,10 +275,6 @@ switch ( hb_parni( 2 ) ) default: sx_Replace( hb_parc( 1 ), hb_parni( 2 ), ( void * ) hb_parc( 3) ); } -// sx_Replace( hb_parc( 1 ), /* Field name */ -// hb_parni( 2 ), /* Data type */ -// hb_parc( 3) ); /* Data */ - } @@ -301,6 +297,17 @@ HB_FUNC( SX_SEEK ) } +/* -----------------20/01/2002 13:36----------------- + * sx_Select() => The previous select area is returned. + * If there was no previous area active, zero is returned. + * --------------------------------------------------*/ +HB_FUNC( SX_SELECT ) +{ + hb_retni( + sx_Seek( hb_parc( 1 ) ) ); /* The work area number returned when the file was opened. */ +} + + /* -----------------30/12/2001 12:30----------------- * sx_SetCentury() => NILL * Indicates whether or not the two digits of the year designating @@ -334,6 +341,16 @@ HB_FUNC( SX_SETMEMOBLOCKSIZE ) * The size must be a value from 1 through 1024. */ } +/* -----------------20/01/2002 13:33----------------- + * sx_SetOrder() => The previous index order identifier in use is returned. + * If zero, there was no previous index order in use. + * --------------------------------------------------*/ +HB_FUNC( SX_SETORDER ) +{ + hb_retni( + sx_SetOrder( hb_parni( 1 ) ) ); /* Selects an existing order as the controlling index order. */ +} + /* -----------------29/12/2001 19:59----------------- * sx_SetSoftSeek() @@ -353,6 +370,27 @@ HB_FUNC( SX_SKIP ) } +/* -----------------20/01/2002 14:2----------------- + * sx_SysProp() => Varies depending on the type of data being requested. + * LONG SDEAPI WINAPI sx_SysProp (WORD uiSysItem, PVOID vpData); + * --------------------------------------------------*/ +HB_FUNC( SX_SYSPROP ) +{ + int i = hb_parni( 2 ); + hb_retni( + sx_SysProp( hb_parni( 1 ), /* One of the predefined constant values. See Apollo.ch */ + ( void * ) &i )); +} +/* +HB_FUNC( SX_DISABLEAUTOOPEN ) +{ + int i = 1; + sx_SysProp( 1013, ( void * ) &i ); +} +*/ + + + /* -----------------29/12/2001 19:17----------------- * sx_Use() * --------------------------------------------------*/ @@ -386,24 +424,6 @@ HB_FUNC( SX_ZAP ) -/* -2001-12-30 13:47 UTC+0100 Patrick Mast - * contrib/apollo/apollo.c - + Added function sx_GetDateJulian() - + Added function sx_GetVariant() - + Added function sx_SetCentury() - + Added function sx_SetDateFormat() - + Added function sx_GetLogical() - * modified function sx_Replace() - Note: Replace a logical value with sx_Replace() does not work yet. - * contrib/apollo/test/apollo.prg - * Added added functions in the test application. - * enhanced code - * Added and changed defines - -*/ - - /* sx_AppendBlank() sx_Close() @@ -420,17 +440,20 @@ sx_Go() sx_GoBottom() sx_GoTop() sx_IndexTag() -sx_RecCOunt() +sx_RecCount() sx_RecNo() sx_Reindex() sx_Replace() sx_RLock() sx_Seek() +sx_Select() sx_SetDateFormat() sx_SetCentury() sx_SetMemoBlockSize() +sx_SetOrder() sx_SetSoftSeek() sx_Skip() +sx_SysProp sx_Use() sx_Version() sx_Zap() diff --git a/harbour/contrib/apollo/apollo1.prg b/harbour/contrib/apollo/apollo1.prg index 75451858bf..ac937332ac 100644 --- a/harbour/contrib/apollo/apollo1.prg +++ b/harbour/contrib/apollo/apollo1.prg @@ -64,3 +64,19 @@ init procedure ApolloInit */ return + + + +/* -----------------20/01/2002 13:25----------------- + * sx_GetVal() + * --------------------------------------------------*/ +Function sx_GetVal( x ) +RETURN Val( sx_Getvariant( x ) ) + + + + +/* +sx_GetVal() + +*/ \ No newline at end of file diff --git a/harbour/contrib/apollo/changelog b/harbour/contrib/apollo/changelog new file mode 100644 index 0000000000..8d32153eef --- /dev/null +++ b/harbour/contrib/apollo/changelog @@ -0,0 +1,87 @@ +/* + * $Id$ + */ + +/* Use this format for the entry headers: + YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name + For example: + 2002-12-01 23:12 UTC+0100 Foo Bar +*/ + + +2002-01-20 13:29 UTC+0100 Patrick Mast + + Added ChangeLog to the /contrib/apollo dir + + contrib/apollo/test/apollo.ch + + defines for function sx_SysProp + * contrib/apollo/test/apollo.prg + Added define "Apollo.ch" + * contrib/apollo/apollo1.prg + + Added function sx_GetVal() + * contrib/apollo/apollo.c + + Added function sx_SetOrder() + + Added function sx_Select() + + Added function sx_SysProp() + +2001-12-30 13:47 UTC+0100 Patrick Mast + * contrib/apollo/apollo.c + + Added function sx_GetDateJulian() + + Added function sx_GetVariant() + + Added function sx_SetCentury() + + Added function sx_SetDateFormat() + + Added function sx_GetLogical() + * modified function sx_Replace() + Note: Replace a logical value with sx_Replace() does not work yet. + * contrib/apollo/test/apollo.prg + * Added added functions in the test application. + * enhanced code + * Added and changed defines + + +2001-12-28 22:53 UTC+0100 Patrick Mast + * contrib/apollo + + Added function sx_GoBottom() + + Added function sx_Go() + + Added function sx_Seek() + + Added function sx_SetSoftSeek() + + Added function sx_RLock() + + Added function sx_Reindex() + + Added function sx_RecCount() + + Added function sx_SetMemoBlockSize() + + Added function sx_CreateNew() + + Added function sx_CreateField() + + Added function sx_CreateExec() + * contrib/apollo/test + * Added added functions in the test application. + + +2001-12-28 20:39 UTC+0100 Patrick Mast + * contrib/apollo + + Added function sx_AppendBlank() + + Added function sx_Close() + + Added function sx_Commit() + + Added function sx_CreateField() + + Added function sx_Eof() + + Added function sx_GetString() + + Added function sx_GoTop() + + Added function sx_IndexTag() + + Added function sx_RecNo() + + Added function sx_Replace() + + Added function sx_Skip() + + Added function sx_Use() + + Added function sx_Zap() + * contrib/apollo/test + * Added functions in a test application. + +2001-12-28 18:54 UTC+0100 Patrick Mast + * contrib/apollo + + added readme.txt + * contrib/apollo/test + + bld.bat + + bld_b32.bat + * updated apollo.prg + +2001-12-28 13:28 UTC+0100 Patrick Mast + + contrib/apollo + * Started Apollo SDE60.DLL connection for accessing + SIXNSX database files + Note: This is only the start. \ No newline at end of file diff --git a/harbour/contrib/apollo/test/apollo.ch b/harbour/contrib/apollo/test/apollo.ch new file mode 100644 index 0000000000..9b4e1fd92c --- /dev/null +++ b/harbour/contrib/apollo/test/apollo.ch @@ -0,0 +1,150 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * Apollo SIXNSX defines + * + * Copyright 2001 Patrick Mast + * 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. + * + */ + +/* ************* */ +/* date types */ +/* ************* */ +#define SX_AMERICAN 0 +#define SX_ANSI 1 +#define SX_BRITISH 2 +#define SX_FRENCH 3 +#define SX_GERMAN 4 +#define SX_ITALIAN 5 +#define SX_SPANISH 6 + +/* ************************************ */ +/* Data type identifiers for sx_Replace */ +/* ************************************ */ +#define SX_R_INTEGER 1 +#define SX_R_LONG 2 +#define SX_R_DOUBLE 8 +#define SX_R_JULIAN 32 +#define SX_R_LOGICAL 128 +#define SX_R_CHAR 1024 +#define SX_R_DATESTR 1056 +#define SX_R_MEMO 3072 +#define SX_R_BITMAP 4096 +#define SX_R_BLOBFILE 8192 +#define SX_R_BLOBPTR 8193 +#define SX_R_GENERAL 8195 + +#define SX_SDENTX 1 // CA-Clipper compatible DBF-NTX driver +#define SX_SDEFOX 2 // FoxPro compatible DBF-IDX/CDX driver +#define SX_SDENSX 3 // Vista DBF-NSX driver + +#define SX_READWRITE 0 +#define SX_READONLY 1 +#define SX_EXCLUSIVE 2 + + +/* ******************************** */ +/* sx_SysProp Constants */ +/* ******************************** */ +// Global Task Information +// Gets should always be even numbers +#define SDE_SP_GETSOFTSEEK 1000 // Get the softseek flag +#define SDE_SP_SETSOFTSEEK 1001 // Set the softseek flag +#define SDE_SP_GETEXACT 1002 // Get the extact flag +#define SDE_SP_SETEXACT 1003 // Set the extact flag +#define SDE_SP_GETDELETED 1006 // Get the deleted flag +#define SDE_SP_PUTOBUFFER 1007 // Write the optimistic buffer on commit +#define SDE_SP_GETOBUFFER 1008 // Get the optimistic buffer flag +#define SDE_SP_SETOBUFFER 1009 // Set the optimistic buffer flag +#define SDE_SP_GETSTRINGTYPE 1010 // Get the stringtype flag +#define SDE_SP_SETSTRINGTYPE 1011 // Set the stringtype flag +#define SDE_SP_GETDISABLEAUTO 1012 // Get the disable auto open flag +#define SDE_SP_SETDISABLEAUTO 1013 // Set the disable auto open flag + +#define SDE_SP_SETOEMCOLLATE 1101 // Set the collation sequence for OEM tables. +#define SDE_SP_GETOEMCOLLATE 1111 // Get the collation sequence for OEM tables. +#define SDE_SP_SETCHRCOLLATE 1102 // Set the collation sequence for Win tables. +#define SDE_SP_GETCHRCOLLATE 1122 // Get the collation sequence for Win tables. +#define SDE_SP_SETLGTRCOLLATE 1103 // Set the ligatures collation dimmension +#define SDE_SP_GETLGTRCOLLATE 1133 // Get the ligatures collation dimmension + +#define SDE_SP_SETSPECIALCOLLATE 1108 // Set the international collation like DUDEN collate flag +#define SDE_SP_GETSPECIALCOLLATE 1109 // Set the international collation like DUDEN collate flag + +#define SDE_SP_GETLANGUAGECOLLATE 1110 // Get language, according to collation done + +#define SDE_SP_GETDUDENCOLLATE 1104 // get the German DUDEN collate flag +#define SDE_SP_SETDUDENCOLLATE 1105 // set the German DUDEN collate flag +#define SDE_SP_GETLIMITCASECONV 1106 // limit case conv to A-Z, a-z if TRUE +#define SDE_SP_SETLIMITCASECONV 1107 // limit case conv to A-Z, a-z if TRUE + +//Behavior settings which bridge the differences between 1.40 and 2.00 +#define SDE_SP_GETADDQUERY 1300 //Get the AddQueryFlag +#define SDE_SP_SETADDQUERY 1301 //Set the AddQueryFlag +#define SDE_SP_GETUSECONDITIONAL 1302 //Get the bUseConditional flag +#define SDE_SP_SETUSECONDITIONAL 1303 //Get the bUseConditional flag +#define SDE_SP_SETWRITEBLOBHDR 1305 //Set the bWriteBlobHdr +#define SDE_SP_GETQUERYRELAXFLAG 1306 // Get flag that dictates rules of query +#define SDE_SP_SETQUERYRELAXFLAG 1307 // Set flag that dictates rules of query + +//WorkArea information +#define SDE_SP_GETDRIVER 2000 //Get the active driver + +#define SDE_SP_SETSTRDEFLEN 2001 //Set the default lenght for STR, if 2nd parameter is absent and field lenght zero +#define SDE_SP_SETSTRDEFDEC 2002 //Set the default decimals for STR, if 3d parameter is absent and field lenght zero + +#define SDE_SP_SETDEFAPPEND 2003 //Set default behavior for ordering ordering for non-unique key like FOX/Clipper +#define SDE_SP_SETMEMOMIXED 2004 //Set pure Clipper's memo for NSX driver +#define SDE_SP_BDESPECIFIC 2005 //Set the treatment of LIKE operator in accoring to BDE +#define SDE_SP_DBASEDATEHEADER 2006 //Set the using of DBF header in according to DbaseIII+ specification +#define SDE_SP_SETAUTOPAD 2007 +#define SDE_SP_GETAUTOPAD 2008 + + +//Index information for current workarea +#define SDE_SP_GETINDEXCOUNT 3000 //Get the number of indexes +#define SDE_SP_GETDESCENDING 3002 //Get the descending flag +#define SDE_SP_GETEMPTY 3004 //Get the empty index flag diff --git a/harbour/contrib/apollo/test/apollo.prg b/harbour/contrib/apollo/test/apollo.prg index 66287dc006..4afc3730a7 100644 --- a/harbour/contrib/apollo/test/apollo.prg +++ b/harbour/contrib/apollo/test/apollo.prg @@ -50,40 +50,8 @@ * */ -/* ************* */ -/* date types */ -/* ************* */ -#define SX_AMERICAN 0 -#define SX_ANSI 1 -#define SX_BRITISH 2 -#define SX_FRENCH 3 -#define SX_GERMAN 4 -#define SX_ITALIAN 5 -#define SX_SPANISH 6 +#include "Apollo.ch" -/* ************************************ */ -/* Data type identifiers for sx_Replace */ -/* ************************************ */ -#define SX_R_INTEGER 1 -#define SX_R_LONG 2 -#define SX_R_DOUBLE 8 -#define SX_R_JULIAN 32 -#define SX_R_LOGICAL 128 -#define SX_R_CHAR 1024 -#define SX_R_DATESTR 1056 -#define SX_R_MEMO 3072 -#define SX_R_BITMAP 4096 -#define SX_R_BLOBFILE 8192 -#define SX_R_BLOBPTR 8193 -#define SX_R_GENERAL 8195 - -#define SX_SDENTX 1 // CA-Clipper compatible DBF-NTX driver -#define SX_SDEFOX 2 // FoxPro compatible DBF-IDX/CDX driver -#define SX_SDENSX 3 // Vista DBF-NSX driver - -#define SX_READWRITE 0 -#define SX_READONLY 1 -#define SX_EXCLUSIVE 2 Function Main() LOCAL nAlias,f