/ Check-in [ad3687b1]
Login

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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ad3687b16e9420d8bbaa3a645aaf803813b36061
User & Date: danielk1977 2007-09-17 06:06:39
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: 8b29f5fb 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: ad3687b1 user: danielk1977 tags: trunk
2007-09-14
20:32
Corrections to the winCE code. Untested. (CVS 4431) check-in: 8cc51e0a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os.c.

   103    103   }
   104    104   int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
   105    105     return pVfs->xDelete(pVfs, zPath, dirSync);
   106    106   }
   107    107   int sqlite3OsAccess(sqlite3_vfs *pVfs, const char *zPath, int flags){
   108    108     return pVfs->xAccess(pVfs, zPath, flags);
   109    109   }
   110         -int sqlite3OsGetTempName(sqlite3_vfs *pVfs, char *zBufOut){
   111         -  return pVfs->xGetTempName(pVfs, zBufOut);
          110  +int sqlite3OsGetTempname(sqlite3_vfs *pVfs, char *zBufOut){
          111  +  return pVfs->xGetTempname(pVfs, zBufOut);
   112    112   }
   113    113   int sqlite3OsFullPathname(sqlite3_vfs *pVfs, const char *zPath, char *zPathOut){
   114    114     return pVfs->xFullPathname(pVfs, zPath, zPathOut);
   115    115   }
   116    116   void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
   117    117     return pVfs->xDlOpen(pVfs, zPath);
   118    118   }

Changes to src/os.h.

   246    246   
   247    247   /* 
   248    248   ** Functions for accessing sqlite3_vfs methods 
   249    249   */
   250    250   int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
   251    251   int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
   252    252   int sqlite3OsAccess(sqlite3_vfs *, const char *, int);
   253         -int sqlite3OsGetTempName(sqlite3_vfs *, char *);
          253  +int sqlite3OsGetTempname(sqlite3_vfs *, char *);
   254    254   int sqlite3OsFullPathname(sqlite3_vfs *, const char *, char *);
   255    255   void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
   256    256   void sqlite3OsDlError(sqlite3_vfs *, int, char *);
   257    257   void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *);
   258    258   void sqlite3OsDlClose(sqlite3_vfs *, void *);
   259    259   int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
   260    260   int sqlite3OsSleep(sqlite3_vfs *, int);

