Xbase Class Library
2.0.0
Main Page
Classes
Files
File List
File Members
xbase
xbase.h
Go to the documentation of this file.
1
/* $Id: xbase.h.in,v 1.5 2000/11/10 19:30:29 dbryson Exp $
2
3
Xbase project source code
4
5
This file contains a header file for the xbXBase class, which is the
6
base class for using the Xbase DBMS library.
7
8
Copyright (C) 1997 StarTech, Gary A. Kunkel
9
10
This library is free software; you can redistribute it and/or
11
modify it under the terms of the GNU Lesser General Public
12
License as published by the Free Software Foundation; either
13
version 2.1 of the License, or (at your option) any later version.
14
15
This library is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
Lesser General Public License for more details.
19
20
You should have received a copy of the GNU Lesser General Public
21
License along with this library; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
24
Contact:
25
26
Mail:
27
28
Technology Associates, Inc.
29
XBase Project
30
1455 Deming Way #11
31
Sparks, NV 89434
32
USA
33
34
Email:
35
36
xbase@techass.com
37
38
See our website at:
39
40
xdb.sourceforge.net
41
42
43
V 1.0 10/10/97 - Initial release of software
44
V 1.5 1/2/98 - Added memo field support
45
V 1.6a 4/1/98 - Added expression support
46
V 1.6b 4/8/98 - Numeric index keys
47
V 1.8.0a 1/27/99 - Added DisplayError method
48
*/
49
50
#ifndef __XB_XBASE_H__
51
#define __XB_XBASE_H__
52
53
#ifdef __GNUG__
54
#pragma interface
55
#endif
56
57
#ifdef __WIN32__
58
#include "
xbase/xbconfigw32.h
"
59
#else
60
#include "
xbase/xbconfig.h
"
61
#endif
62
63
//
64
// Identify ourselves
65
//
66
#define XDB_VERSION "2.0.0"
67
#define XBASE_VERSION "2.0.0"
68
69
#include <string.h>
70
71
#if defined(__WIN32__)
72
73
#include "windows.h"
74
75
// ripped from wxWindows
76
77
// _declspec works in BC++ 5 and later, as well as VC++
78
#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__)
79
# ifdef XBMAKINGDLL
80
# define XBDLLEXPORT __declspec( dllexport )
81
# define XBDLLEXPORT_DATA(type) __declspec( dllexport ) type
82
# define XBDLLEXPORT_CTORFN
83
# elif defined(XBUSINGDLL)
84
# define XBDLLEXPORT __declspec( dllimport )
85
# define XBDLLEXPORT_DATA(type) __declspec( dllimport ) type
86
# define XBDLLEXPORT_CTORFN
87
# else
88
# define XBDLLEXPORT
89
# define XBDLLEXPORT_DATA(type) type
90
# define XBDLLEXPORT_CTORFN
91
# endif
92
93
#else
94
95
# define XBDLLEXPORT
96
# define XBDLLEXPORT_DATA(type) type
97
# define XBDLLEXPORT_CTORFN
98
#endif
99
100
#else // !Windows
101
# define XBDLLEXPORT
102
# define XBDLLEXPORT_DATA(type) type
103
# define XBDLLEXPORT_CTORFN
104
#endif // Win/!Win
105
106
#include <
xbase/xtypes.h
>
107
#include <
xbase/retcodes.h
>
108
#include <
xbase/xdate.h
>
109
110
#include <
xbase/xbstring.h
>
111
112
#if defined(XB_EXPRESSIONS)
113
#include <
xbase/exp.h
>
114
#endif
115
119
class
XBDLLEXPORT
xbDbf
;
120
122
125
struct
XBDLLEXPORT
xbDbList
{
126
xbDbList
*
NextDbf
;
127
char
*
DbfName
;
128
xbDbf
*
dbf
;
129
};
130
132
135
#if defined(XB_EXPRESSIONS)
136
class
XBDLLEXPORT
xbXBase
:
public
xbExpn {
137
#else
138
class
XBDLLEXPORT
xbXBase
:
public
xbDate
{
139
#endif
140
141
protected
:
142
xbDbList
*
DbfList
;
143
xbDbList
*
FreeDbfList
;
144
xbShort
EndianType
;
/* B = Big Endian, L = Little Endian */
145
146
public
:
147
~
xbXBase
();
148
xbXBase
();
149
xbShort
AddDbfToDbfList(
xbDbf
*d,
const
char
*DatabaseName);
150
xbDbf
* GetDbfPtr(
const
char
*Name );
151
xbShort
DirectoryExistsInName(
const
char
*Name );
152
xbShort
GetEndianType
(
void
) {
return
EndianType; }
153
void
DisplayError(
const
xbShort
ErrorCode )
const
;
154
static
const
char
* GetErrorMessage(
const
xbShort
ErrorNo );
155
156
/* next 6 routines handle both big endian and little endian machines */
157
xbDouble
GetDouble(
const
char
*p );
158
xbLong
GetLong (
const
char
*p );
159
xbULong
GetULong (
const
char
*p );
160
xbShort
GetShort (
const
char
*p );
161
void
PutLong (
char
*p,
const
xbLong
l );
162
void
PutShort (
char
*p,
const
xbShort
s );
163
void
PutULong (
char
*p,
const
xbULong
l );
164
void
PutUShort(
char
*p,
const
xbUShort
s );
165
void
PutDouble(
char
*p,
const
xbDouble
d );
166
167
xbShort
RemoveDbfFromDbfList(
xbDbf
* );
168
};
169
170
#include <
xbase/dbf.h
>
171
172
#if defined(XB_INDEX_ANY)
173
#include <
xbase/index.h
>
174
#endif
175
176
#ifdef XB_INDEX_NDX
177
#include <
xbase/ndx.h
>
178
#endif
179
180
#ifdef XB_INDEX_NTX
181
#include <
xbase/ntx.h
>
182
#endif
183
184
#if defined(XB_FILTERS) && !defined(XB_INDEX_ANY)
185
#error XB_FILTERS cant be used without index support
186
#elif defined(XB_FILTERS)
187
#include <
xbase/xbfilter.h
>
188
#endif
189
190
#ifdef XB_LOCKING_ON
191
192
#ifdef HAVE_FCNTL_H
193
#include <fcntl.h>
194
#endif
195
196
#ifdef HAVE_SYS_LOCKING_H
197
#include <sys/locking.h>
198
#define F_SETLKW 0
199
#define F_SETLK 1
200
#define F_RDLCK 2
201
#define F_WRLCK 3
202
#define F_UNLCK 4
203
#endif
204
205
#else
206
enum
{
F_SETLKW
= 0,
F_WRLCK
= 0 };
207
#endif
208
209
#ifdef XB_HTML
210
#include <
xbase/html.h
>
211
#endif
212
213
#endif // __XB_XBASE_H__
Generated by
1.8.2