aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-08-27 21:10:36 +0000
committerdrh <drh@noemail.net>2007-08-27 21:10:36 +0000
commit50d3f9064bc7bfd95d6a19b1a9797ee9d12f7769 (patch)
tree2c39c17d5464150fe7c0fe874fcc880d76e7b26c /src
parent9f61c2f12986211b88adb239846ee8134be2aff1 (diff)
downloadsqlite-50d3f9064bc7bfd95d6a19b1a9797ee9d12f7769.tar.gz
sqlite-50d3f9064bc7bfd95d6a19b1a9797ee9d12f7769.zip
Added the 34to35.html document describing the changes between 3.4.2 and
3.5.0. Minor interface cleanups. (CVS 4302) FossilOrigin-Name: 0791f917bb18d7305b805b9cbcb308bdd7b3a1f5
Diffstat (limited to 'src')
-rw-r--r--src/os_unix.c2
-rw-r--r--src/os_win.c4
-rw-r--r--src/sqlite.h.in26
-rw-r--r--src/test_async.c4
4 files changed, 23 insertions, 13 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index e9150f1df..1b23fef1e 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2463,7 +2463,7 @@ static int unixAccess(sqlite3_vfs *pVfs, const char *zPath, int flags){
case SQLITE_ACCESS_READWRITE:
amode = W_OK|R_OK;
break;
- case SQLITE_ACCESS_READONLY:
+ case SQLITE_ACCESS_READ:
amode = R_OK;
break;
diff --git a/src/os_win.c b/src/os_win.c
index e87c41649..36cce4f87 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -1237,15 +1237,13 @@ static int winAccess(
}
free(zConverted);
switch( flags ){
+ case SQLITE_ACCESS_READ:
case SQLITE_ACCESS_EXISTS:
rc = attr!=0xffffffff;
break;
case SQLITE_ACCESS_READWRITE:
rc = (attr & FILE_ATTRIBUTE_READONLY)==0;
break;
- case SQLITE_ACCESS_READONLY:
- rc = (attr!=0xffffffff) && ((attr & FILE_ATTRIBUTE_READONLY)==1);
- break;
default:
assert(!"Invalid flags argument");
}
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index edbffc8eb..3b1af5e9c 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -30,7 +30,7 @@
** the version number) and changes its name to "sqlite3.h" as
** part of the build process.
**
-** @(#) $Id: sqlite.h.in,v 1.243 2007/08/27 17:27:49 danielk1977 Exp $
+** @(#) $Id: sqlite.h.in,v 1.244 2007/08/27 21:10:36 drh Exp $
*/
#ifndef _SQLITE3_H_
#define _SQLITE3_H_
@@ -553,7 +553,7 @@ typedef struct sqlite3_mutex sqlite3_mutex;
** SQLite will guarantee that the zFilename string passed to
** xOpen() is a full pathname as generated by xFullPathname() and
** that the string will be valid and unchanged until xClose() is
-** called. So the sqlite3_file can store a pointer to the
+** called. So the [sqlite3_file] can store a pointer to the
** filename if it needs to remember the filename for some reason.
**
** The flags argument to xOpen() is a copy of the flags argument
@@ -599,10 +599,10 @@ typedef struct sqlite3_mutex sqlite3_mutex;
** for exclusive access. This flag is set for all files except
** for the main database file.
**
-** The sqlite3_file structure passed as the third argument to
-** xOpen is allocated by the caller. xOpen just fills it in. The
-** caller allocates a minimum of szOsFile bytes for the sqlite3_file
-** structure.
+** Space to hold the [sqlite3_file] structure passed as the third
+** argument to xOpen is allocated by caller (the SQLite core).
+** szOsFile bytes are allocated for this object. The xOpen method
+** fills in the allocated space.
**
** The flags argument to xAccess() may be 0 (to test for the
** existance of a file) or SQLITE_ACCESS_READWRITE to test to see
@@ -649,9 +649,21 @@ struct sqlite3_vfs {
** value will increment whenever this happens. */
};
+/*
+** CAPI3REF: Flags for the xAccess VFS method
+**
+** These integer constants can be used as the third parameter to
+** the xAccess method of an [sqlite3_vfs] object. They determine
+** the kind of what kind of permissions the xAccess method is
+** looking for. With SQLITE_ACCESS_EXISTS, the xAccess method
+** simply checks to see if the file exists. With SQLITE_ACCESS_READWRITE,
+** the xAccess method checks to see if the file is both readable
+** and writable. With SQLITE_ACCESS_READ the xAccess method
+** checks to see if the file is readable.
+*/
#define SQLITE_ACCESS_EXISTS 0
#define SQLITE_ACCESS_READWRITE 1
-#define SQLITE_ACCESS_READONLY 2
+#define SQLITE_ACCESS_READ 2
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
diff --git a/src/test_async.c b/src/test_async.c
index 572620c69..1627f912f 100644
--- a/src/test_async.c
+++ b/src/test_async.c
@@ -726,7 +726,7 @@ static int asyncAccess(sqlite3_vfs *pAsyncVfs, const char *zName, int flags){
sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData;
assert(flags==SQLITE_ACCESS_READWRITE
- || flags==SQLITE_ACCESS_READONLY
+ || flags==SQLITE_ACCESS_READ
|| flags==SQLITE_ACCESS_EXISTS
);
@@ -745,7 +745,7 @@ static int asyncAccess(sqlite3_vfs *pAsyncVfs, const char *zName, int flags){
}
ASYNC_TRACE(("ACCESS(%s): %s = %d\n",
flags==SQLITE_ACCESS_READWRITE?"read-write":
- flags==SQLITE_ACCESS_READONLY?"read-only":"exists"
+ flags==SQLITE_ACCESS_READ?"read":"exists"
, zName, ret)
);
pthread_mutex_unlock(&async.queueMutex);