~ubuntu-branches/ubuntu/maverick/sqlite3/maverick-updates

« back to all changes in this revision

Viewing changes to src/os.h

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2008-10-01 20:16:18 UTC
  • mfrom: (3.1.20 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081001201618-yfvqqj1qs29wdtcc
Tags: 3.5.9-5
Backport fix for distinct on indexes (closes: #500792).

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
** This header file (together with is companion C source-code file
14
14
** "os.c") attempt to abstract the underlying operating system so that
15
15
** the SQLite library will work on both POSIX and windows systems.
 
16
**
 
17
** This header file is #include-ed by sqliteInt.h and thus ends up
 
18
** being included by every source file.
16
19
*/
17
20
#ifndef _SQLITE_OS_H_
18
21
#define _SQLITE_OS_H_
19
22
 
20
23
/*
21
24
** Figure out if we are dealing with Unix, Windows, or some other
22
 
** operating system.
 
25
** operating system.  After the following block of preprocess macros,
 
26
** all of OS_UNIX, OS_WIN, OS_OS2, and OS_OTHER will defined to either
 
27
** 1 or 0.  One of the four will be 1.  The other three will be 0.
23
28
*/
 
29
#if defined(OS_OTHER)
 
30
# if OS_OTHER==1
 
31
#   undef OS_UNIX
 
32
#   define OS_UNIX 0
 
33
#   undef OS_WIN
 
34
#   define OS_WIN 0
 
35
#   undef OS_OS2
 
36
#   define OS_OS2 0
 
37
# else
 
38
#   undef OS_OTHER
 
39
# endif
 
40
#endif
24
41
#if !defined(OS_UNIX) && !defined(OS_OTHER)
25
42
# define OS_OTHER 0
26
43
# ifndef OS_WIN
28
45
#     define OS_WIN 1
29
46
#     define OS_UNIX 0
30
47
#     define OS_OS2 0
31
 
#   elif defined(_EMX_) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
 
48
#   elif defined(__EMX__) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
32
49
#     define OS_WIN 0
33
50
#     define OS_UNIX 0
34
51
#     define OS_OS2 1
48
65
#endif
49
66
 
50
67
 
 
68
 
51
69
/*
52
70
** Define the maximum size of a temporary filename
53
71
*/
55
73
# include <windows.h>
56
74
# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
57
75
#elif OS_OS2
 
76
# if (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3) && defined(OS2_HIGH_MEMORY)
 
77
#  include <os2safe.h> /* has to be included before os2.h for linking to work */
 
78
# endif
58
79
# define INCL_DOSDATETIME
59
80
# define INCL_DOSFILEMGR
60
81
# define INCL_DOSERRORS
61
82
# define INCL_DOSMISC
62
83
# define INCL_DOSPROCESS
 
84
# define INCL_DOSMODULEMGR
 
85
# define INCL_DOSSEMAPHORES
63
86
# include <os2.h>
 
87
# include <uconv.h>
64
88
# define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
65
89
#else
66
90
# define SQLITE_TEMPNAME_SIZE 200
74
98
#endif
75
99
 
76
100
/*
 
101
** The default size of a disk sector
 
102
*/
 
103
#ifndef SQLITE_DEFAULT_SECTOR_SIZE
 
104
# define SQLITE_DEFAULT_SECTOR_SIZE 512
 
105
#endif
 
106
 
 
107
/*
77
108
** Temporary files are named starting with this prefix followed by 16 random
78
109
** alphanumeric characters, and no file extension. They are stored in the
79
110
** OS's standard temporary file directory, and are deleted prior to exit.
80
111
** If sqlite is being embedded in another program, you may wish to change the
81
112
** prefix to reflect your program's name, so that if your program exits
82
113
** prematurely, old temporary files can be easily identified. This can be done
83
 
** using -DTEMP_FILE_PREFIX=myprefix_ on the compiler command line.
84
 
*/
85
 
#ifndef TEMP_FILE_PREFIX
86
 
# define TEMP_FILE_PREFIX "sqlite_"
87
 
#endif
88
 
 
89
 
/*
90
 
** Define the interfaces for Unix, Windows, and OS/2.
91
 
*/
92
 
#if OS_UNIX
93
 
#define sqlite3OsOpenReadWrite      sqlite3UnixOpenReadWrite
94
 
#define sqlite3OsOpenExclusive      sqlite3UnixOpenExclusive
95
 
#define sqlite3OsOpenReadOnly       sqlite3UnixOpenReadOnly
96
 
#define sqlite3OsDelete             sqlite3UnixDelete
97
 
#define sqlite3OsFileExists         sqlite3UnixFileExists
98
 
#define sqlite3OsFullPathname       sqlite3UnixFullPathname
99
 
#define sqlite3OsIsDirWritable      sqlite3UnixIsDirWritable
100
 
#define sqlite3OsSyncDirectory      sqlite3UnixSyncDirectory
101
 
#define sqlite3OsTempFileName       sqlite3UnixTempFileName
102
 
#define sqlite3OsRandomSeed         sqlite3UnixRandomSeed
103
 
#define sqlite3OsSleep              sqlite3UnixSleep
104
 
#define sqlite3OsCurrentTime        sqlite3UnixCurrentTime
105
 
#define sqlite3OsEnterMutex         sqlite3UnixEnterMutex
106
 
#define sqlite3OsLeaveMutex         sqlite3UnixLeaveMutex
107
 
#define sqlite3OsInMutex            sqlite3UnixInMutex
108
 
#define sqlite3OsThreadSpecificData sqlite3UnixThreadSpecificData
109
 
#define sqlite3OsMalloc             sqlite3GenericMalloc
110
 
#define sqlite3OsRealloc            sqlite3GenericRealloc
111
 
#define sqlite3OsFree               sqlite3GenericFree
112
 
#define sqlite3OsAllocationSize     sqlite3GenericAllocationSize
113
 
#endif
114
 
#if OS_WIN
115
 
#define sqlite3OsOpenReadWrite      sqlite3WinOpenReadWrite
116
 
#define sqlite3OsOpenExclusive      sqlite3WinOpenExclusive
117
 
#define sqlite3OsOpenReadOnly       sqlite3WinOpenReadOnly
118
 
#define sqlite3OsDelete             sqlite3WinDelete
119
 
#define sqlite3OsFileExists         sqlite3WinFileExists
120
 
#define sqlite3OsFullPathname       sqlite3WinFullPathname
121
 
#define sqlite3OsIsDirWritable      sqlite3WinIsDirWritable
122
 
#define sqlite3OsSyncDirectory      sqlite3WinSyncDirectory
123
 
#define sqlite3OsTempFileName       sqlite3WinTempFileName
124
 
#define sqlite3OsRandomSeed         sqlite3WinRandomSeed
125
 
#define sqlite3OsSleep              sqlite3WinSleep
126
 
#define sqlite3OsCurrentTime        sqlite3WinCurrentTime
127
 
#define sqlite3OsEnterMutex         sqlite3WinEnterMutex
128
 
#define sqlite3OsLeaveMutex         sqlite3WinLeaveMutex
129
 
#define sqlite3OsInMutex            sqlite3WinInMutex
130
 
#define sqlite3OsThreadSpecificData sqlite3WinThreadSpecificData
131
 
#define sqlite3OsMalloc             sqlite3GenericMalloc
132
 
#define sqlite3OsRealloc            sqlite3GenericRealloc
133
 
#define sqlite3OsFree               sqlite3GenericFree
134
 
#define sqlite3OsAllocationSize     sqlite3GenericAllocationSize
135
 
#endif
136
 
#if OS_OS2
137
 
#define sqlite3OsOpenReadWrite      sqlite3Os2OpenReadWrite
138
 
#define sqlite3OsOpenExclusive      sqlite3Os2OpenExclusive
139
 
#define sqlite3OsOpenReadOnly       sqlite3Os2OpenReadOnly
140
 
#define sqlite3OsDelete             sqlite3Os2Delete
141
 
#define sqlite3OsFileExists         sqlite3Os2FileExists
142
 
#define sqlite3OsFullPathname       sqlite3Os2FullPathname
143
 
#define sqlite3OsIsDirWritable      sqlite3Os2IsDirWritable
144
 
#define sqlite3OsSyncDirectory      sqlite3Os2SyncDirectory
145
 
#define sqlite3OsTempFileName       sqlite3Os2TempFileName
146
 
#define sqlite3OsRandomSeed         sqlite3Os2RandomSeed
147
 
#define sqlite3OsSleep              sqlite3Os2Sleep
148
 
#define sqlite3OsCurrentTime        sqlite3Os2CurrentTime
149
 
#define sqlite3OsEnterMutex         sqlite3Os2EnterMutex
150
 
#define sqlite3OsLeaveMutex         sqlite3Os2LeaveMutex
151
 
#define sqlite3OsInMutex            sqlite3Os2InMutex
152
 
#define sqlite3OsThreadSpecificData sqlite3Os2ThreadSpecificData
153
 
#define sqlite3OsMalloc             sqlite3GenericMalloc
154
 
#define sqlite3OsRealloc            sqlite3GenericRealloc
155
 
#define sqlite3OsFree               sqlite3GenericFree
156
 
#define sqlite3OsAllocationSize     sqlite3GenericAllocationSize
157
 
#endif
158
 
 
159
 
 
160
 
 
161
 
 
162
 
/*
163
 
** If using an alternative OS interface, then we must have an "os_other.h"
164
 
** header file available for that interface.  Presumably the "os_other.h"
165
 
** header file contains #defines similar to those above.
166
 
*/
167
 
#if OS_OTHER
168
 
# include "os_other.h"
169
 
#endif
170
 
 
171
 
 
172
 
 
173
 
/*
174
 
** Forward declarations
175
 
*/
176
 
typedef struct OsFile OsFile;
177
 
typedef struct IoMethod IoMethod;
178
 
 
179
 
/*
180
 
** An instance of the following structure contains pointers to all
181
 
** methods on an OsFile object.
182
 
*/
183
 
struct IoMethod {
184
 
  int (*xClose)(OsFile**);
185
 
  int (*xOpenDirectory)(OsFile*, const char*);
186
 
  int (*xRead)(OsFile*, void*, int amt);
187
 
  int (*xWrite)(OsFile*, const void*, int amt);
188
 
  int (*xSeek)(OsFile*, i64 offset);
189
 
  int (*xTruncate)(OsFile*, i64 size);
190
 
  int (*xSync)(OsFile*, int);
191
 
  void (*xSetFullSync)(OsFile *id, int setting);
192
 
  int (*xFileHandle)(OsFile *id);
193
 
  int (*xFileSize)(OsFile*, i64 *pSize);
194
 
  int (*xLock)(OsFile*, int);
195
 
  int (*xUnlock)(OsFile*, int);
196
 
  int (*xLockState)(OsFile *id);
197
 
  int (*xCheckReservedLock)(OsFile *id);
198
 
};
199
 
 
200
 
/*
201
 
** The OsFile object describes an open disk file in an OS-dependent way.
202
 
** The version of OsFile defined here is a generic version.  Each OS
203
 
** implementation defines its own subclass of this structure that contains
204
 
** additional information needed to handle file I/O.  But the pMethod
205
 
** entry (pointing to the virtual function table) always occurs first
206
 
** so that we can always find the appropriate methods.
207
 
*/
208
 
struct OsFile {
209
 
  IoMethod const *pMethod;
210
 
};
 
114
** using -DSQLITE_TEMP_FILE_PREFIX=myprefix_ on the compiler command line.
 
115
**
 
116
** 2006-10-31:  The default prefix used to be "sqlite_".  But then
 
117
** Mcafee started using SQLite in their anti-virus product and it
 
118
** started putting files with the "sqlite" name in the c:/temp folder.
 
119
** This annoyed many windows users.  Those users would then do a 
 
120
** Google search for "sqlite", find the telephone numbers of the
 
121
** developers and call to wake them up at night and complain.
 
122
** For this reason, the default name prefix is changed to be "sqlite" 
 
123
** spelled backwards.  So the temp files are still identified, but
 
124
** anybody smart enough to figure out the code is also likely smart
 
125
** enough to know that calling the developer will not help get rid
 
126
** of the file.
 
127
*/
 
128
#ifndef SQLITE_TEMP_FILE_PREFIX
 
129
# define SQLITE_TEMP_FILE_PREFIX "etilqs_"
 
130
#endif
211
131
 
212
132
/*
213
133
** The following values may be passed as the second argument to
300
220
#define SHARED_FIRST      (PENDING_BYTE+2)
301
221
#define SHARED_SIZE       510
302
222
 
303
 
/*
304
 
** Prototypes for operating system interface routines.
305
 
*/
306
 
int sqlite3OsClose(OsFile**);
307
 
int sqlite3OsOpenDirectory(OsFile*, const char*);
308
 
int sqlite3OsRead(OsFile*, void*, int amt);
309
 
int sqlite3OsWrite(OsFile*, const void*, int amt);
310
 
int sqlite3OsSeek(OsFile*, i64 offset);
311
 
int sqlite3OsTruncate(OsFile*, i64 size);
312
 
int sqlite3OsSync(OsFile*, int);
313
 
void sqlite3OsSetFullSync(OsFile *id, int setting);
314
 
int sqlite3OsFileHandle(OsFile *id);
315
 
int sqlite3OsFileSize(OsFile*, i64 *pSize);
316
 
int sqlite3OsLock(OsFile*, int);
317
 
int sqlite3OsUnlock(OsFile*, int);
318
 
int sqlite3OsLockState(OsFile *id);
319
 
int sqlite3OsCheckReservedLock(OsFile *id);
320
 
int sqlite3OsOpenReadWrite(const char*, OsFile**, int*);
321
 
int sqlite3OsOpenExclusive(const char*, OsFile**, int);
322
 
int sqlite3OsOpenReadOnly(const char*, OsFile**);
323
 
int sqlite3OsDelete(const char*);
324
 
int sqlite3OsFileExists(const char*);
325
 
char *sqlite3OsFullPathname(const char*);
326
 
int sqlite3OsIsDirWritable(char*);
327
 
int sqlite3OsSyncDirectory(const char*);
328
 
int sqlite3OsTempFileName(char*);
329
 
int sqlite3OsRandomSeed(char*);
330
 
int sqlite3OsSleep(int ms);
331
 
int sqlite3OsCurrentTime(double*);
332
 
void sqlite3OsEnterMutex(void);
333
 
void sqlite3OsLeaveMutex(void);
334
 
int sqlite3OsInMutex(int);
335
 
ThreadData *sqlite3OsThreadSpecificData(int);
336
 
void *sqlite3OsMalloc(int);
337
 
void *sqlite3OsRealloc(void *, int);
338
 
void sqlite3OsFree(void *);
339
 
int sqlite3OsAllocationSize(void *);
340
 
 
341
 
/*
342
 
** If the SQLITE_ENABLE_REDEF_IO macro is defined, then the OS-layer
343
 
** interface routines are not called directly but are invoked using
344
 
** pointers to functions.  This allows the implementation of various
345
 
** OS-layer interface routines to be modified at run-time.  There are
346
 
** obscure but legitimate reasons for wanting to do this.  But for
347
 
** most users, a direct call to the underlying interface is preferable
348
 
** so the the redefinable I/O interface is turned off by default.
349
 
*/
350
 
#ifdef SQLITE_ENABLE_REDEF_IO
351
 
 
352
 
/*
353
 
** When redefinable I/O is enabled, a single global instance of the
354
 
** following structure holds pointers to the routines that SQLite 
355
 
** uses to talk with the underlying operating system.  Modify this
356
 
** structure (before using any SQLite API!) to accomodate perculiar
357
 
** operating system interfaces or behaviors.
358
 
*/
359
 
struct sqlite3OsVtbl {
360
 
  int (*xOpenReadWrite)(const char*, OsFile**, int*);
361
 
  int (*xOpenExclusive)(const char*, OsFile**, int);
362
 
  int (*xOpenReadOnly)(const char*, OsFile**);
363
 
 
364
 
  int (*xDelete)(const char*);
365
 
  int (*xFileExists)(const char*);
366
 
  char *(*xFullPathname)(const char*);
367
 
  int (*xIsDirWritable)(char*);
368
 
  int (*xSyncDirectory)(const char*);
369
 
  int (*xTempFileName)(char*);
370
 
 
371
 
  int (*xRandomSeed)(char*);
372
 
  int (*xSleep)(int ms);
373
 
  int (*xCurrentTime)(double*);
374
 
 
375
 
  void (*xEnterMutex)(void);
376
 
  void (*xLeaveMutex)(void);
377
 
  int (*xInMutex)(int);
378
 
  ThreadData *(*xThreadSpecificData)(int);
379
 
 
380
 
  void *(*xMalloc)(int);
381
 
  void *(*xRealloc)(void *, int);
382
 
  void (*xFree)(void *);
383
 
  int (*xAllocationSize)(void *);
384
 
};
385
 
 
386
 
/* Macro used to comment out routines that do not exists when there is
387
 
** no disk I/O 
388
 
*/
389
 
#ifdef SQLITE_OMIT_DISKIO
390
 
# define IF_DISKIO(X)  0
391
 
#else
392
 
# define IF_DISKIO(X)  X
393
 
#endif
394
 
 
395
 
#ifdef _SQLITE_OS_C_
396
 
  /*
397
 
  ** The os.c file implements the global virtual function table.
398
 
  */
399
 
  struct sqlite3OsVtbl sqlite3Os = {
400
 
    IF_DISKIO( sqlite3OsOpenReadWrite ),
401
 
    IF_DISKIO( sqlite3OsOpenExclusive ),
402
 
    IF_DISKIO( sqlite3OsOpenReadOnly ),
403
 
    IF_DISKIO( sqlite3OsDelete ),
404
 
    IF_DISKIO( sqlite3OsFileExists ),
405
 
    IF_DISKIO( sqlite3OsFullPathname ),
406
 
    IF_DISKIO( sqlite3OsIsDirWritable ),
407
 
    IF_DISKIO( sqlite3OsSyncDirectory ),
408
 
    IF_DISKIO( sqlite3OsTempFileName ),
409
 
    sqlite3OsRandomSeed,
410
 
    sqlite3OsSleep,
411
 
    sqlite3OsCurrentTime,
412
 
    sqlite3OsEnterMutex,
413
 
    sqlite3OsLeaveMutex,
414
 
    sqlite3OsInMutex,
415
 
    sqlite3OsThreadSpecificData,
416
 
    sqlite3OsMalloc,
417
 
    sqlite3OsRealloc,
418
 
    sqlite3OsFree,
419
 
    sqlite3OsAllocationSize
420
 
  };
421
 
#else
422
 
  /*
423
 
  ** Files other than os.c just reference the global virtual function table. 
424
 
  */
425
 
  extern struct sqlite3OsVtbl sqlite3Os;
426
 
#endif /* _SQLITE_OS_C_ */
427
 
 
428
 
 
429
 
/* This additional API routine is available with redefinable I/O */
430
 
struct sqlite3OsVtbl *sqlite3_os_switch(void);
431
 
 
432
 
 
433
 
/*
434
 
** Redefine the OS interface to go through the virtual function table
435
 
** rather than calling routines directly.
436
 
*/
437
 
#undef sqlite3OsOpenReadWrite
438
 
#undef sqlite3OsOpenExclusive
439
 
#undef sqlite3OsOpenReadOnly
440
 
#undef sqlite3OsDelete
441
 
#undef sqlite3OsFileExists
442
 
#undef sqlite3OsFullPathname
443
 
#undef sqlite3OsIsDirWritable
444
 
#undef sqlite3OsSyncDirectory
445
 
#undef sqlite3OsTempFileName
446
 
#undef sqlite3OsRandomSeed
447
 
#undef sqlite3OsSleep
448
 
#undef sqlite3OsCurrentTime
449
 
#undef sqlite3OsEnterMutex
450
 
#undef sqlite3OsLeaveMutex
451
 
#undef sqlite3OsInMutex
452
 
#undef sqlite3OsThreadSpecificData
453
 
#undef sqlite3OsMalloc
454
 
#undef sqlite3OsRealloc
455
 
#undef sqlite3OsFree
456
 
#undef sqlite3OsAllocationSize
457
 
#define sqlite3OsOpenReadWrite      sqlite3Os.xOpenReadWrite
458
 
#define sqlite3OsOpenExclusive      sqlite3Os.xOpenExclusive
459
 
#define sqlite3OsOpenReadOnly       sqlite3Os.xOpenReadOnly
460
 
#define sqlite3OsDelete             sqlite3Os.xDelete
461
 
#define sqlite3OsFileExists         sqlite3Os.xFileExists
462
 
#define sqlite3OsFullPathname       sqlite3Os.xFullPathname
463
 
#define sqlite3OsIsDirWritable      sqlite3Os.xIsDirWritable
464
 
#define sqlite3OsSyncDirectory      sqlite3Os.xSyncDirectory
465
 
#define sqlite3OsTempFileName       sqlite3Os.xTempFileName
466
 
#define sqlite3OsRandomSeed         sqlite3Os.xRandomSeed
467
 
#define sqlite3OsSleep              sqlite3Os.xSleep
468
 
#define sqlite3OsCurrentTime        sqlite3Os.xCurrentTime
469
 
#define sqlite3OsEnterMutex         sqlite3Os.xEnterMutex
470
 
#define sqlite3OsLeaveMutex         sqlite3Os.xLeaveMutex
471
 
#define sqlite3OsInMutex            sqlite3Os.xInMutex
472
 
#define sqlite3OsThreadSpecificData sqlite3Os.xThreadSpecificData
473
 
#define sqlite3OsMalloc             sqlite3Os.xMalloc
474
 
#define sqlite3OsRealloc            sqlite3Os.xRealloc
475
 
#define sqlite3OsFree               sqlite3Os.xFree
476
 
#define sqlite3OsAllocationSize     sqlite3Os.xAllocationSize
477
 
 
478
 
#endif /* SQLITE_ENABLE_REDEF_IO */
 
223
/* 
 
224
** Functions for accessing sqlite3_file methods 
 
225
*/
 
226
int sqlite3OsClose(sqlite3_file*);
 
227
int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
 
228
int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
 
229
int sqlite3OsTruncate(sqlite3_file*, i64 size);
 
230
int sqlite3OsSync(sqlite3_file*, int);
 
231
int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
 
232
int sqlite3OsLock(sqlite3_file*, int);
 
233
int sqlite3OsUnlock(sqlite3_file*, int);
 
234
int sqlite3OsCheckReservedLock(sqlite3_file *id);
 
235
int sqlite3OsFileControl(sqlite3_file*,int,void*);
 
236
int sqlite3OsSectorSize(sqlite3_file *id);
 
237
int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
 
238
 
 
239
/* 
 
240
** Functions for accessing sqlite3_vfs methods 
 
241
*/
 
242
int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
 
243
int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
 
244
int sqlite3OsAccess(sqlite3_vfs *, const char *, int);
 
245
int sqlite3OsGetTempname(sqlite3_vfs *, int, char *);
 
246
int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
 
247
void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
 
248
void sqlite3OsDlError(sqlite3_vfs *, int, char *);
 
249
void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *);
 
250
void sqlite3OsDlClose(sqlite3_vfs *, void *);
 
251
int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
 
252
int sqlite3OsSleep(sqlite3_vfs *, int);
 
253
int sqlite3OsCurrentTime(sqlite3_vfs *, double*);
 
254
 
 
255
/*
 
256
** Convenience functions for opening and closing files using 
 
257
** sqlite3_malloc() to obtain space for the file-handle structure.
 
258
*/
 
259
int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
 
260
int sqlite3OsCloseFree(sqlite3_file *);
 
261
 
 
262
/*
 
263
** Each OS-specific backend defines an instance of the following
 
264
** structure for returning a pointer to its sqlite3_vfs.  If OS_OTHER
 
265
** is defined (meaning that the application-defined OS interface layer
 
266
** is used) then there is no default VFS.   The application must
 
267
** register one or more VFS structures using sqlite3_vfs_register()
 
268
** before attempting to use SQLite.
 
269
*/
 
270
sqlite3_vfs *sqlite3OsDefaultVfs(void);
479
271
 
480
272
#endif /* _SQLITE_OS_H_ */