From: pweilbacher Date: Tue, 29 Jul 2008 18:35:53 +0000 (+0000) Subject: move os2FullPathname() so that it can be used in os2Open() directly (CVS 5495) X-Git-Tag: version-3.6.10~682 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d2a4b057d1f96a28a8cbd42ee0bb0c2835e7894;p=thirdparty%2Fsqlite.git move os2FullPathname() so that it can be used in os2Open() directly (CVS 5495) FossilOrigin-Name: 2455e45484eff85bf9fd78dadd1e934f2bbe210a --- diff --git a/manifest b/manifest index e06ff59779..c695b33c76 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhancements\sto\sthe\spagecache\smalloc\stest\sconfiguration.\s\sChanges\sto\sthe\nspeed\stest\sscripts\sto\suse\sthe\snew\stest\senhancements.\s(CVS\s5494) -D 2008-07-29T14:29:07 +C move\sos2FullPathname()\sso\sthat\sit\scan\sbe\sused\sin\sos2Open()\sdirectly\s(CVS\s5495) +D 2008-07-29T18:35:54 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in bbb62eecc851379aef5a48a1bf8787eb13e6ec06 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -132,7 +132,7 @@ F src/mutex_w32.c f0d21ff1f6981e5aedc56796adf3a347423ef736 F src/os.c 939ae7690a01d9401685ba124b4ba45fd4a7a2ad F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892 F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60 -F src/os_os2.c da14449fc210cd313eb56cf511ae05b350e323d6 +F src/os_os2.c 3f4383c493106ec777b242bc2eee5ef46838aba7 F src/os_unix.c 1df6108efdb7957a9f28b9700600e58647c9c12d F src/os_win.c 50ec783403b418ddc9e6e05d541c6027dfd41070 F src/pager.c a6ecad26297469a8a3d1fd7a7c3dc2d603955044 @@ -612,7 +612,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P ec09b551e8279e791070515e1f2413f44dc67ea5 -R f345ec71ab69d5e2a656c297e7e3014c -U drh -Z d20474b144bde5d5539e2012e207e0db +P 0ce39c21f32958ae53c00dc8bbf8cdd453f2d90e +R a9a0dc7d9673a9f296b12507bc3ba2c9 +U pweilbacher +Z 4102ea838145bbe2d8042af7245b024f diff --git a/manifest.uuid b/manifest.uuid index a5d4bbbdc3..01a72577d9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0ce39c21f32958ae53c00dc8bbf8cdd453f2d90e \ No newline at end of file +2455e45484eff85bf9fd78dadd1e934f2bbe210a \ No newline at end of file diff --git a/src/os_os2.c b/src/os_os2.c index 5ec716e392..dfed6d895e 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -12,7 +12,7 @@ ** ** This file contains code that is specific to OS/2. ** -** $Id: os_os2.c,v 1.52 2008/07/18 05:36:28 pweilbacher Exp $ +** $Id: os_os2.c,v 1.53 2008/07/29 18:35:54 pweilbacher Exp $ */ #include "sqliteInt.h" @@ -711,6 +711,30 @@ static int getTempname(int nBuf, char *zBuf ){ } +/* +** Turn a relative pathname into a full pathname. Write the full +** pathname into zFull[]. zFull[] will be at least pVfs->mxPathname +** bytes in size. +*/ +static int os2FullPathname( + sqlite3_vfs *pVfs, /* Pointer to vfs object */ + const char *zRelative, /* Possibly relative input path */ + int nFull, /* Size of output buffer in bytes */ + char *zFull /* Output buffer */ +){ + char *zRelativeCp = convertUtf8PathToCp( zRelative ); + char zFullCp[CCHMAXPATH] = "\0"; + char *zFullUTF; + APIRET rc = DosQueryPathInfo( zRelativeCp, FIL_QUERYFULLNAME, zFullCp, + CCHMAXPATH ); + free( zRelativeCp ); + zFullUTF = convertCpPathToUtf8( zFullCp ); + sqlite3_snprintf( nFull, zFull, zFullUTF ); + free( zFullUTF ); + return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR; +} + + /* ** Open a file. */ @@ -779,7 +803,7 @@ static int os2Open( char pathUtf8[CCHMAXPATH]; /*ulFileAttribute = FILE_HIDDEN; //for debugging, we want to make sure it is deleted*/ ulFileAttribute = FILE_NORMAL; - sqlite3OsFullPathname( pVfs, zName, CCHMAXPATH, pathUtf8 ); + os2FullPathname( pVfs, zName, CCHMAXPATH, pathUtf8 ); pFile->pathToDel = convertUtf8PathToCp( pathUtf8 ); OSTRACE1( "OPEN hidden/delete on close file attributes\n" ); }else{ @@ -884,29 +908,6 @@ static int os2Access( } -/* -** Turn a relative pathname into a full pathname. Write the full -** pathname into zFull[]. zFull[] will be at least pVfs->mxPathname -** bytes in size. -*/ -static int os2FullPathname( - sqlite3_vfs *pVfs, /* Pointer to vfs object */ - const char *zRelative, /* Possibly relative input path */ - int nFull, /* Size of output buffer in bytes */ - char *zFull /* Output buffer */ -){ - char *zRelativeCp = convertUtf8PathToCp( zRelative ); - char zFullCp[CCHMAXPATH] = "\0"; - char *zFullUTF; - APIRET rc = DosQueryPathInfo( zRelativeCp, FIL_QUERYFULLNAME, zFullCp, - CCHMAXPATH ); - free( zRelativeCp ); - zFullUTF = convertCpPathToUtf8( zFullCp ); - sqlite3_snprintf( nFull, zFull, zFullUTF ); - free( zFullUTF ); - return rc == NO_ERROR ? SQLITE_OK : SQLITE_IOERR; -} - #ifndef SQLITE_OMIT_LOAD_EXTENSION /* ** Interfaces for opening a shared library, finding entry points