/ Check-in [48ee0e47]
Login

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

Overview
Comment:Move the new genfkey shell command out from within #ifdef _WIN32_ (CVS 6327)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:48ee0e47e2d9669cc7425104e6b04ce49caf2e56
User & Date: drh 2009-02-25 19:07:25
Context
2009-02-26
07:15
In sqlite3_table_column_metadata(), hold the mutex on all attached BtShared objects while accessing schema objects. Fix for #3679. (CVS 6328) check-in: d197afd6 user: danielk1977 tags: trunk
2009-02-25
19:07
Move the new genfkey shell command out from within #ifdef _WIN32_ (CVS 6327) check-in: 48ee0e47 user: drh tags: trunk
15:43
Remove genfkey.c. Change genfkey.README to talk about the new shell dot-command, not the old standalone genfkey program. (CVS 6326) check-in: 36d69966 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code to implement the "sqlite" command line
    13     13   ** utility for accessing SQLite databases.
    14     14   **
    15         -** $Id: shell.c,v 1.203 2009/02/25 15:43:57 danielk1977 Exp $
           15  +** $Id: shell.c,v 1.204 2009/02/25 19:07:25 drh Exp $
    16     16   */
    17     17   #if defined(_WIN32) || defined(WIN32)
    18     18   /* This needs to come before any includes for MSVC compiler */
    19     19   #define _CRT_SECURE_NO_WARNINGS
    20     20   #endif
    21     21   
    22     22   #include <stdlib.h>
................................................................................
    68     68    */
    69     69   #define isatty(x) 1
    70     70   #endif
    71     71   
    72     72   #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL)
    73     73   #include <sys/time.h>
    74     74   #include <sys/resource.h>
           75  +
           76  +/* Saved resource information for the beginning of an operation */
           77  +static struct rusage sBegin;
           78  +
           79  +/* True if the timer is enabled */
           80  +static int enableTimer = 0;
           81  +
           82  +/*
           83  +** Begin timing an operation
           84  +*/
           85  +static void beginTimer(void){
           86  +  if( enableTimer ){
           87  +    getrusage(RUSAGE_SELF, &sBegin);
           88  +  }
           89  +}
           90  +
           91  +/* Return the difference of two time_structs in seconds */
           92  +static double timeDiff(struct timeval *pStart, struct timeval *pEnd){
           93  +  return (pEnd->tv_usec - pStart->tv_usec)*0.000001 + 
           94  +         (double)(pEnd->tv_sec - pStart->tv_sec);
           95  +}
           96  +
           97  +/*
           98  +** Print the timing results.
           99  +*/
          100  +static void endTimer(void){
          101  +  if( enableTimer ){
          102  +    struct rusage sEnd;
          103  +    getrusage(RUSAGE_SELF, &sEnd);
          104  +    printf("CPU Time: user %f sys %f\n",
          105  +       timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
          106  +       timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
          107  +  }
          108  +}
          109  +#define BEGIN_TIMER beginTimer()
          110  +#define END_TIMER endTimer()
          111  +#define HAS_TIMER 1
          112  +#else
          113  +#define BEGIN_TIMER 
          114  +#define END_TIMER
          115  +#define HAS_TIMER 0
          116  +#endif
    75    117   
    76    118   
    77    119   /**************************************************************************
    78    120   ***************************************************************************
    79    121   ** Begin genfkey logic.
    80    122   */
    81    123   #if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined SQLITE_OMIT_SUBQUERY
................................................................................
   909    951   
   910    952   
   911    953   #endif
   912    954   /* End genfkey logic. */
   913    955   /*************************************************************************/
   914    956   /*************************************************************************/
   915    957   
   916         -/* Saved resource information for the beginning of an operation */
   917         -static struct rusage sBegin;
   918         -
   919         -/* True if the timer is enabled */
   920         -static int enableTimer = 0;
   921         -
   922         -/*
   923         -** Begin timing an operation
   924         -*/
   925         -static void beginTimer(void){
   926         -  if( enableTimer ){
   927         -    getrusage(RUSAGE_SELF, &sBegin);
   928         -  }
   929         -}
   930         -
   931         -/* Return the difference of two time_structs in seconds */
   932         -static double timeDiff(struct timeval *pStart, struct timeval *pEnd){
   933         -  return (pEnd->tv_usec - pStart->tv_usec)*0.000001 + 
   934         -         (double)(pEnd->tv_sec - pStart->tv_sec);
   935         -}
   936         -
   937         -/*
   938         -** Print the timing results.
   939         -*/
   940         -static void endTimer(void){
   941         -  if( enableTimer ){
   942         -    struct rusage sEnd;
   943         -    getrusage(RUSAGE_SELF, &sEnd);
   944         -    printf("CPU Time: user %f sys %f\n",
   945         -       timeDiff(&sBegin.ru_utime, &sEnd.ru_utime),
   946         -       timeDiff(&sBegin.ru_stime, &sEnd.ru_stime));
   947         -  }
   948         -}
   949         -#define BEGIN_TIMER beginTimer()
   950         -#define END_TIMER endTimer()
   951         -#define HAS_TIMER 1
   952         -#else
   953         -#define BEGIN_TIMER 
   954         -#define END_TIMER
   955         -#define HAS_TIMER 0
   956         -#endif
   957         -
   958    958   /*
   959    959   ** Used to prevent warnings about unused parameters
   960    960   */
   961    961   #define UNUSED_PARAMETER(x) (void)(x)
   962    962   
   963    963   /*
   964    964   ** If the following flag is set, then command execution stops