/ Check-in [697b2053]
Login

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

Overview
Comment:Fix harmless compiler warnings in test_fs.c. Fix typos and clean up the text of the documentation for sqlite3_strglob() and sqlite3_strlike().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 697b20534c2d780cdd8cc165d2930f6e56480770
User & Date: drh 2015-11-25 18:40:38
Context
2015-11-25
23:13
Simplify the temporary filename generator and the time-of-day functions in the unix VFS. check-in: 6c5621ce user: drh tags: trunk
18:40
Fix harmless compiler warnings in test_fs.c. Fix typos and clean up the text of the documentation for sqlite3_strglob() and sqlite3_strlike(). check-in: 697b2053 user: drh tags: trunk
18:07
Update test_fs.c to include a virtual table that reads a file-system hierarchy. Use it to further test GLOB and LIKE support for virtual tables. check-in: 6ef6578c user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqlite.h.in.

  7364   7364   */
  7365   7365   int sqlite3_stricmp(const char *, const char *);
  7366   7366   int sqlite3_strnicmp(const char *, const char *, int);
  7367   7367   
  7368   7368   /*
  7369   7369   ** CAPI3REF: String Globbing
  7370   7370   *
  7371         -** ^The [sqlite3_strglob(P,X)] interface returns zero if string X matches
  7372         -** the glob pattern P, and it returns non-zero if string X does not match
  7373         -** the glob pattern P.  ^The definition of glob pattern matching used in
         7371  +** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if
         7372  +** string X matches the [GLOB] pattern P.
         7373  +** ^The definition of [GLOB] pattern matching used in
  7374   7374   ** [sqlite3_strglob(P,X)] is the same as for the "X GLOB P" operator in the
  7375         -** SQL dialect used by SQLite.  ^The sqlite3_strglob(P,X) function is case
  7376         -** sensitive.
         7375  +** SQL dialect understood by SQLite.  ^The [sqlite3_strglob(P,X)] function
         7376  +** is case sensitive.
  7377   7377   **
  7378   7378   ** Note that this routine returns zero on a match and non-zero if the strings
  7379   7379   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7380   7380   **
  7381         -** See also: sqlite3_strlike().
         7381  +** See also: [sqlite3_strlike()].
  7382   7382   */
  7383   7383   int sqlite3_strglob(const char *zGlob, const char *zStr);
  7384   7384   
  7385   7385   /*
  7386   7386   ** CAPI3REF: String LIKE Matching
  7387   7387   *
  7388         -** ^The [sqlite3_strlike(P,X,E)] interface returns zero if string X matches
  7389         -** the LIKE pattern P with escape character E, and it returns non-zero if
  7390         -** string X does not match the like pattern.
  7391         -** ^The definition of LIKE pattern matching used in
         7388  +** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if
         7389  +** string X matches the [LIKE] pattern P with escape character E.
         7390  +** ^The definition of [LIKE] pattern matching used in
  7392   7391   ** [sqlite3_strlike(P,X,E)] is the same as for the "X LIKE P ESCAPE E"
  7393         -** operator in the SQL dialect used by SQLite.  ^For "X LIKE P" without
         7392  +** operator in the SQL dialect understood by SQLite.  ^For "X LIKE P" without
  7394   7393   ** the ESCAPE clause, set the E parameter of [sqlite3_strlike(P,X,E)] to 0.
  7395         -** ^As with the LIKE operator, the [sqlite3_str(P,X,E)] function is case
         7394  +** ^As with the LIKE operator, the [sqlite3_strlike(P,X,E)] function is case
  7396   7395   ** insensitive - equivalent upper and lower case ASCII characters match
  7397   7396   ** one another.
  7398   7397   **
  7399   7398   ** ^The [sqlite3_strlike(P,X,E)] function matches Unicode characters, though
  7400         -** only ASCII characters are case folded.  (This is because when SQLite was
  7401         -** first written, the case folding rules for Unicode where still in flux.)
         7399  +** only ASCII characters are case folded.
  7402   7400   **
  7403   7401   ** Note that this routine returns zero on a match and non-zero if the strings
  7404   7402   ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()].
  7405   7403   **
  7406         -** See also: sqlite3_strglob().
         7404  +** See also: [sqlite3_strglob()].
  7407   7405   */
  7408   7406   int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc);
  7409   7407   
  7410   7408   /*
  7411   7409   ** CAPI3REF: Error Logging Interface
  7412   7410   **
  7413   7411   ** ^The [sqlite3_log()] interface writes a message into the [error log]

Changes to src/test_fs.c.

   237    237   */
   238    238   static int fsdirFilter(
   239    239     sqlite3_vtab_cursor *pVtabCursor, 
   240    240     int idxNum, const char *idxStr,
   241    241     int argc, sqlite3_value **argv
   242    242   ){
   243    243     FsdirCsr *pCsr = (FsdirCsr*)pVtabCursor;
   244         -  int rc;
   245    244     const char *zDir;
   246    245     int nDir;
   247    246   
   248    247   
   249    248     if( idxNum!=1 || argc!=1 ){
   250    249       return SQLITE_ERROR;
   251    250     }
................................................................................
   439    438     fstreeCloseFd(pCsr);
   440    439     rc = sqlite3_step(pCsr->pStmt);
   441    440     if( rc!=SQLITE_ROW ){
   442    441       rc = sqlite3_finalize(pCsr->pStmt);
   443    442       pCsr->pStmt = 0;
   444    443     }else{
   445    444       rc = SQLITE_OK;
   446         -    pCsr->fd = open(sqlite3_column_text(pCsr->pStmt, 0), O_RDONLY);
          445  +    pCsr->fd = open((const char*)sqlite3_column_text(pCsr->pStmt, 0), O_RDONLY);
   447    446     }
   448    447   
   449    448     return rc;
   450    449   }
   451    450   
   452    451   /*
   453    452   ** xFilter method implementation.