Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Change the names of xGetTempName and sqlite3OsGetTempName to xGetTempname. To be consistent with xFullPathname and sqlite3OsFullPathname. (CVS 4432) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ad3687b16e9420d8bbaa3a645aaf8038 |
User & Date: | danielk1977 2007-09-17 06:06:39.000 |
Context
2007-09-17
| ||
07:02 | Add a parameter to specify the size of the output buffer passed to xGetTempname() and xFullPathname(). This, and the previous commit, are changes to the public vfs API introduced in 3.5.0. (CVS 4433) (check-in: 8b29f5fbfc user: danielk1977 tags: trunk) | |
06:06 | Change the names of xGetTempName and sqlite3OsGetTempName to xGetTempname. To be consistent with xFullPathname and sqlite3OsFullPathname. (CVS 4432) (check-in: ad3687b16e user: danielk1977 tags: trunk) | |
2007-09-14
| ||
20:32 | Corrections to the winCE code. Untested. (CVS 4431) (check-in: 8cc51e0a81 user: drh tags: trunk) | |
Changes
Changes to src/os.c.
︙ | ︙ | |||
103 104 105 106 107 108 109 | } int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ return pVfs->xDelete(pVfs, zPath, dirSync); } int sqlite3OsAccess(sqlite3_vfs *pVfs, const char *zPath, int flags){ return pVfs->xAccess(pVfs, zPath, flags); } | | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | } int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ return pVfs->xDelete(pVfs, zPath, dirSync); } int sqlite3OsAccess(sqlite3_vfs *pVfs, const char *zPath, int flags){ return pVfs->xAccess(pVfs, zPath, flags); } int sqlite3OsGetTempname(sqlite3_vfs *pVfs, char *zBufOut){ return pVfs->xGetTempname(pVfs, zBufOut); } int sqlite3OsFullPathname(sqlite3_vfs *pVfs, const char *zPath, char *zPathOut){ return pVfs->xFullPathname(pVfs, zPath, zPathOut); } void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){ return pVfs->xDlOpen(pVfs, zPath); } |
︙ | ︙ |
Changes to src/os.h.
︙ | ︙ | |||
246 247 248 249 250 251 252 | /* ** Functions for accessing sqlite3_vfs methods */ int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *); int sqlite3OsDelete(sqlite3_vfs *, const char *, int); int sqlite3OsAccess(sqlite3_vfs *, const char *, int); | | | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | /* ** Functions for accessing sqlite3_vfs methods */ int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *); int sqlite3OsDelete(sqlite3_vfs *, const char *, int); int sqlite3OsAccess(sqlite3_vfs *, const char *, int); int sqlite3OsGetTempname(sqlite3_vfs *, char *); int sqlite3OsFullPathname(sqlite3_vfs *, const char *, char *); void *sqlite3OsDlOpen(sqlite3_vfs *, const char *); void sqlite3OsDlError(sqlite3_vfs *, int, char *); void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *); void sqlite3OsDlClose(sqlite3_vfs *, void *); int sqlite3OsRandomness(sqlite3_vfs *, int, char *); int sqlite3OsSleep(sqlite3_vfs *, int); |
︙ | ︙ |
Changes to src/os_unix.c.
︙ | ︙ | |||
2470 2471 2472 2473 2474 2475 2476 | } /* ** Create a temporary file name in zBuf. zBuf must be allocated ** by the calling process and must be big enough to hold at least ** pVfs->mxPathname bytes. */ | | | 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 | } /* ** Create a temporary file name in zBuf. zBuf must be allocated ** by the calling process and must be big enough to hold at least ** pVfs->mxPathname bytes. */ static int unixGetTempname(sqlite3_vfs *pVfs, char *zBuf){ static const char *azDirs[] = { 0, "/var/tmp", "/usr/tmp", "/tmp", ".", }; |
︙ | ︙ | |||
2722 2723 2724 2725 2726 2727 2728 | 0, /* pNext */ "unix", /* zName */ 0, /* pAppData */ unixOpen, /* xOpen */ unixDelete, /* xDelete */ unixAccess, /* xAccess */ | | | 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 | 0, /* pNext */ "unix", /* zName */ 0, /* pAppData */ unixOpen, /* xOpen */ unixDelete, /* xDelete */ unixAccess, /* xAccess */ unixGetTempname, /* xGetTempName */ unixFullPathname, /* xFullPathname */ unixDlOpen, /* xDlOpen */ unixDlError, /* xDlError */ unixDlSym, /* xDlSym */ unixDlClose, /* xDlClose */ unixRandomness, /* xRandomness */ unixSleep, /* xSleep */ |
︙ | ︙ |
Changes to src/os_win.c.
︙ | ︙ | |||
1263 1264 1265 1266 1267 1268 1269 | } /* ** Create a temporary file name in zBuf. zBuf must be big enough to ** hold at pVfs->mxPathname characters. */ | | | 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 | } /* ** Create a temporary file name in zBuf. zBuf must be big enough to ** hold at pVfs->mxPathname characters. */ static int winGetTempname(sqlite3_vfs *pVfs, char *zBuf){ static char zChars[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789"; int i, j; char zTempPath[MAX_PATH+1]; if( sqlite3_temp_directory ){ |
︙ | ︙ | |||
1523 1524 1525 1526 1527 1528 1529 | 0, /* pNext */ "win32", /* zName */ 0, /* pAppData */ winOpen, /* xOpen */ winDelete, /* xDelete */ winAccess, /* xAccess */ | | | 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 | 0, /* pNext */ "win32", /* zName */ 0, /* pAppData */ winOpen, /* xOpen */ winDelete, /* xDelete */ winAccess, /* xAccess */ winGetTempname, /* xGetTempName */ winFullPathname, /* xFullPathname */ winDlOpen, /* xDlOpen */ winDlError, /* xDlError */ winDlSym, /* xDlSym */ winDlClose, /* xDlClose */ winRandomness, /* xRandomness */ winSleep, /* xSleep */ |
︙ | ︙ |
Changes to src/pager.c.
︙ | ︙ | |||
14 15 16 17 18 19 20 | ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** ** @(#) $Id: pager.c,v 1.389 2007/09/17 06:06:39 danielk1977 Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" #include <assert.h> #include <string.h> /* |
︙ | ︙ | |||
2050 2051 2052 2053 2054 2055 2056 | zPathname[0] = 0; }else #endif { rc = sqlite3OsFullPathname(pVfs, zFilename, zPathname); } }else{ | | | 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 | zPathname[0] = 0; }else #endif { rc = sqlite3OsFullPathname(pVfs, zFilename, zPathname); } }else{ rc = sqlite3OsGetTempname(pVfs, zPathname); } if( rc!=SQLITE_OK ){ sqlite3_free(zPathname); return rc; } nPathname = strlen(zPathname); |
︙ | ︙ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ** on how SQLite interfaces are suppose to operate. ** ** The name of this file under configuration management is "sqlite.h.in". ** The makefile makes some minor changes to this file (such as inserting ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ** on how SQLite interfaces are suppose to operate. ** ** The name of this file under configuration management is "sqlite.h.in". ** The makefile makes some minor changes to this file (such as inserting ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** ** @(#) $Id: sqlite.h.in,v 1.260 2007/09/17 06:06:39 danielk1977 Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ #include <stdarg.h> /* Needed for the definition of va_list */ /* ** Make sure we can call this stuff from C++. |
︙ | ︙ | |||
658 659 660 661 662 663 664 | ** to test for the existance of a file, ** or [SQLITE_ACCESS_READWRITE] to test to see ** if a file is readable and writable, or [SQLITE_ACCESS_READ] ** to test to see if a file is at least readable. The file can be a ** directory. ** ** SQLite will always allocate at least mxPathname+1 byte for | | | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | ** to test for the existance of a file, ** or [SQLITE_ACCESS_READWRITE] to test to see ** if a file is readable and writable, or [SQLITE_ACCESS_READ] ** to test to see if a file is at least readable. The file can be a ** directory. ** ** SQLite will always allocate at least mxPathname+1 byte for ** the output buffers for xGetTempname and xFullPathname. ** ** The xRandomness(), xSleep(), and xCurrentTime() interfaces ** are not strictly a part of the filesystem, but they are ** included in the VFS structure for completeness. ** The xRandomness() function attempts to return nBytes bytes ** of good-quality randomness into zOut. The return value is ** the actual number of bytes of randomness obtained. The |
︙ | ︙ | |||
683 684 685 686 687 688 689 | sqlite3_vfs *pNext; /* Next registered VFS */ const char *zName; /* Name of this virtual file system */ void *pAppData; /* Pointer to application-specific data */ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags); int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); int (*xAccess)(sqlite3_vfs*, const char *zName, int flags); | | | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | sqlite3_vfs *pNext; /* Next registered VFS */ const char *zName; /* Name of this virtual file system */ void *pAppData; /* Pointer to application-specific data */ int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags); int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); int (*xAccess)(sqlite3_vfs*, const char *zName, int flags); int (*xGetTempname)(sqlite3_vfs*, char *zOut); int (*xFullPathname)(sqlite3_vfs*, const char *zName, char *zOut); void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); void *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol); void (*xDlClose)(sqlite3_vfs*, void*); int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); int (*xSleep)(sqlite3_vfs*, int microseconds); |
︙ | ︙ |
Changes to src/test6.c.
︙ | ︙ | |||
564 565 566 567 568 569 570 | sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xDelete(pVfs, zPath, dirSync); } static int cfAccess(sqlite3_vfs *pCfVfs, const char *zPath, int flags){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xAccess(pVfs, zPath, flags); } | | | | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xDelete(pVfs, zPath, dirSync); } static int cfAccess(sqlite3_vfs *pCfVfs, const char *zPath, int flags){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xAccess(pVfs, zPath, flags); } static int cfGetTempname(sqlite3_vfs *pCfVfs, char *zBufOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xGetTempname(pVfs, zBufOut); } static int cfFullPathname(sqlite3_vfs *pCfVfs, const char *zPath, char *zPathOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xFullPathname(pVfs, zPath, zPathOut); } static void *cfDlOpen(sqlite3_vfs *pCfVfs, const char *zPath){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; |
︙ | ︙ | |||
717 718 719 720 721 722 723 | 0, /* pNext */ "crash", /* zName */ 0, /* pAppData */ cfOpen, /* xOpen */ cfDelete, /* xDelete */ cfAccess, /* xAccess */ | | | 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | 0, /* pNext */ "crash", /* zName */ 0, /* pAppData */ cfOpen, /* xOpen */ cfDelete, /* xDelete */ cfAccess, /* xAccess */ cfGetTempname, /* xGetTempName */ cfFullPathname, /* xFullPathname */ cfDlOpen, /* xDlOpen */ cfDlError, /* xDlError */ cfDlSym, /* xDlSym */ cfDlClose, /* xDlClose */ cfRandomness, /* xRandomness */ cfSleep, /* xSleep */ |
︙ | ︙ |
Changes to src/test_async.c.
︙ | ︙ | |||
986 987 988 989 990 991 992 | flags==SQLITE_ACCESS_READ?"read":"exists" , zName, ret) ); pthread_mutex_unlock(&async.queueMutex); return ret; } | | | | 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 | flags==SQLITE_ACCESS_READ?"read":"exists" , zName, ret) ); pthread_mutex_unlock(&async.queueMutex); return ret; } static int asyncGetTempname(sqlite3_vfs *pAsyncVfs, char *zBufOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xGetTempname(pVfs, zBufOut); } /* ** Fill in zPathOut with the full path to the file identified by zPath. */ static int asyncFullPathname( sqlite3_vfs *pAsyncVfs, |
︙ | ︙ | |||
1089 1090 1091 1092 1093 1094 1095 | 0, /* mxPathname */ 0, /* pNext */ "async", /* zName */ 0, /* pAppData */ asyncOpen, /* xOpen */ asyncDelete, /* xDelete */ asyncAccess, /* xAccess */ | | | 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | 0, /* mxPathname */ 0, /* pNext */ "async", /* zName */ 0, /* pAppData */ asyncOpen, /* xOpen */ asyncDelete, /* xDelete */ asyncAccess, /* xAccess */ asyncGetTempname, /* xGetTempName */ asyncFullPathname, /* xFullPathname */ asyncDlOpen, /* xDlOpen */ asyncDlError, /* xDlError */ asyncDlSym, /* xDlSym */ asyncDlClose, /* xDlClose */ asyncRandomness, /* xDlError */ asyncSleep, /* xDlSym */ |
︙ | ︙ |
Changes to src/test_onefile.c.
︙ | ︙ | |||
159 160 161 162 163 164 165 | /* ** Method declarations for fs_vfs. */ static int fsOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *); static int fsDelete(sqlite3_vfs*, const char *zName, int syncDir); static int fsAccess(sqlite3_vfs*, const char *zName, int flags); | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | /* ** Method declarations for fs_vfs. */ static int fsOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *); static int fsDelete(sqlite3_vfs*, const char *zName, int syncDir); static int fsAccess(sqlite3_vfs*, const char *zName, int flags); static int fsGetTempname(sqlite3_vfs*, char *zOut); static int fsFullPathname(sqlite3_vfs*, const char *zName, char *zOut); static void *fsDlOpen(sqlite3_vfs*, const char *zFilename); static void fsDlError(sqlite3_vfs*, int nByte, char *zErrMsg); static void *fsDlSym(sqlite3_vfs*,void*, const char *zSymbol); static void fsDlClose(sqlite3_vfs*, void*); static int fsRandomness(sqlite3_vfs*, int nByte, char *zOut); static int fsSleep(sqlite3_vfs*, int microseconds); |
︙ | ︙ | |||
188 189 190 191 192 193 194 | 0, /* mxPathname */ 0, /* pNext */ FS_VFS_NAME, /* zName */ 0, /* pAppData */ fsOpen, /* xOpen */ fsDelete, /* xDelete */ fsAccess, /* xAccess */ | | | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | 0, /* mxPathname */ 0, /* pNext */ FS_VFS_NAME, /* zName */ 0, /* pAppData */ fsOpen, /* xOpen */ fsDelete, /* xDelete */ fsAccess, /* xAccess */ fsGetTempname, /* xGetTempName */ fsFullPathname, /* xFullPathname */ fsDlOpen, /* xDlOpen */ fsDlError, /* xDlError */ fsDlSym, /* xDlSym */ fsDlClose, /* xDlClose */ fsRandomness, /* xRandomness */ fsSleep, /* xSleep */ |
︙ | ︙ | |||
722 723 724 725 726 727 728 | } /* ** Populate buffer zBufOut with a pathname suitable for use as a ** temporary file. zBufOut is guaranteed to point to a buffer of ** at least (FS_MAX_PATHNAME+1) bytes. */ | | | | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | } /* ** Populate buffer zBufOut with a pathname suitable for use as a ** temporary file. zBufOut is guaranteed to point to a buffer of ** at least (FS_MAX_PATHNAME+1) bytes. */ static int fsGetTempname(sqlite3_vfs *pVfs, char *zBufOut){ sqlite3_vfs *pParent = ((fs_vfs_t *)pVfs)->pParent; return pParent->xGetTempname(pParent, zBufOut); } /* ** Populate buffer zOut with the full canonical pathname corresponding ** to the pathname in zPath. zOut is guaranteed to point to a buffer ** of at least (FS_MAX_PATHNAME+1) bytes. */ |
︙ | ︙ |