Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Changes to support linking without a parser and without a disk I/O interface. (CVS 2504) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
62a7353d4af4886b1561832e8b36e8e7 |
User & Date: | drh 2005-06-07 22:22:51.000 |
Context
2005-06-12
| ||
12:01 | Elminiate a VM opcode that was no longer needed. (CVS 2505) (check-in: 97b348a5ad user: drh tags: trunk) | |
2005-06-07
| ||
22:22 | Changes to support linking without a parser and without a disk I/O interface. (CVS 2504) (check-in: 62a7353d4a user: drh tags: trunk) | |
20:07 | In the documentation, amplify the fact that encodings cannot be changed on a database that already exists. Ticket #1277. (CVS 2503) (check-in: 4704f3a19a user: drh tags: trunk) | |
Changes
Changes to src/os.h.
︙ | ︙ | |||
19 20 21 22 23 24 25 | /* ** Figure out if we are dealing with Unix, Windows or MacOS. ** ** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix. ** The MacOS build is designed to use CodeWarrior (tested with v8) */ | | > < < < > > > > > | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | /* ** Figure out if we are dealing with Unix, Windows or MacOS. ** ** N.B. MacOS means Mac Classic (or Carbon). Treat Darwin (OS X) as Unix. ** The MacOS build is designed to use CodeWarrior (tested with v8) */ #if !defined(OS_UNIX) && !defined(OS_TEST) && !defined(OS_OTHER) # define OS_OTHER 0 # ifndef OS_WIN # if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) # define OS_WIN 1 # define OS_UNIX 0 # else # define OS_WIN 0 # define OS_UNIX 1 # endif # else # define OS_UNIX 0 # endif #else # ifndef OS_WIN # define OS_WIN 0 # endif #endif /* ** Invoke the appropriate operating-system specific header file. */ #if OS_TEST # include "os_test.h" #endif #if OS_UNIX # include "os_unix.h" #endif #if OS_WIN # include "os_win.h" #endif /* os_other.c and os_other.h are not delivered with SQLite. These files ** are place-holders that can be filled in by third-party developers to ** implement backends to their on proprietary operating systems. */ #if OS_OTHER # include "os_other.h" #endif /* If the SET_FULLSYNC macro is not defined above, then make it ** a no-op */ #ifndef SET_FULLSYNC # define SET_FULLSYNC(x,y) |
︙ | ︙ | |||
177 178 179 180 181 182 183 | int sqlite3OsClose(OsFile*); int sqlite3OsRead(OsFile*, void*, int amt); int sqlite3OsWrite(OsFile*, const void*, int amt); int sqlite3OsSeek(OsFile*, i64 offset); int sqlite3OsSync(OsFile*); int sqlite3OsTruncate(OsFile*, i64 size); int sqlite3OsFileSize(OsFile*, i64 *pSize); | < < < < < < > > > > > > > > > > | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | int sqlite3OsClose(OsFile*); int sqlite3OsRead(OsFile*, void*, int amt); int sqlite3OsWrite(OsFile*, const void*, int amt); int sqlite3OsSeek(OsFile*, i64 offset); int sqlite3OsSync(OsFile*); int sqlite3OsTruncate(OsFile*, i64 size); int sqlite3OsFileSize(OsFile*, i64 *pSize); char *sqlite3OsFullPathname(const char*); int sqlite3OsLock(OsFile*, int); int sqlite3OsUnlock(OsFile*, int); int sqlite3OsCheckReservedLock(OsFile *id); /* The interface for file I/O is above. Other miscellaneous functions ** are below */ int sqlite3OsRandomSeed(char*); int sqlite3OsSleep(int ms); int sqlite3OsCurrentTime(double*); void sqlite3OsEnterMutex(void); void sqlite3OsLeaveMutex(void); #endif /* _SQLITE_OS_H_ */ |
Changes to src/os_unix.c.
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #include "os.h" #if OS_UNIX /* This file is used on unix only */ #include <time.h> #include <errno.h> #include <unistd.h> #ifndef O_LARGEFILE # define O_LARGEFILE 0 #endif #ifdef SQLITE_DISABLE_LFS # undef O_LARGEFILE # define O_LARGEFILE 0 #endif #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif #ifndef O_BINARY # define O_BINARY 0 #endif | > > > > > > > > > > > > < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #include "os.h" #if OS_UNIX /* This file is used on unix only */ #include <time.h> #include <errno.h> #include <unistd.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 /* ** Define various macros that are missing from some systems. */ #ifndef O_LARGEFILE # define O_LARGEFILE 0 #endif #ifdef SQLITE_DISABLE_LFS # undef O_LARGEFILE # define O_LARGEFILE 0 #endif #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif #ifndef O_BINARY # define O_BINARY 0 #endif /* ** The DJGPP compiler environment looks mostly like Unix, but it ** lacks the fcntl() system call. So redefine fcntl() to be something ** that always succeeds. This means that locking does not occur under ** DJGPP. But its DOS - what did you expect? */ |
︙ | ︙ | |||
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 | releaseOpenCnt(id->pOpen); sqlite3OsLeaveMutex(); id->isOpen = 0; TRACE2("CLOSE %-3d\n", id->h); OpenCounter(-1); return SQLITE_OK; } /* ** 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. */ int sqlite3OsRandomSeed(char *zBuf){ | > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | releaseOpenCnt(id->pOpen); sqlite3OsLeaveMutex(); id->isOpen = 0; TRACE2("CLOSE %-3d\n", id->h); OpenCounter(-1); return SQLITE_OK; } /* ** 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 *zFull = 0; if( zRelative[0]=='/' ){ sqlite3SetString(&zFull, zRelative, (char*)0); }else{ char zBuf[5000]; zBuf[0] = 0; sqlite3SetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, (char*)0); } 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. */ int sqlite3OsRandomSeed(char *zBuf){ |
︙ | ︙ | |||
1275 1276 1277 1278 1279 1280 1281 | assert( inMutex ); inMutex = 0; #ifdef SQLITE_UNIX_THREADS pthread_mutex_unlock(&mutex); #endif } | < < < < < < < < < < < < < < < < < < < | 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | assert( inMutex ); inMutex = 0; #ifdef SQLITE_UNIX_THREADS pthread_mutex_unlock(&mutex); #endif } /* ** The following variable, if set to a non-zero value, becomes the result ** returned from sqlite3OsCurrentTime(). This is used for testing. */ #ifdef SQLITE_TEST int sqlite3_current_time = 0; #endif |
︙ | ︙ | |||
1319 1320 1321 1322 1323 1324 1325 | if( sqlite3_current_time ){ *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif return 0; } | < < < < < < < < < < < < < < < < < < < < | 1338 1339 1340 1341 1342 1343 1344 1345 | if( sqlite3_current_time ){ *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif return 0; } #endif /* OS_UNIX */ |
Changes to src/os_win.c.
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #endif /* ** Include code that is common to all os_*.c files */ #include "os_common.h" /* ** Delete the named file */ int sqlite3OsDelete(const char *zFilename){ DeleteFileA(zFilename); TRACE2("DELETE \"%s\"\n", zFilename); return SQLITE_OK; | > > > > > > > | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #endif /* ** Include code that is common to all os_*.c files */ #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){ DeleteFileA(zFilename); TRACE2("DELETE \"%s\"\n", zFilename); return SQLITE_OK; |
︙ | ︙ | |||
621 622 623 624 625 626 627 628 629 630 631 632 633 634 | if( type>=PENDING_LOCK ){ UnlockFile(id->h, PENDING_BYTE, 0, 1, 0); } id->locktype = locktype; return rc; } /* ** 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. */ int sqlite3OsRandomSeed(char *zBuf){ /* We have to initialize zBuf to prevent valgrind from reporting | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | if( type>=PENDING_LOCK ){ UnlockFile(id->h, PENDING_BYTE, 0, 1, 0); } id->locktype = locktype; return rc; } /* ** 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. */ int sqlite3OsRandomSeed(char *zBuf){ /* We have to initialize zBuf to prevent valgrind from reporting |
︙ | ︙ | |||
693 694 695 696 697 698 699 | assert( inMutex ); inMutex = 0; #ifdef SQLITE_W32_THREADS LeaveCriticalSection(&cs); #endif } | < < < < < < < < < < < < < < < < < < < < < < < < | 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | assert( inMutex ); inMutex = 0; #ifdef SQLITE_W32_THREADS LeaveCriticalSection(&cs); #endif } /* ** The following variable, if set to a non-zero value, becomes the result ** returned from sqlite3OsCurrentTime(). This is used for testing. */ #ifdef SQLITE_TEST int sqlite3_current_time = 0; #endif |
︙ | ︙ | |||
747 748 749 750 751 752 753 | if( sqlite3_current_time ){ *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif return 0; } | < < < < < < < < < < < < < < < < < < < < < < < | 760 761 762 763 764 765 766 767 | if( sqlite3_current_time ){ *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif return 0; } #endif /* OS_WIN */ |
Changes to src/pragma.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 2003 April 6 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /* ** 2003 April 6 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** ** $Id: pragma.c,v 1.94 2005/06/07 22:22:51 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* Ignore this whole file if pragmas are disabled */ #if !defined(SQLITE_OMIT_PRAGMA) && !defined(SQLITE_OMIT_PARSER) #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) # include "pager.h" # include "btree.h" #endif /* |
︙ | ︙ | |||
926 927 928 929 930 931 932 | sqlite3VdbeAddOp(v, OP_Expire, 1, 0); } pragma_out: sqliteFree(zLeft); sqliteFree(zRight); } | | | 926 927 928 929 930 931 932 933 | sqlite3VdbeAddOp(v, OP_Expire, 1, 0); } pragma_out: sqliteFree(zLeft); sqliteFree(zRight); } #endif /* SQLITE_OMIT_PRAGMA || SQLITE_OMIT_PARSER */ |