Changes to src/os_unix.c.

  2470   2470   }
  2471   2471   
  2472   2472   /*
  2473   2473   ** Create a temporary file name in zBuf.  zBuf must be allocated
  2474   2474   ** by the calling process and must be big enough to hold at least
  2475   2475   ** pVfs->mxPathname bytes.
  2476   2476   */
  2477         -static int unixGetTempName(sqlite3_vfs *pVfs, char *zBuf){
         2477  +static int unixGetTempname(sqlite3_vfs *pVfs, char *zBuf){
  2478   2478     static const char *azDirs[] = {
  2479   2479        0,
  2480   2480        "/var/tmp",
  2481   2481        "/usr/tmp",
  2482   2482        "/tmp",
  2483   2483        ".",
  2484   2484     };
................................................................................
  2722   2722       0,                  /* pNext */
  2723   2723       "unix",             /* zName */
  2724   2724       0,                  /* pAppData */
  2725   2725     
  2726   2726       unixOpen,           /* xOpen */
  2727   2727       unixDelete,         /* xDelete */
  2728   2728       unixAccess,         /* xAccess */
  2729         -    unixGetTempName,    /* xGetTempName */
         2729  +    unixGetTempname,    /* xGetTempName */
  2730   2730       unixFullPathname,   /* xFullPathname */
  2731   2731       unixDlOpen,         /* xDlOpen */
  2732   2732       unixDlError,        /* xDlError */
  2733   2733       unixDlSym,          /* xDlSym */
  2734   2734       unixDlClose,        /* xDlClose */
  2735   2735       unixRandomness,     /* xRandomness */
  2736   2736       unixSleep,          /* xSleep */

Changes to src/os_win.c.

  1263   1263   }
  1264   1264   
  1265   1265   
  1266   1266   /*
  1267   1267   ** Create a temporary file name in zBuf.  zBuf must be big enough to
  1268   1268   ** hold at pVfs->mxPathname characters.
  1269   1269   */
  1270         -static int winGetTempName(sqlite3_vfs *pVfs, char *zBuf){
         1270  +static int winGetTempname(sqlite3_vfs *pVfs, char *zBuf){
  1271   1271     static char zChars[] =
  1272   1272       "abcdefghijklmnopqrstuvwxyz"
  1273   1273       "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1274   1274       "0123456789";
  1275   1275     int i, j;
  1276   1276     char zTempPath[MAX_PATH+1];
  1277   1277     if( sqlite3_temp_directory ){
................................................................................
  1523   1523       0,                 /* pNext */
  1524   1524       "win32",           /* zName */
  1525   1525       0,                 /* pAppData */
  1526   1526     
  1527   1527       winOpen,           /* xOpen */
  1528   1528       winDelete,         /* xDelete */
  1529   1529       winAccess,         /* xAccess */
  1530         -    winGetTempName,    /* xGetTempName */
         1530  +    winGetTempname,    /* xGetTempName */
  1531   1531       winFullPathname,   /* xFullPathname */
  1532   1532       winDlOpen,         /* xDlOpen */
  1533   1533       winDlError,        /* xDlError */
  1534   1534       winDlSym,          /* xDlSym */
  1535   1535       winDlClose,        /* xDlClose */
  1536   1536       winRandomness,     /* xRandomness */
  1537   1537       winSleep,          /* xSleep */

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.388 2007/09/10 06:12:04 danielk1977 Exp $
           21  +** @(#) $Id: pager.c,v 1.389 2007/09/17 06:06:39 danielk1977 Exp $
    22     22   */
    23     23   #ifndef SQLITE_OMIT_DISKIO
    24     24   #include "sqliteInt.h"
    25     25   #include <assert.h>
    26     26   #include <string.h>
    27     27   
    28     28   /*
................................................................................
  2050   2050         zPathname[0] = 0;
  2051   2051       }else
  2052   2052   #endif
  2053   2053       {
  2054   2054         rc = sqlite3OsFullPathname(pVfs, zFilename, zPathname);
  2055   2055       }
  2056   2056     }else{
  2057         -    rc = sqlite3OsGetTempName(pVfs, zPathname);
         2057  +    rc = sqlite3OsGetTempname(pVfs, zPathname);
  2058   2058     }
  2059   2059     if( rc!=SQLITE_OK ){
  2060   2060       sqlite3_free(zPathname);
  2061   2061       return rc;
  2062   2062     }
  2063   2063     nPathname = strlen(zPathname);
  2064   2064   

Changes to src/sqlite.h.in.

    26     26   ** on how SQLite interfaces are suppose to operate.
    27     27   **
    28     28   ** The name of this file under configuration management is "sqlite.h.in".
    29     29   ** The makefile makes some minor changes to this file (such as inserting
    30     30   ** the version number) and changes its name to "sqlite3.h" as
    31     31   ** part of the build process.
    32     32   **
    33         -** @(#) $Id: sqlite.h.in,v 1.259 2007/09/04 22:31:37 drh Exp $
           33  +** @(#) $Id: sqlite.h.in,v 1.260 2007/09/17 06:06:39 danielk1977 Exp $
    34     34   */
    35     35   #ifndef _SQLITE3_H_
    36     36   #define _SQLITE3_H_
    37     37   #include <stdarg.h>     /* Needed for the definition of va_list */
    38     38   
    39     39   /*
    40     40   ** Make sure we can call this stuff from C++.
................................................................................
   658    658   ** to test for the existance of a file,
   659    659   ** or [SQLITE_ACCESS_READWRITE] to test to see
   660    660   ** if a file is readable and writable, or [SQLITE_ACCESS_READ]
   661    661   ** to test to see if a file is at least readable.  The file can be a 
   662    662   ** directory.
   663    663   ** 
   664    664   ** SQLite will always allocate at least mxPathname+1 byte for
   665         -** the output buffers for xGetTempName and xFullPathname.
          665  +** the output buffers for xGetTempname and xFullPathname.
   666    666   ** 
   667    667   ** The xRandomness(), xSleep(), and xCurrentTime() interfaces
   668    668   ** are not strictly a part of the filesystem, but they are
   669    669   ** included in the VFS structure for completeness.
   670    670   ** The xRandomness() function attempts to return nBytes bytes
   671    671   ** of good-quality randomness into zOut.  The return value is
   672    672   ** the actual number of bytes of randomness obtained.  The
................................................................................
   683    683     sqlite3_vfs *pNext;      /* Next registered VFS */
   684    684     const char *zName;       /* Name of this virtual file system */
   685    685     void *pAppData;          /* Pointer to application-specific data */
   686    686     int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
   687    687                  int flags, int *pOutFlags);
   688    688     int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
   689    689     int (*xAccess)(sqlite3_vfs*, const char *zName, int flags);
   690         -  int (*xGetTempName)(sqlite3_vfs*, char *zOut);
          690  +  int (*xGetTempname)(sqlite3_vfs*, char *zOut);
   691    691     int (*xFullPathname)(sqlite3_vfs*, const char *zName, char *zOut);
   692    692     void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);
   693    693     void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);
   694    694     void *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol);
   695    695     void (*xDlClose)(sqlite3_vfs*, void*);
   696    696     int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);
   697    697     int (*xSleep)(sqlite3_vfs*, int microseconds);

