Back to index

lightning-sunbird  0.9+nobinonly
os_os2.h
Go to the documentation of this file.
00001 /*
00002 ** 2004 May 22
00003 **
00004 ** The author disclaims copyright to this source code.  In place of
00005 ** a legal notice, here is a blessing:
00006 **
00007 **    May you do good and not evil.
00008 **    May you find forgiveness for yourself and forgive others.
00009 **    May you share freely, never taking more than you give.
00010 **
00011 ******************************************************************************
00012 **
00013 ** This header file defined OS-specific features for OS/2.
00014 */
00015 #ifndef _SQLITE_OS_OS2_H_
00016 #define _SQLITE_OS_OS2_H_
00017 
00018 /*
00019 ** standard include files.
00020 */
00021 #include <sys/types.h>
00022 #include <sys/stat.h>
00023 #include <fcntl.h>
00024 #include <unistd.h>
00025 
00026 /*
00027 ** Macros used to determine whether or not to use threads.  The
00028 ** SQLITE_UNIX_THREADS macro is defined if we are synchronizing for
00029 ** Posix threads and SQLITE_W32_THREADS is defined if we are
00030 ** synchronizing using Win32 threads.
00031 */
00032 /* this mutex implementation only available with EMX */
00033 #if defined(THREADSAFE) && THREADSAFE
00034 # include <sys/builtin.h>
00035 # include <sys/smutex.h>
00036 # define SQLITE_OS2_THREADS 1
00037 #endif
00038 
00039 /*
00040 ** The OsFile structure is a operating-system independing representation
00041 ** of an open file handle.  It is defined differently for each architecture.
00042 **
00043 ** This is the definition for Unix.
00044 **
00045 ** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK,
00046 ** PENDING_LOCK or EXCLUSIVE_LOCK.
00047 */
00048 typedef struct OsFile OsFile;
00049 struct OsFile {
00050      int h;        /* The file descriptor (LHANDLE) */
00051      int locked;              /* True if this user holds the lock */
00052      int delOnClose;          /* True if file is to be deleted on close */
00053      char *pathToDel;         /* Name of file to delete on close */
00054      unsigned char locktype;   /* The type of lock held on this fd */
00055      unsigned char isOpen;   /* True if needs to be closed */
00056      unsigned char fullSync;
00057 };
00058 
00059 /*
00060 ** Maximum number of characters in a temporary file name
00061 */
00062 #define SQLITE_TEMPNAME_SIZE 200
00063 
00064 /*
00065 ** Minimum interval supported by sqlite3OsSleep().
00066 */
00067 #define SQLITE_MIN_SLEEP_MS 1
00068 
00069 #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS
00070 # define SQLITE_DEFAULT_FILE_PERMISSIONS 0600
00071 #endif
00072 
00073 #endif /* _SQLITE_OS_OS2_H_ */