SQLite

Check-in [57dac995dd]
Login

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

Overview
Comment:Remove 'timespec' related code from the shell that has no effect and a (now) superfluous 'timespec' typedef from the Win32 dirent header file.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sqlar-shell-support
Files: files | file ages | folders
SHA3-256: 57dac995dd028e4b7c8ce6806f5769831715c1bb9b886318fceb3fa50563d537
User & Date: mistachkin 2018-01-04 22:50:52.352
Context
2018-01-04
23:49
In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory. (check-in: 4f34440600 user: mistachkin tags: sqlar-shell-support)
22:50
Remove 'timespec' related code from the shell that has no effect and a (now) superfluous 'timespec' typedef from the Win32 dirent header file. (check-in: 57dac995dd user: mistachkin tags: sqlar-shell-support)
22:46
Get the shell enhancements compiling with MSVC. (check-in: 335387f9e0 user: mistachkin tags: sqlar-shell-support)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/shell.c.in.
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
  };
  const char *azSource[] = {
    "sqlar", "zipfile(?3)"
  };



  struct timespec times[2];
  sqlite3_stmt *pSql = 0;
  int rc = SQLITE_OK;
  char *zDir = 0;
  char *zWhere = 0;
  int i;

  /* If arguments are specified, check that they actually exist within







<







4751
4752
4753
4754
4755
4756
4757

4758
4759
4760
4761
4762
4763
4764
  };
  const char *azSource[] = {
    "sqlar", "zipfile(?3)"
  };




  sqlite3_stmt *pSql = 0;
  int rc = SQLITE_OK;
  char *zDir = 0;
  char *zWhere = 0;
  int i;

  /* If arguments are specified, check that they actually exist within
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
      zDir = sqlite3_mprintf("%s/", pAr->zDir);
    }else{
      zDir = sqlite3_mprintf("");
    }
    if( zDir==0 ) rc = SQLITE_NOMEM;
  }

  memset(times, 0, sizeof(times));
  times[0].tv_sec = time(0);

  shellPreparePrintf(db, &rc, &pSql, zSql1, 
      azExtraArg[pAr->bZip], azSource[pAr->bZip], zWhere
  );

  if( rc==SQLITE_OK ){
    sqlite3_bind_text(pSql, 1, zDir, -1, SQLITE_STATIC);
    if( pAr->bZip ){







<
<
<







4772
4773
4774
4775
4776
4777
4778



4779
4780
4781
4782
4783
4784
4785
      zDir = sqlite3_mprintf("%s/", pAr->zDir);
    }else{
      zDir = sqlite3_mprintf("");
    }
    if( zDir==0 ) rc = SQLITE_NOMEM;
  }




  shellPreparePrintf(db, &rc, &pSql, zSql1, 
      azExtraArg[pAr->bZip], azSource[pAr->bZip], zWhere
  );

  if( rc==SQLITE_OK ){
    sqlite3_bind_text(pSql, 1, zDir, -1, SQLITE_STATIC);
    if( pAr->bZip ){
Changes to src/test_windirent.h.
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
typedef struct DIR DIR;
typedef DIR *LPDIR;
struct DIR {
  intptr_t d_handle; /* Value returned by "_findfirst". */
  DIRENT d_first;    /* DIRENT constructed based on "_findfirst". */
  DIRENT d_next;     /* DIRENT constructed based on "_findnext". */
};
#endif

#ifndef TIMESPEC_DEFINED
#define TIMESPEC_DEFINED
typedef struct TIMESPEC TIMESPEC;
typedef TIMESPEC *LPTIMESPEC;
struct TIMESPEC {
  time_t tv_sec; /* Number of whole seconds. */
  long tv_nsec;  /* Number of whole nanoseconds. */
};
#endif

/*
** Provide a macro, for use by the implementation, to determine if a
** particular directory entry should be skipped over when searching for
** the next directory entry that should be returned by the readdir() or
** readdir_r() functions.







<
<
<
<
<
<
<
<
<
<







118
119
120
121
122
123
124










125
126
127
128
129
130
131
typedef struct DIR DIR;
typedef DIR *LPDIR;
struct DIR {
  intptr_t d_handle; /* Value returned by "_findfirst". */
  DIRENT d_first;    /* DIRENT constructed based on "_findfirst". */
  DIRENT d_next;     /* DIRENT constructed based on "_findnext". */
};










#endif

/*
** Provide a macro, for use by the implementation, to determine if a
** particular directory entry should be skipped over when searching for
** the next directory entry that should be returned by the readdir() or
** readdir_r() functions.