Commentata parte inutile o incompatibile per FOXPRO
git-svn-id: svn://10.65.10.50/trunk@43 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
224ec2c260
commit
76f5246fab
@ -1,14 +1,18 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <string.h>
|
|
||||||
#include <strings.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <files.h>
|
#include <files.h>
|
||||||
|
|
||||||
|
#ifndef FOXPRO
|
||||||
#include <expr.h>
|
#include <expr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __EXTCDECL_H
|
#ifndef __EXTCDECL_H
|
||||||
#include <extcdecl.h>
|
#include <extcdecl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <strings.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#define BLOCKLEN 512
|
#define BLOCKLEN 512
|
||||||
@ -101,9 +105,9 @@ int TFile ::
|
|||||||
status ()
|
status ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _file->IOR;
|
return _file->IOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDir ::
|
TDir ::
|
||||||
TDir ()
|
TDir ()
|
||||||
@ -126,47 +130,47 @@ const char *TDir ::
|
|||||||
name ()
|
name ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->SysName;
|
return _dir->SysName;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TDir ::des ()
|
const char *TDir ::des ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->Des;
|
return _dir->Des;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TDir ::expr ()
|
const char *TDir ::expr ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->FCalc;
|
return _dir->FCalc;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRecnotype & TDir ::
|
TRecnotype & TDir ::
|
||||||
eod ()
|
eod ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->EOD;
|
return _dir->EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRecnotype & TDir ::
|
TRecnotype & TDir ::
|
||||||
eox ()
|
eox ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->EOX;
|
return _dir->EOX;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRecnotype & TDir ::
|
TRecnotype & TDir ::
|
||||||
flags ()
|
flags ()
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return _dir->Flags;
|
return _dir->Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
word & TDir ::
|
word & TDir ::
|
||||||
len ()
|
len ()
|
||||||
@ -179,11 +183,11 @@ int TDir ::
|
|||||||
status (TDirtype dirop)
|
status (TDirtype dirop)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return fdir[dirop].IOR;
|
return fdir[dirop].IOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDir ::set_len (const UINT16 len)
|
void TDir ::set_len (const UINT16 len)
|
||||||
{
|
{
|
||||||
_dir->LenR = len;
|
_dir->LenR = len;
|
||||||
}
|
}
|
||||||
@ -242,13 +246,13 @@ int TDir ::
|
|||||||
items (TDirtype dirtype)
|
items (TDirtype dirtype)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
FileDes f;
|
FileDes f;
|
||||||
int _whichdir = (dirtype == _nordir ? NORDIR : COMDIR);
|
int _whichdir = (dirtype == _nordir ? NORDIR : COMDIR);
|
||||||
|
|
||||||
CGetFile (1, &f, _nolock, _whichdir);
|
CGetFile (1, &f, _nolock, _whichdir);
|
||||||
return (int) f.EOD;
|
return (int) f.EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
TTrec ::
|
TTrec ::
|
||||||
TTrec ()
|
TTrec ()
|
||||||
@ -271,13 +275,13 @@ int TTrec ::
|
|||||||
compare (const TSortable & a)
|
compare (const TSortable & a)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
const TTrec & r = (const TTrec &) a;
|
const TTrec & r = (const TTrec &) a;
|
||||||
const int res = memcmp ((const void *) _rec, (const void *) r._rec, sizeof (*_rec));
|
const int res = memcmp ((const void *) _rec, (const void *) r._rec, sizeof (*_rec));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrec ::rehash ()
|
void TTrec ::rehash ()
|
||||||
|
|
||||||
{
|
{
|
||||||
setrdes (_rec);
|
setrdes (_rec);
|
||||||
@ -323,32 +327,32 @@ int TTrec ::
|
|||||||
status (TDirtype dirop)
|
status (TDirtype dirop)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return rdir[dirop].IOR;
|
return rdir[dirop].IOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TTrec ::field (const char *name)
|
int TTrec ::field (const char *name)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
return findfld (_rec, (char *) name);
|
return findfld (_rec, (char *) name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTrec ::fielddef (int fld)
|
const char *TTrec ::fielddef (int fld)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
sprintf (_files_tmp_string, "%s|%d|%d|%d", _rec->Fd[fld].Name,
|
sprintf (_files_tmp_string, "%s|%d|%d|%d", _rec->Fd[fld].Name,
|
||||||
(int) _rec->Fd[fld].TypeF, (int) _rec->Fd[fld].Len,
|
(int) _rec->Fd[fld].TypeF, (int) _rec->Fd[fld].Len,
|
||||||
(int) _rec->Fd[fld].Dec);
|
(int) _rec->Fd[fld].Dec);
|
||||||
return _files_tmp_string;
|
return _files_tmp_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTrec ::keydef (int key)
|
const char *TTrec ::keydef (int key)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
TFixed_string s (_files_tmp_string, 128);
|
TFixed_string s (_files_tmp_string, 128);
|
||||||
|
|
||||||
s = "";
|
s = "";
|
||||||
@ -370,7 +374,10 @@ status (TDirtype dirop)
|
|||||||
}
|
}
|
||||||
s << (_rec->Ky[key].DupKeys ? "|X" : "| ");
|
s << (_rec->Ky[key].DupKeys ? "|X" : "| ");
|
||||||
return (const char *) s;
|
return (const char *) s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef FOXPRO
|
||||||
|
|
||||||
void TTrec ::
|
void TTrec ::
|
||||||
update_fielddef (int nfld, const char *desc)
|
update_fielddef (int nfld, const char *desc)
|
||||||
@ -437,7 +444,7 @@ void TTrec ::
|
|||||||
print_on (ostream & out)
|
print_on (ostream & out)
|
||||||
const
|
const
|
||||||
|
|
||||||
{
|
{
|
||||||
out << num () << '\n';
|
out << num () << '\n';
|
||||||
const int nfields = fields ();
|
const int nfields = fields ();
|
||||||
TToken_string s (80);
|
TToken_string s (80);
|
||||||
@ -456,7 +463,7 @@ print_on (ostream & out)
|
|||||||
s = keydef (i);
|
s = keydef (i);
|
||||||
out << s << '\n';
|
out << s << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrec ::
|
void TTrec ::
|
||||||
read_from (istream & in)
|
read_from (istream & in)
|
||||||
@ -490,3 +497,5 @@ read_from (istream & in)
|
|||||||
}
|
}
|
||||||
rehash ();
|
rehash ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // FOXPRO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user