Changes to src/test6.c.

   564    564     sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
   565    565     return pVfs->xDelete(pVfs, zPath, dirSync);
   566    566   }
   567    567   static int cfAccess(sqlite3_vfs *pCfVfs, const char *zPath, int flags){
   568    568     sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
   569    569     return pVfs->xAccess(pVfs, zPath, flags);
   570    570   }
   571         -static int cfGetTempName(sqlite3_vfs *pCfVfs, char *zBufOut){
          571  +static int cfGetTempname(sqlite3_vfs *pCfVfs, char *zBufOut){
   572    572     sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
   573         -  return pVfs->xGetTempName(pVfs, zBufOut);
          573  +  return pVfs->xGetTempname(pVfs, zBufOut);
   574    574   }
   575    575   static int cfFullPathname(sqlite3_vfs *pCfVfs, const char *zPath, char *zPathOut){
   576    576     sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
   577    577     return pVfs->xFullPathname(pVfs, zPath, zPathOut);
   578    578   }
   579    579   static void *cfDlOpen(sqlite3_vfs *pCfVfs, const char *zPath){
   580    580     sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
................................................................................
   717    717       0,                  /* pNext */
   718    718       "crash",            /* zName */
   719    719       0,                  /* pAppData */
   720    720     
   721    721       cfOpen,               /* xOpen */
   722    722       cfDelete,             /* xDelete */
   723    723       cfAccess,             /* xAccess */
   724         -    cfGetTempName,        /* xGetTempName */
          724  +    cfGetTempname,        /* xGetTempName */
   725    725       cfFullPathname,       /* xFullPathname */
   726    726       cfDlOpen,             /* xDlOpen */
   727    727       cfDlError,            /* xDlError */
   728    728       cfDlSym,              /* xDlSym */
   729    729       cfDlClose,            /* xDlClose */
   730    730       cfRandomness,         /* xRandomness */
   731    731       cfSleep,              /* xSleep */

Changes to src/test_async.c.

   986    986       flags==SQLITE_ACCESS_READ?"read":"exists"
   987    987       , zName, ret)
   988    988     );
   989    989     pthread_mutex_unlock(&async.queueMutex);
   990    990     return ret;
   991    991   }
   992    992   
   993         -static int asyncGetTempName(sqlite3_vfs *pAsyncVfs, char *zBufOut){
          993  +static int asyncGetTempname(sqlite3_vfs *pAsyncVfs, char *zBufOut){
   994    994     sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData;
   995         -  return pVfs->xGetTempName(pVfs, zBufOut);
          995  +  return pVfs->xGetTempname(pVfs, zBufOut);
   996    996   }
   997    997   
   998    998   /*
   999    999   ** Fill in zPathOut with the full path to the file identified by zPath.
  1000   1000   */
  1001   1001   static int asyncFullPathname(
  1002   1002     sqlite3_vfs *pAsyncVfs, 
................................................................................
  1089   1089     0,                    /* mxPathname */
  1090   1090     0,                    /* pNext */
  1091   1091     "async",              /* zName */
  1092   1092     0,                    /* pAppData */
  1093   1093     asyncOpen,            /* xOpen */
  1094   1094     asyncDelete,          /* xDelete */
  1095   1095     asyncAccess,          /* xAccess */
  1096         -  asyncGetTempName,     /* xGetTempName */
         1096  +  asyncGetTempname,     /* xGetTempName */
  1097   1097     asyncFullPathname,    /* xFullPathname */
  1098   1098     asyncDlOpen,          /* xDlOpen */
  1099   1099     asyncDlError,         /* xDlError */
  1100   1100     asyncDlSym,           /* xDlSym */
  1101   1101     asyncDlClose,         /* xDlClose */
  1102   1102     asyncRandomness,      /* xDlError */
  1103   1103     asyncSleep,           /* xDlSym */

Changes to src/test_onefile.c.

   159    159   
   160    160   /*
   161    161   ** Method declarations for fs_vfs.
   162    162   */
   163    163   static int fsOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
   164    164   static int fsDelete(sqlite3_vfs*, const char *zName, int syncDir);
   165    165   static int fsAccess(sqlite3_vfs*, const char *zName, int flags);
   166         -static int fsGetTempName(sqlite3_vfs*, char *zOut);
          166  +static int fsGetTempname(sqlite3_vfs*, char *zOut);
   167    167   static int fsFullPathname(sqlite3_vfs*, const char *zName, char *zOut);
   168    168   static void *fsDlOpen(sqlite3_vfs*, const char *zFilename);
   169    169   static void fsDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
   170    170   static void *fsDlSym(sqlite3_vfs*,void*, const char *zSymbol);
   171    171   static void fsDlClose(sqlite3_vfs*, void*);
   172    172   static int fsRandomness(sqlite3_vfs*, int nByte, char *zOut);
   173    173   static int fsSleep(sqlite3_vfs*, int microseconds);
................................................................................
   188    188       0,                                          /* mxPathname */
   189    189       0,                                          /* pNext */
   190    190       FS_VFS_NAME,                                /* zName */
   191    191       0,                                          /* pAppData */
   192    192       fsOpen,                                     /* xOpen */
   193    193       fsDelete,                                   /* xDelete */
   194    194       fsAccess,                                   /* xAccess */
   195         -    fsGetTempName,                              /* xGetTempName */
          195  +    fsGetTempname,                              /* xGetTempName */
   196    196       fsFullPathname,                             /* xFullPathname */
   197    197       fsDlOpen,                                   /* xDlOpen */
   198    198       fsDlError,                                  /* xDlError */
   199    199       fsDlSym,                                    /* xDlSym */
   200    200       fsDlClose,                                  /* xDlClose */
   201    201       fsRandomness,                               /* xRandomness */
   202    202       fsSleep,                                    /* xSleep */
................................................................................
   722    722   }
   723    723   
   724    724   /*
   725    725   ** Populate buffer zBufOut with a pathname suitable for use as a 
   726    726   ** temporary file. zBufOut is guaranteed to point to a buffer of 
   727    727   ** at least (FS_MAX_PATHNAME+1) bytes.
   728    728   */
   729         -static int fsGetTempName(sqlite3_vfs *pVfs, char *zBufOut){
          729  +static int fsGetTempname(sqlite3_vfs *pVfs, char *zBufOut){
   730    730     sqlite3_vfs *pParent = ((fs_vfs_t *)pVfs)->pParent;
   731         -  return pParent->xGetTempName(pParent, zBufOut);
          731  +  return pParent->xGetTempname(pParent, zBufOut);
   732    732   }
   733    733   
   734    734   /*
   735    735   ** Populate buffer zOut with the full canonical pathname corresponding
   736    736   ** to the pathname in zPath. zOut is guaranteed to point to a buffer
   737    737   ** of at least (FS_MAX_PATHNAME+1) bytes.
   738    738   */