1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Make the OsFile structure opaque with its internal structure known only to

the appropriate os_*.c implementation.  Omit the os_unix.h and os_win.h
include files.  The crash tests are broken by this patch. (CVS 2791)

FossilOrigin-Name: 058f31753871b16b40fe4048e3adcee411e0f87d
This commit is contained in:
drh
2005-11-29 03:13:21 +00:00
parent 9267bdcecd
commit 9cbe635219
14 changed files with 455 additions and 285 deletions

View File

@@ -43,24 +43,17 @@
#endif
/*
** Invoke the appropriate operating-system specific header file.
** The OsFile object describes an open disk file in an OS-dependent way.
*/
#if OS_ALT
# include "os_alt.h"
#endif
#if OS_UNIX
# include "os_unix.h"
#endif
#if OS_WIN
# include "os_win.h"
#endif
typedef struct OsFile OsFile;
/* os_other.c and os_other.h are not delivered with SQLite. These files
** are place-holders that can be filled in by third-party developers to
** implement backends to their on proprietary operating systems.
/*
** Define the maximum size of a temporary filename
*/
#if OS_OTHER
# include "os_other.h"
#if OS_WIN
# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
#else
# define SQLITE_TEMPNAME_SIZE 200
#endif
/* If the SET_FULLSYNC macro is not defined above, then make it
@@ -179,14 +172,14 @@ extern unsigned int sqlite3_pending_byte;
extern struct sqlite3IoVtbl {
int (*xDelete)(const char*);
int (*xFileExists)(const char*);
int (*xOpenReadWrite)(const char*, OsFile*, int*);
int (*xOpenExclusive)(const char*, OsFile*, int);
int (*xOpenReadOnly)(const char*, OsFile*);
int (*xOpenReadWrite)(const char*, OsFile**, int*);
int (*xOpenExclusive)(const char*, OsFile**, int);
int (*xOpenReadOnly)(const char*, OsFile**);
int (*xOpenDirectory)(const char*, OsFile*);
int (*xSyncDirectory)(const char*);
int (*xTempFileName)(char*);
int (*xIsDirWritable)(char*);
int (*xClose)(OsFile*);
int (*xClose)(OsFile**);
int (*xRead)(OsFile*, void*, int amt);
int (*xWrite)(OsFile*, const void*, int amt);
int (*xSeek)(OsFile*, i64 offset);
@@ -197,7 +190,9 @@ extern struct sqlite3IoVtbl {
int (*xLock)(OsFile*, int);
int (*xUnlock)(OsFile*, int);
int (*xCheckReservedLock)(OsFile *id);
void (*xCopyOsFile)(OsFile *pDest, OsFile *pSrc);
void (*xSetFullSync)(OsFile *id, int setting);
int (*xFileHandle)(OsFile *id);
int (*xLockState)(OsFile *id);
} sqlite3Io;
/* The interface for file I/O is above. Other miscellaneous functions