Commit 35ee485b authored by Olivier Bertrand's avatar Olivier Bertrand

- Implemented: not split indexes (all indexes in one file)

modified:
  storage/connect/tabdos.cpp
  storage/connect/xindex.cpp
  storage/connect/xindex.h
parent f4570a7b
...@@ -249,10 +249,8 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) ...@@ -249,10 +249,8 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Ending = Cat->GetIntCatInfo("Ending", CRLF); Ending = Cat->GetIntCatInfo("Ending", CRLF);
if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) { if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) {
int defhuge = (Cat->GetDefHuge()) ? 1 : 0; Huge = Cat->GetBoolCatInfo("Huge", Cat->GetDefHuge());
Padded = Cat->GetBoolCatInfo("Padded", false);
Huge = (Cat->GetIntCatInfo("Huge", defhuge) != 0);
Padded = (Cat->GetIntCatInfo("Padded", 0) != 0);
Blksize = Cat->GetIntCatInfo("Blksize", 0); Blksize = Cat->GetIntCatInfo("Blksize", 0);
Eof = (Cat->GetIntCatInfo("EOF", 0) != 0); Eof = (Cat->GetIntCatInfo("EOF", 0) != 0);
} else if (Recfm == RECFM_DBF) { } else if (Recfm == RECFM_DBF) {
...@@ -554,8 +552,8 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) ...@@ -554,8 +552,8 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
if (!x->Make(g, sxp)) { if (!x->Make(g, sxp)) {
// Retreive define values from the index // Retreive define values from the index
xdp->SetMaxSame(x->GetMaxSame()); xdp->SetMaxSame(x->GetMaxSame());
xdp->SetOffset(x->GetDefoff()); // xdp->SetOffset(x->GetDefoff());
xdp->SetOffhigh(x->GetDefhigh()); // xdp->SetOffhigh(x->GetDefhigh());
xdp->SetSize(x->GetSize()); xdp->SetSize(x->GetSize());
// store KXYCOL Mxs in KPARTDEF Mxsame // store KXYCOL Mxs in KPARTDEF Mxsame
......
This diff is collapsed.
...@@ -58,6 +58,13 @@ typedef struct index_def : public BLOCK { ...@@ -58,6 +58,13 @@ typedef struct index_def : public BLOCK {
bool Alloc; // Must allocate values bool Alloc; // Must allocate values
} INDX; } INDX;
typedef struct index_off {
union {
struct {int Low; int High;};
longlong Val; // File position
}; // end of union
} IOFF;
/***********************************************************************/ /***********************************************************************/
/* Index definition block. */ /* Index definition block. */
/***********************************************************************/ /***********************************************************************/
...@@ -85,10 +92,10 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */ ...@@ -85,10 +92,10 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */
void SetNParts(uint np) {Nparts = (signed)np;} void SetNParts(uint np) {Nparts = (signed)np;}
void SetMaxSame(int mxs) {MaxSame = mxs;} void SetMaxSame(int mxs) {MaxSame = mxs;}
void SetMxsame(PXINDEX x); void SetMxsame(PXINDEX x);
int GetOffset(void) {return Offset;} //int GetOffset(void) {return Offset;}
void SetOffset(int off) {Offset = off;} //void SetOffset(int off) {Offset = off;}
int GetOffhigh(void) {return Offhigh;} //int GetOffhigh(void) {return Offhigh;}
void SetOffhigh(int hof) {Offhigh = hof;} //void SetOffhigh(int hof) {Offhigh = hof;}
int GetSize(void) {return Size;} int GetSize(void) {return Size;}
void SetSize(int size) {Size = size;} void SetSize(int size) {Size = size;}
int GetMaxSame(void) {return MaxSame;} int GetMaxSame(void) {return MaxSame;}
...@@ -110,8 +117,8 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */ ...@@ -110,8 +117,8 @@ class DllExport INDEXDEF : public BLOCK { /* Index description block */
bool AutoInc; /* true if unique key in auto increment */ bool AutoInc; /* true if unique key in auto increment */
int Nparts; /* Number of key parts */ int Nparts; /* Number of key parts */
int ID; /* Index ID number */ int ID; /* Index ID number */
int Offset; /* Offset in index file */ //int Offset; /* Offset in index file */
int Offhigh; /* Offset high in big index file */ //int Offhigh; /* Offset high in big index file */
int Size; /* Size of index file */ int Size; /* Size of index file */
int MaxSame; /* Max number of same values */ int MaxSame; /* Max number of same values */
}; // end of INDEXDEF }; // end of INDEXDEF
...@@ -308,6 +315,7 @@ class DllExport XINDXS : public XINDEX { ...@@ -308,6 +315,7 @@ class DllExport XINDXS : public XINDEX {
/* This is the saving/loading index utility base class. */ /* This is the saving/loading index utility base class. */
/***********************************************************************/ /***********************************************************************/
class DllExport XLOAD : public BLOCK { class DllExport XLOAD : public BLOCK {
friend class XINDEX;
friend class XBIGEX; friend class XBIGEX;
friend class XBIGXS; friend class XBIGXS;
public: public:
...@@ -315,12 +323,13 @@ class DllExport XLOAD : public BLOCK { ...@@ -315,12 +323,13 @@ class DllExport XLOAD : public BLOCK {
XLOAD(void); XLOAD(void);
// Methods // Methods
virtual bool Open(PGLOBAL g, char *filename, MODE mode) = 0; virtual bool Open(PGLOBAL g, char *filename, int id, MODE mode) = 0;
virtual bool GetOff(int& low, int& high, PIXDEF sxp) = 0; //virtual bool GetOff(int& low, int& high, PIXDEF sxp) = 0;
virtual bool Seek(PGLOBAL g, int low, int high, int origin) = 0; virtual bool Seek(PGLOBAL g, int low, int high, int origin) = 0;
virtual bool Read(PGLOBAL g, void *buf, int n, int size) = 0; virtual bool Read(PGLOBAL g, void *buf, int n, int size) = 0;
virtual int Write(PGLOBAL g, void *buf, int n, virtual int Write(PGLOBAL g, void *buf, int n,
int size, bool& rc) = 0; int size, bool& rc) = 0;
virtual void Close(char *fn, int id) = 0;
virtual void Close(void); virtual void Close(void);
#if defined(XMAP) #if defined(XMAP)
virtual void *FileView(PGLOBAL g, char *fn, int loff, virtual void *FileView(PGLOBAL g, char *fn, int loff,
...@@ -337,6 +346,7 @@ class DllExport XLOAD : public BLOCK { ...@@ -337,6 +346,7 @@ class DllExport XLOAD : public BLOCK {
#else // UNIX #else // UNIX
int Hfile; // Descriptor to file or map int Hfile; // Descriptor to file or map
#endif // UNIX #endif // UNIX
IOFF NewOff; // New offset
}; // end of class XLOAD }; // end of class XLOAD
/***********************************************************************/ /***********************************************************************/
...@@ -348,11 +358,12 @@ class DllExport XFILE : public XLOAD { ...@@ -348,11 +358,12 @@ class DllExport XFILE : public XLOAD {
XFILE(void); XFILE(void);
// Methods // Methods
virtual bool Open(PGLOBAL g, char *filename, MODE mode); virtual bool Open(PGLOBAL g, char *filename, int id, MODE mode);
virtual bool GetOff(int& low, int& high, PIXDEF sxp); //virtual bool GetOff(int& low, int& high, PIXDEF sxp);
virtual bool Seek(PGLOBAL g, int low, int high, int origin); virtual bool Seek(PGLOBAL g, int low, int high, int origin);
virtual bool Read(PGLOBAL g, void *buf, int n, int size); virtual bool Read(PGLOBAL g, void *buf, int n, int size);
virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc); virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc);
virtual void Close(char *fn, int id);
virtual void Close(void); virtual void Close(void);
#if defined(XMAP) #if defined(XMAP)
virtual void *FileView(PGLOBAL g, char *fn, int loff, virtual void *FileView(PGLOBAL g, char *fn, int loff,
...@@ -376,11 +387,12 @@ class DllExport XHUGE : public XLOAD { ...@@ -376,11 +387,12 @@ class DllExport XHUGE : public XLOAD {
XHUGE(void) : XLOAD() {} XHUGE(void) : XLOAD() {}
// Methods // Methods
virtual bool Open(PGLOBAL g, char *filename, MODE mode); virtual bool Open(PGLOBAL g, char *filename, int id, MODE mode);
virtual bool GetOff(int& low, int& high, PIXDEF sxp); //virtual bool GetOff(int& low, int& high, PIXDEF sxp);
virtual bool Seek(PGLOBAL g, int low, int high, int origin); virtual bool Seek(PGLOBAL g, int low, int high, int origin);
virtual bool Read(PGLOBAL g, void *buf, int n, int size); virtual bool Read(PGLOBAL g, void *buf, int n, int size);
virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc); virtual int Write(PGLOBAL g, void *buf, int n, int size, bool& rc);
virtual void Close(char *fn, int id);
#if defined(XMAP) #if defined(XMAP)
virtual void *FileView(PGLOBAL g, char *fn, int loff, virtual void *FileView(PGLOBAL g, char *fn, int loff,
int hoff, int size); int hoff, int size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment