2006-04-15 20:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/Makefile
  + harbour/include/blob.ch
  * harbour/include/dbinfo.ch
  * harbour/include/hbdbferr.h
  * harbour/include/hbrddfpt.h
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/workarea.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
    + added all CL5.3 BLOB*() functions support
    + added new RDD DBFBLOB compatible with CL5.3 DBFBLOB
      It operates on memo files only (.dbv) without tables (.dbf)
      To create .DBV file use:
         dbCreate( cFile, {}, "DBFBLOB" )

  * harbour/source/rdd/dbcmd.c
    * do not report error when empty structure table is passed to DBCREATE()
      CL5.3 allow to create even DBF files without any fields and because
      I can imagine some valid code which use it as a feature then I also
      allow it in DBF RDD.
      Authors of RDDs which do not allow to create tables without fields
      should add to their low level RDD code necessary RT error.
This commit is contained in:
Przemyslaw Czerpak
2006-04-15 18:51:38 +00:00
parent 3498a9c55b
commit 8bc1e2f652
10 changed files with 868 additions and 248 deletions

View File

@@ -57,6 +57,7 @@ PRG_HEADERS=\
assert.ch \
box.ch \
button.ch \
blob.ch \
color.ch \
common.ch \
dbedit.ch \

83
harbour/include/blob.ch Normal file
View File

@@ -0,0 +1,83 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* Header file for the RDD API Index OrderInfo and DBInfo support
*
* Copyright 2004 {list of individual authors and e-mail addresses}
* www - http://www.xharbour.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_BLOB_CH_
#define HB_BLOB_CH_
#ifndef HB_DBINFO_CH
#include "dbinfo.ch"
#endif
#xtranslate BLOBRootLock() => dbInfo( DBI_BLOB_ROOT_LOCK )
#xtranslate BLOBRootUnlock() => dbInfo( DBI_BLOB_ROOT_UNLOCK )
#xtranslate BLOBRootGet() => dbInfo( DBI_BLOB_ROOT_GET )
#xtranslate BLOBRootPut( <xBlob> ) => dbInfo( DBI_BLOB_ROOT_PUT, <xBlob> )
#xtranslate BLOBRootDelete() => BLOBRootPut( "" )
#xtranslate BLOBDirectExport( <nPointer>, <cTargetFile> [, <kMode>] ) => ;
dbInfo( DBI_BLOB_DIRECT_EXPORT, { <nPointer>, <cTargetFile>, ;
iif( <.kMode.>, <kMode>, BLOB_EXPORT_OVERWRITE ) } )
#xtranslate BLOBDirectGet( <nPointer> [, <nStart> [, <nCount> ]] ) => ;
dbInfo( DBI_BLOB_DIRECT_GET, { <nPointer>, <nStart>, <nCount> } )
#xtranslate BLOBDirectImport( <nOldPointer>, <cSourceFile> ) => ;
dbInfo( DBI_BLOB_DIRECT_IMPORT, { <nOldPointer>, <cSourceFile> } )
#xtranslate BLOBDirectPut( [<nOldPointer>], <xBlob> ) => ;
dbInfo( DBI_BLOB_DIRECT_PUT, { <nOldPointer>, <xBlob> } )
#xtranslate BLOBGet( <nFieldNo> [, <nStart> [, <nCount>]] ) => ;
dbFieldInfo( DBS_BLOB_GET, <nFieldNo>, { <nStart>, <nCount> } )
#xtranslate BLOBExport( <nFieldNo>, <cTargetFile>, <nMode> ) => ;
dbFileGet( <nFieldNo>, <cTargetFile>, <nMode> )
#xtranslate BLOBImport( <nFieldNo>, <cSourceFile> ) => ;
dbFilePut( <nFieldNo>, <cSourceFile> )
#endif /* HB_BLOB_CH_ */

View File

@@ -99,7 +99,7 @@
#define RDDI_MEMOGCTYPE 34 /* type of garbage collector used by GC */
#define RDDI_MEMOREADLOCK 35 /* use read lock in memo file access */
#define RDDI_MEMOREUSE 36 /* reuse free space on write */
#define RDDI_BLOB_SUPPORT 37 /* can support BLOB files directly */
/*
Constants for SELF_ORDINFO ()

View File

@@ -56,6 +56,7 @@
HB_EXTERN_BEGIN
/* DBF errors */
#define EDBF_UNSUPPORTED 1000
#define EDBF_OPEN_DBF 1001
#define EDBF_OPEN_MEMO 1002
#define EDBF_OPEN_INDEX 1003

View File

@@ -66,6 +66,7 @@ HB_EXTERN_BEGIN
#define DBT_MEMOEXT ".dbt"
#define FPT_MEMOEXT ".fpt"
#define SMT_MEMOEXT ".smt"
#define DBV_MEMOEXT ".dbv"
#define DBT_DEFBLOCKSIZE 512
#define FPT_DEFBLOCKSIZE 64
#define SMT_DEFBLOCKSIZE 32
@@ -73,6 +74,8 @@ HB_EXTERN_BEGIN
#define FPT_LOCKPOS 0x00000000L
#define FPT_LOCKSIZE 0x00000001L
#define FPT_ROOTBLOCK_OFFSET 0x218 /* Clipper 5.3 ROOT data block offset */
#define SIX_ITEM_BUFSIZE 14
#define FLEX_ITEM_BUFSIZE 8
#define MAX_SIXFREEBLOCKS 82
@@ -177,6 +180,7 @@ HB_EXTERN_BEGIN
#define FPTIT_FLEXAR_LONG2 0x20 /* long[4], len, dec */
#define FPTIT_FLEXAR_ULONG2 0x21 /* ulong[4], len, dec */
/* MEMO file strucutres */
typedef struct _FPTHEADER
{