engine/sqlite/src/os.h
author Sebastian Brannstrom <sebastianb@symbian.org>
Sat, 23 Oct 2010 17:11:38 +0100
branch3rded
changeset 278 e6aa20533d01
parent 2 29cda98b007e
permissions -rw-r--r--
Merged fix for 3843
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     1
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     2
** 2001 September 16
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     3
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     4
** The author disclaims copyright to this source code.  In place of
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     5
** a legal notice, here is a blessing:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     6
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     7
**    May you do good and not evil.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     8
**    May you find forgiveness for yourself and forgive others.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
     9
**    May you share freely, never taking more than you give.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    10
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    11
******************************************************************************
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    12
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    13
** This header file (together with is companion C source-code file
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    14
** "os.c") attempt to abstract the underlying operating system so that
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    15
** the SQLite library will work on both POSIX and windows systems.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    16
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    17
** This header file is #include-ed by sqliteInt.h and thus ends up
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    18
** being included by every source file.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    19
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    20
#ifndef _SQLITE_OS_H_
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    21
#define _SQLITE_OS_H_
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    22
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    23
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    24
** Figure out if we are dealing with Unix, Windows, or some other
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    25
** operating system.  After the following block of preprocess macros,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    26
** all of OS_UNIX, OS_WIN, OS_OS2, and OS_OTHER will defined to either
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    27
** 1 or 0.  One of the four will be 1.  The other three will be 0.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    28
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    29
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    30
#if defined(OS_OTHER)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    31
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    32
# if OS_OTHER==1
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    33
#   undef OS_UNIX
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    34
#   define OS_UNIX 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    35
#   undef OS_WIN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    36
#   define OS_WIN 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    37
#   undef OS_OS2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    38
#   define OS_OS2 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    39
# else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    40
#   undef OS_OTHER
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    41
# endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    42
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    43
#if !defined(OS_UNIX) && !defined(OS_OTHER) && !defined(OS_SYMBIAN)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    44
# define OS_OTHER 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    45
# ifndef OS_WIN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    46
#   if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    47
#     define OS_WIN 1
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    48
#     define OS_UNIX 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    49
#     define OS_OS2 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    50
#   elif defined(__EMX__) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    51
#     define OS_WIN 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    52
#     define OS_UNIX 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    53
#     define OS_OS2 1
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    54
#   else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    55
#     define OS_WIN 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    56
#     define OS_UNIX 1
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    57
#     define OS_OS2 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    58
#  endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    59
# else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    60
#  define OS_UNIX 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    61
#  define OS_OS2 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    62
# endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    63
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    64
# ifndef OS_WIN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    65
#  define OS_WIN 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    66
# endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    67
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    68
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    69
#ifdef OS_SYMBIAN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    70
# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    71
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    72
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    73
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    74
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    75
** Define the maximum size of a temporary filename
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    76
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    77
#if OS_WIN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    78
# include <windows.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    79
# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    80
#elif OS_OS2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    81
# if (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3) && defined(OS2_HIGH_MEMORY)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    82
#  include <os2safe.h> /* has to be included before os2.h for linking to work */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    83
# endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    84
# define INCL_DOSDATETIME
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    85
# define INCL_DOSFILEMGR
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    86
# define INCL_DOSERRORS
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    87
# define INCL_DOSMISC
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    88
# define INCL_DOSPROCESS
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    89
# define INCL_DOSMODULEMGR
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    90
# define INCL_DOSSEMAPHORES
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    91
# include <os2.h>
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    92
# define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    93
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    94
#ifndef SQLITE_TEMPNAME_SIZE 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    95
	# define SQLITE_TEMPNAME_SIZE 200 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    96
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    97
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    98
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
    99
