/ Check-in [7c51a97d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:sqlite3OsDl*() APIs can be omitted if SQLITE_OMIT_LOAD_EXTENSION defined. (CVS 5171)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7c51a97dc11f20f7323a9dc5c04a3b84380cf8fb
User & Date: shane 2008-05-29 02:53:00
Context
2008-05-29
02:57
Unused functions in testfixture.exe with certain defines. (CVS 5172) check-in: 5e3ff1bb user: shane tags: trunk
02:53
sqlite3OsDl*() APIs can be omitted if SQLITE_OMIT_LOAD_EXTENSION defined. (CVS 5171) check-in: 7c51a97d user: shane tags: trunk
2008-05-28
18:01
Use %llx instead of %x for 64 bit values (this only affects a debugging statement). (CVS 5170) check-in: c81efc97 user: shane tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/os.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains OS interface code that is common to all
    14     14   ** architectures.
    15     15   **
    16         -** $Id: os.c,v 1.108 2008/05/16 04:51:55 danielk1977 Exp $
           16  +** $Id: os.c,v 1.109 2008/05/29 02:53:00 shane Exp $
    17     17   */
    18     18   #define _SQLITE_OS_C_ 1
    19     19   #include "sqliteInt.h"
    20     20   #undef _SQLITE_OS_C_
    21     21   
    22     22   /*
    23     23   ** The default SQLite sqlite3_vfs implementations do not allocate
................................................................................
   133    133     sqlite3_vfs *pVfs, 
   134    134     const char *zPath, 
   135    135     int nPathOut, 
   136    136     char *zPathOut
   137    137   ){
   138    138     return pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut);
   139    139   }
          140  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
   140    141   void *sqlite3OsDlOpen(sqlite3_vfs *pVfs, const char *zPath){
   141    142     return pVfs->xDlOpen(pVfs, zPath);
   142    143   }
   143    144   void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
   144    145     pVfs->xDlError(pVfs, nByte, zBufOut);
   145    146   }
   146    147   void *sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){
   147    148     return pVfs->xDlSym(pVfs, pHandle, zSymbol);
   148    149   }
   149    150   void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){
   150    151     pVfs->xDlClose(pVfs, pHandle);
   151    152   }
          153  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
   152    154   int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
   153    155     return pVfs->xRandomness(pVfs, nByte, zBufOut);
   154    156   }
   155    157   int sqlite3OsSleep(sqlite3_vfs *pVfs, int nMicro){
   156    158     return pVfs->xSleep(pVfs, nMicro);
   157    159   }
   158    160   int sqlite3OsCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){

Changes to src/os.h.

    13     13   ** This header file (together with is companion C source-code file
    14     14   ** "os.c") attempt to abstract the underlying operating system so that
    15     15   ** the SQLite library will work on both POSIX and windows systems.
    16     16   **
    17     17   ** This header file is #include-ed by sqliteInt.h and thus ends up
    18     18   ** being included by every source file.
    19     19   **
    20         -** $Id: os.h,v 1.99 2008/05/16 04:51:55 danielk1977 Exp $
           20  +** $Id: os.h,v 1.100 2008/05/29 02:53:00 shane Exp $
    21     21   */
    22     22   #ifndef _SQLITE_OS_H_
    23     23   #define _SQLITE_OS_H_
    24     24   
    25     25   /*
    26     26   ** Figure out if we are dealing with Unix, Windows, or some other
    27     27   ** operating system.  After the following block of preprocess macros,
................................................................................
   242    242   ** Functions for accessing sqlite3_vfs methods 
   243    243   */
   244    244   int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
   245    245   int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
   246    246   int sqlite3OsAccess(sqlite3_vfs *, const char *, int);
   247    247   int sqlite3OsGetTempname(sqlite3_vfs *, int, char *);
   248    248   int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
          249  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
   249    250   void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
   250    251   void sqlite3OsDlError(sqlite3_vfs *, int, char *);
   251    252   void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *);
   252    253   void sqlite3OsDlClose(sqlite3_vfs *, void *);
          254  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
   253    255   int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
   254    256   int sqlite3OsSleep(sqlite3_vfs *, int);
   255    257   int sqlite3OsCurrentTime(sqlite3_vfs *, double*);
   256    258   
   257    259   /*
   258    260   ** Convenience functions for opening and closing files using 
   259    261   ** sqlite3_malloc() to obtain space for the file-handle structure.

Changes to src/test_devsym.c.

    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that modified the OS layer in order to simulate
    14     14   ** different device types (by overriding the return values of the 
    15     15   ** xDeviceCharacteristics() and xSectorSize() methods).
    16     16   **
    17         -** $Id: test_devsym.c,v 1.4 2008/05/16 04:51:55 danielk1977 Exp $
           17  +** $Id: test_devsym.c,v 1.5 2008/05/29 02:53:00 shane Exp $
    18     18   */
    19     19   #if SQLITE_TEST          /* This file is used for testing only */
    20     20   
    21     21   #include "sqlite3.h"
    22     22   #include "sqliteInt.h"
    23     23   
    24     24   /*
................................................................................
    57     57   ** Method declarations for devsym_vfs.
    58     58   */
    59     59   static int devsymOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
    60     60   static int devsymDelete(sqlite3_vfs*, const char *zName, int syncDir);
    61     61   static int devsymAccess(sqlite3_vfs*, const char *zName, int flags);
    62     62   static int devsymGetTempName(sqlite3_vfs*, int nOut, char *zOut);
    63     63   static int devsymFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
           64  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
    64     65   static void *devsymDlOpen(sqlite3_vfs*, const char *zFilename);
    65     66   static void devsymDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
    66     67   static void *devsymDlSym(sqlite3_vfs*,void*, const char *zSymbol);
    67     68   static void devsymDlClose(sqlite3_vfs*, void*);
           69  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
    68     70   static int devsymRandomness(sqlite3_vfs*, int nByte, char *zOut);
    69     71   static int devsymSleep(sqlite3_vfs*, int microseconds);
    70     72   static int devsymCurrentTime(sqlite3_vfs*, double*);
    71     73   
    72     74   static sqlite3_vfs devsym_vfs = {
    73     75     1,                     /* iVersion */
    74     76     sizeof(devsym_file),      /* szOsFile */
................................................................................
    77     79     DEVSYM_VFS_NAME,          /* zName */
    78     80     0,                     /* pAppData */
    79     81     devsymOpen,               /* xOpen */
    80     82     devsymDelete,             /* xDelete */
    81     83     devsymAccess,             /* xAccess */
    82     84     devsymGetTempName,        /* xGetTempName */
    83     85     devsymFullPathname,       /* xFullPathname */
           86  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
    84     87     devsymDlOpen,             /* xDlOpen */
    85     88     devsymDlError,            /* xDlError */
    86     89     devsymDlSym,              /* xDlSym */
    87     90     devsymDlClose,            /* xDlClose */
           91  +#else
           92  +  0,                        /* xDlOpen */
           93  +  0,                        /* xDlError */
           94  +  0,                        /* xDlSym */
           95  +  0,                        /* xDlClose */
           96  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
    88     97     devsymRandomness,         /* xRandomness */
    89     98     devsymSleep,              /* xSleep */
    90     99     devsymCurrentTime         /* xCurrentTime */
    91    100   };
    92    101   
    93    102   static sqlite3_io_methods devsym_io_methods = {
    94    103     1,                            /* iVersion */
................................................................................
   269    278     const char *zPath, 
   270    279     int nOut, 
   271    280     char *zOut
   272    281   ){
   273    282     return sqlite3OsFullPathname(g.pVfs, zPath, nOut, zOut);
   274    283   }
   275    284   
          285  +#ifndef SQLITE_OMIT_LOAD_EXTENSION
   276    286   /*
   277    287   ** Open the dynamic library located at zPath and return a handle.
   278    288   */
   279    289   static void *devsymDlOpen(sqlite3_vfs *pVfs, const char *zPath){
   280    290     return sqlite3OsDlOpen(g.pVfs, zPath);
   281    291   }
   282    292   
................................................................................
   298    308   
   299    309   /*
   300    310   ** Close the dynamic library handle pHandle.
   301    311   */
   302    312   static void devsymDlClose(sqlite3_vfs *pVfs, void *pHandle){
   303    313     sqlite3OsDlClose(g.pVfs, pHandle);
   304    314   }
          315  +#endif /* SQLITE_OMIT_LOAD_EXTENSION */
   305    316   
   306    317   /*
   307    318   ** Populate the buffer pointed to by zBufOut with nByte bytes of 
   308    319   ** random data.
   309    320   */
   310    321   static int devsymRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
   311    322     return sqlite3OsRandomness(g.pVfs, nByte, zBufOut);