aboutsummaryrefslogtreecommitdiff
path: root/src/os_win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_win.c')
-rw-r--r--src/os_win.c84
1 files changed, 37 insertions, 47 deletions
diff --git a/src/os_win.c b/src/os_win.c
index 6e51947af..ea2ca2608 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -35,6 +35,13 @@
#include "os_common.h"
/*
+** Do not include any of the File I/O interface procedures if the
+** SQLITE_OMIT_DISKIO macro is defined (indicating that there database
+** will be in-memory only)
+*/
+#ifndef SQLITE_OMIT_DISKIO
+
+/*
** Delete the named file
*/
int sqlite3OsDelete(const char *zFilename){
@@ -626,6 +633,36 @@ int sqlite3OsUnlock(OsFile *id, int locktype){
}
/*
+** Turn a relative pathname into a full pathname. Return a pointer
+** to the full pathname stored in space obtained from sqliteMalloc().
+** The calling function is responsible for freeing this space once it
+** is no longer needed.
+*/
+char *sqlite3OsFullPathname(const char *zRelative){
+ char *zNotUsed;
+ char *zFull;
+ int nByte;
+#ifdef __CYGWIN__
+ nByte = strlen(zRelative) + MAX_PATH + 1001;
+ zFull = sqliteMalloc( nByte );
+ if( zFull==0 ) return 0;
+ if( cygwin_conv_to_full_win32_path(zRelative, zFull) ) return 0;
+#else
+ nByte = GetFullPathNameA(zRelative, 0, 0, &zNotUsed) + 1;
+ zFull = sqliteMalloc( nByte );
+ if( zFull==0 ) return 0;
+ GetFullPathNameA(zRelative, nByte, zFull, &zNotUsed);
+#endif
+ return zFull;
+}
+
+#endif /* SQLITE_OMIT_DISKIO */
+/***************************************************************************
+** Everything above deals with file I/O. Everything that follows deals
+** with other miscellanous aspects of the operating system interface
+****************************************************************************/
+
+/*
** Get information to seed the random number generator. The seed
** is written into the buffer zBuf[256]. The calling function must
** supply a sufficiently large buffer.
@@ -698,30 +735,6 @@ void sqlite3OsLeaveMutex(){
}
/*
-** Turn a relative pathname into a full pathname. Return a pointer
-** to the full pathname stored in space obtained from sqliteMalloc().
-** The calling function is responsible for freeing this space once it
-** is no longer needed.
-*/
-char *sqlite3OsFullPathname(const char *zRelative){
- char *zNotUsed;
- char *zFull;
- int nByte;
-#ifdef __CYGWIN__
- nByte = strlen(zRelative) + MAX_PATH + 1001;
- zFull = sqliteMalloc( nByte );
- if( zFull==0 ) return 0;
- if( cygwin_conv_to_full_win32_path(zRelative, zFull) ) return 0;
-#else
- nByte = GetFullPathNameA(zRelative, 0, 0, &zNotUsed) + 1;
- zFull = sqliteMalloc( nByte );
- if( zFull==0 ) return 0;
- GetFullPathNameA(zRelative, nByte, zFull, &zNotUsed);
-#endif
- return zFull;
-}
-
-/*
** The following variable, if set to a non-zero value, becomes the result
** returned from sqlite3OsCurrentTime(). This is used for testing.
*/
@@ -751,27 +764,4 @@ int sqlite3OsCurrentTime(double *prNow){
return 0;
}
-/*
-** Find the time that the file was last modified. Write the
-** modification time and date as a Julian Day number into *prNow and
-** return SQLITE_OK. Return SQLITE_ERROR if the modification
-** time cannot be found.
-*/
-int sqlite3OsFileModTime(OsFile *id, double *prMTime){
- int rc;
- FILETIME ft;
- /* FILETIME structure is a 64-bit value representing the number of
- ** 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5).
- */
- if( GetFileTime(id->h, 0, 0, &ft) ){
- double t;
- t = ((double)ft.dwHighDateTime) * 4294967296.0;
- *prMTime = (t + ft.dwLowDateTime)/864000000000.0 + 2305813.5;
- rc = SQLITE_OK;
- }else{
- rc = SQLITE_ERROR;
- }
- return rc;
-}
-
#endif /* OS_WIN */