/* If the SET_FULLSYNC macro is not defined above, then make it
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   100
** a no-op
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   101
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   102
#ifndef SET_FULLSYNC
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   103
# define SET_FULLSYNC(x,y)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   104
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   105
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   106
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   107
** The default size of a disk sector
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   108
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   109
#ifndef SQLITE_DEFAULT_SECTOR_SIZE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   110
# define SQLITE_DEFAULT_SECTOR_SIZE 512
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   111
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   112
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   113
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   114
** Temporary files are named starting with this prefix followed by 16 random
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   115
** alphanumeric characters, and no file extension. They are stored in the
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   116
** OS's standard temporary file directory, and are deleted prior to exit.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   117
** If sqlite is being embedded in another program, you may wish to change the
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   118
** prefix to reflect your program's name, so that if your program exits
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   119
** prematurely, old temporary files can be easily identified. This can be done
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   120
** using -DSQLITE_TEMP_FILE_PREFIX=myprefix_ on the compiler command line.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   121
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   122
** 2006-10-31:  The default prefix used to be "sqlite_".  But then
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   123
** Mcafee started using SQLite in their anti-virus product and it
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   124
** started putting files with the "sqlite" name in the c:/temp folder.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   125
** This annoyed many windows users.  Those users would then do a 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   126
** Google search for "sqlite", find the telephone numbers of the
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   127
** developers and call to wake them up at night and complain.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   128
** For this reason, the default name prefix is changed to be "sqlite" 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   129
** spelled backwards.  So the temp files are still identified, but
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   130
** anybody smart enough to figure out the code is also likely smart
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   131
** enough to know that calling the developer will not help get rid
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   132
** of the file.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   133
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   134
#ifndef SQLITE_TEMP_FILE_PREFIX
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   135
# define SQLITE_TEMP_FILE_PREFIX "etilqs_"
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   136
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   137
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   138
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   139
** The following values may be passed as the second argument to
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   140
** sqlite3OsLock(). The various locks exhibit the following semantics:
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   141
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   142
** SHARED:    Any number of processes may hold a SHARED lock simultaneously.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   143
** RESERVED:  A single process may hold a RESERVED lock on a file at
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   144
**            any time. Other processes may hold and obtain new SHARED locks.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   145
** PENDING:   A single process may hold a PENDING lock on a file at
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   146
**            any one time. Existing SHARED locks may persist, but no new
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   147
**            SHARED locks may be obtained by other processes.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   148
** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   149
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   150
** PENDING_LOCK may not be passed directly to sqlite3OsLock(). Instead, a
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   151
** process that requests an EXCLUSIVE lock may actually obtain a PENDING
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   152
** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   153
** sqlite3OsLock().
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   154
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   155
#define NO_LOCK         0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   156
#define SHARED_LOCK     1
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   157
#define RESERVED_LOCK   2
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   158
#define PENDING_LOCK    3
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   159
#define EXCLUSIVE_LOCK  4
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   160
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   161
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   162
** File Locking Notes:  (Mostly about windows but also some info for Unix)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   163
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   164
** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   165
** those functions are not available.  So we use only LockFile() and
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   166
** UnlockFile().
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   167
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   168
** LockFile() prevents not just writing but also reading by other processes.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   169
** A SHARED_LOCK is obtained by locking a single randomly-chosen 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   170
** byte out of a specific range of bytes. The lock byte is obtained at 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   171
** random so two separate readers can probably access the file at the 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   172
** same time, unless they are unlucky and choose the same lock byte.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   173
** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   174
** There can only be one writer.  A RESERVED_LOCK is obtained by locking
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   175
** a single byte of the file that is designated as the reserved lock byte.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   176
** A PENDING_LOCK is obtained by locking a designated byte different from
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   177
** the RESERVED_LOCK byte.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   178
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   179
** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available,
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   180
** which means we can use reader/writer locks.  When reader/writer locks
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   181
** are used, the lock is placed on the same range of bytes that is used
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   182
** for probabilistic locking in Win95/98/ME.  Hence, the locking scheme
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   183
** will support two or more Win95 readers or two or more WinNT readers.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   184
** But a single Win95 reader will lock out all WinNT readers and a single
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   185
** WinNT reader will lock out all other Win95 readers.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   186
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   187
** The following #defines specify the range of bytes used for locking.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   188
** SHARED_SIZE is the number of bytes available in the pool from which
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   189
** a random byte is selected for a shared lock.  The pool of bytes for
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   190
** shared locks begins at SHARED_FIRST. 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   191
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   192
** These #defines are available in sqlite_aux.h so that adaptors for
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   193
** connecting SQLite to other operating systems can use the same byte
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   194
** ranges for locking.  In particular, the same locking strategy and
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   195
** byte ranges are used for Unix.  This leaves open the possiblity of having
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   196
** clients on win95, winNT, and unix all talking to the same shared file
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   197
** and all locking correctly.  To do so would require that samba (or whatever
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   198
** tool is being used for file sharing) implements locks correctly between
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   199
** windows and unix.  I'm guessing that isn't likely to happen, but by
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   200
** using the same locking range we are at least open to the possibility.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   201
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   202
** Locking in windows is manditory.  For this reason, we cannot store
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   203
** actual data in the bytes used for locking.  The pager never allocates
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   204
** the pages involved in locking therefore.  SHARED_SIZE is selected so
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   205
** that all locks will fit on a single page even at the minimum page size.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   206
** PENDING_BYTE defines the beginning of the locks.  By default PENDING_BYTE
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   207
** is set high so that we don't have to allocate an unused page except
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   208
** for very large databases.  But one should test the page skipping logic 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   209
** by setting PENDING_BYTE low and running the entire regression suite.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   210
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   211
** Changing the value of PENDING_BYTE results in a subtly incompatible
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   212
** file format.  Depending on how it is changed, you might not notice
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   213
** the incompatibility right away, even running a full regression test.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   214
** The default location of PENDING_BYTE is the first byte past the
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   215
** 1GB boundary.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   216
**
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   217
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   218
#ifndef SQLITE_TEST
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   219
#define PENDING_BYTE      0x40000000  /* First byte past the 1GB boundary */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   220
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   221
extern unsigned int sqlite3_pending_byte;
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   222
#define PENDING_BYTE sqlite3_pending_byte
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   223
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   224
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   225
#define RESERVED_BYTE     (PENDING_BYTE+1)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   226
#define SHARED_FIRST      (PENDING_BYTE+2)
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   227
#define SHARED_SIZE       510
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   228
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   229
/* 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   230
** Functions for accessing sqlite3_file methods 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   231
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   232
int sqlite3OsClose(sqlite3_file*);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   233
int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   234
int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   235
int sqlite3OsTruncate(sqlite3_file*, i64 size);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   236
int sqlite3OsSync(sqlite3_file*, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   237
int sqlite3OsFileSize(sqlite3_file*, i64 *pSize);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   238
int sqlite3OsLock(sqlite3_file*, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   239
int sqlite3OsUnlock(sqlite3_file*, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   240
int sqlite3OsCheckReservedLock(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   241
int sqlite3OsFileControl(sqlite3_file*,int,void*);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   242
int sqlite3OsSectorSize(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   243
int sqlite3OsDeviceCharacteristics(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   244
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   245
/* 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   246
** Functions for accessing sqlite3_vfs methods 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   247
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   248
int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   249
int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   250
int sqlite3OsAccess(sqlite3_vfs *, const char *, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   251
int sqlite3OsGetTempname(sqlite3_vfs *, int, char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   252
int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   253
void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   254
void sqlite3OsDlError(sqlite3_vfs *, int, char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   255
void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   256
void sqlite3OsDlClose(sqlite3_vfs *, void *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   257
int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   258
int sqlite3OsSleep(sqlite3_vfs *, int);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   259
int sqlite3OsCurrentTime(sqlite3_vfs *, double*);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   260
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   261
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   262
** Convenience functions for opening and closing files using 
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   263
** sqlite3_malloc() to obtain space for the file-handle structure.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   264
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   265
int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   266
int sqlite3OsCloseFree(sqlite3_file *);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   267
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   268
/*
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   269
** Each OS-specific backend defines an instance of the following
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   270
** structure for returning a pointer to its sqlite3_vfs.  If OS_OTHER
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   271
** is defined (meaning that the application-defined OS interface layer
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   272
** is used) then there is no default VFS.   The application must
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   273
** register one or more VFS structures using sqlite3_vfs_register()
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   274
** before attempting to use SQLite.
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   275
*/
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   276
#if OS_UNIX || OS_WIN || OS_OS2 ||  OS_SYMBIAN
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   277
sqlite3_vfs *sqlite3OsDefaultVfs(void);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   278
#else
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   279
# define sqlite3OsDefaultVfs(X) 0
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   280
#endif
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   281
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   282
 int winDelete(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   283
  sqlite3_vfs *pVfs,          /* Not used on win32 */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   284
  const char *zFilename,      /* Name of file to delete */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   285
  int syncDir                 /* Not used on win32 */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   286
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   287
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   288
 int winAccess(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   289
  sqlite3_vfs *pVfs,         /* Not used on win32 */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   290
  const char *zFilename,     /* Name of file to check */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   291
  int flags                  /* Type of test to make on this file */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   292
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   293
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   294
 int winGetTempname(sqlite3_vfs *pVfs, int nBuf, char *zBuf);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   295
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   296
 int winFullPathname(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   297
  sqlite3_vfs *pVfs,            /* Pointer to vfs object */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   298
  const char *zRelative,        /* Possibly relative input path */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   299
  int nFull,                    /* Size of output buffer in bytes */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   300
  char *zFull                   /* Output buffer */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   301
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   302
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   303
 int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   304
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   305
 int winClose(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   306
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   307
 int winRead(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   308
  sqlite3_file *id,          /* File to read from */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   309
  void *pBuf,                /* Write content into this buffer */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   310
  int amt,                   /* Number of bytes to read */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   311
  sqlite3_int64 offset       /* Begin reading at this offset */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   312
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   313
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   314
 int winWrite(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   315
  sqlite3_file *id,         /* File to write into */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   316
  const void *pBuf,         /* The bytes to be written */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   317
  int amt,                  /* Number of bytes to write */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   318
  sqlite3_int64 offset      /* Offset into the file to begin writing at */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   319
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   320
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   321
 int winTruncate(sqlite3_file *id, sqlite3_int64 nByte);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   322
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   323
 int winSync(sqlite3_file *id, int flags);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   324
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   325
 int symbianFileSize(sqlite3_file *id, sqlite3_int64 *pSize);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   326
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   327
 int winLock(sqlite3_file *id, int locktype);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   328
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   329
 int winCheckReservedLock(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   330
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   331
 int winUnlock(sqlite3_file *id, int locktype);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   332
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   333
 int symbianFileControl(sqlite3_file *id, int op, void *pArg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   334
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   335
 int winSectorSize(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   336
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   337
 int winDeviceCharacteristics(sqlite3_file *id);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   338
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   339
 int winOpen(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   340
  sqlite3_vfs *pVfs,        /* Not used */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   341
  const char *zName,        /* Name of the file (UTF-8) */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   342
  sqlite3_file *id,         /* Write the SQLite file handle here */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   343
  int flags,                /* Open mode flags */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   344
  int *pOutFlags            /* Status return flags */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   345
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   346
 int winFullPathname(
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   347
  sqlite3_vfs *pVfs,            /* Pointer to vfs object */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   348
  const char *zRelative,        /* Possibly relative input path */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   349
  int nFull,                    /* Size of output buffer in bytes */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   350
  char *zFull                   /* Output buffer */
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   351
);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   352
 int winSleep(sqlite3_vfs *pVfs, int microsec);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   353
 int winCurrentTime(sqlite3_vfs *pVfs, double *prNow);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   354
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   355
 int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   356
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   357
 int winFileControl(sqlite3_file *id, int op, void *pArg);
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   358
29cda98b007e Initial import of Podcatcher from the Bergamot project
skip
parents:
diff changeset
   359
#endif /* _SQLITE_OS_H_ */