blob: b9055acce8273fd02d6438d02a99b36cf5425544 [file] [log] [blame]
drhe3c41372001-09-17 20:25:58 +00001/*
2** 2001 September 16
3**
4** The author disclaims copyright to this source code. In place of
5** a legal notice, here is a blessing:
6**
7** May you do good and not evil.
8** May you find forgiveness for yourself and forgive others.
9** May you share freely, never taking more than you give.
10**
11******************************************************************************
12**
13** This header file (together with is companion C source-code file
14** "os.c") attempt to abstract the underlying operating system so that
15** the SQLite library will work on both POSIX and windows systems.
16*/
17#ifndef _SQLITE_OS_H_
18#define _SQLITE_OS_H_
19
20/*
21** A handle for an open file is stored in an OsFile object.
22*/
23#if OS_UNIX
24 typedef int OsFile;
25# define SQLITE_TEMPNAME_SIZE 200
26#endif
27
28#if OS_WIN
29 typedef HANDLE OsFile;
30# define SQLITE_TEMPNAME_SIZE (MAX_PATH+1)
31#endif
32
33int sqliteOsOpenReadWrite(char*, OsFile*, int*);
34int sqliteOsOpenExclusive(char*, OsFile*);
35int sqliteOsTempFileName(char*);
36int sqliteOsClose(OsFile);
37int sqliteOsRead(OsFile, int amt, void*);
38int sqliteOsWrite(OsFile, int amt, void*);
39int sqliteOsSeek(OsFile, int offset);
40int sqliteOsSync(OsFile);
41int sqliteOsTruncate(OsFile, int size);
42int sqliteOsFileSize(OsFile, int *pSize);
43int sqliteOsLock(OsFile, int wrlock);
44int sqliteOsUnlock(OsFile);
45int sqliteOsRandomSeed(int amt, char*);
46int sqliteSleep(int ms);
47
48
49
50#endif /* _SQLITE_OS_H_ */