Fossil

Check-in [1219bffc]
Login

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

Overview
Comment:Add comments describing each local variable in tagMatchExpression()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | andygoth-timeline-ms
Files: files | file ages | folders
SHA1:1219bffce072e7cb18ca8458b70f8bb01f45f22b
User & Date: andygoth 2016-10-24 15:52:35
Context
2016-10-24
18:32
Merge changes.wiki style update check-in: 780c0150 user: andygoth tags: andygoth-timeline-ms
15:52
Add comments describing each local variable in tagMatchExpression() check-in: 1219bffc user: andygoth tags: andygoth-timeline-ms
15:47
Inconsequential whitespace changes check-in: 9ffc5017 user: andygoth tags: andygoth-timeline-ms
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255




1256
1257
1258
1259
1260
1261
1262
** In MS_REGEXP mode, backslash can be used to protect delimiter characters.
*/
static const char *tagMatchExpression(
  MatchStyle matchStyle,  /* Match style code */
  const char *zTag,       /* Tag name, match pattern, or list of patterns */
  int *pCount             /* Pointer to match pattern count variable */
){
  Blob blob = BLOB_INITIALIZER;
  const char *zStart, *zDelimiter, *zEnd, *zPrefix, *zSuffix;
  char cDel;
  int i;





  /* Optimize exact matches by looking up the ID in advance to create a simple
   * numeric comparison.  Bypass the remainder of this function. */
  if( matchStyle==MS_EXACT ){
    *pCount = 1;
    return mprintf("(tagid=%d)", db_int(-1,
        "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTag));







|
|
|
|
>
>
>
>







1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
** In MS_REGEXP mode, backslash can be used to protect delimiter characters.
*/
static const char *tagMatchExpression(
  MatchStyle matchStyle,  /* Match style code */
  const char *zTag,       /* Tag name, match pattern, or list of patterns */
  int *pCount             /* Pointer to match pattern count variable */
){
  Blob blob = BLOB_INITIALIZER;  /* SQL expression string assembly buffer */
  const char *zStart;            /* Text at start of expression */
  const char *zDelimiter;        /* Text between expression terms */
  const char *zEnd;              /* Text at end of expression */
  const char *zPrefix;           /* Text before each match pattern */
  const char *zSuffix;           /* Text after each match pattern */
  char cDel;                     /* Input delimiter character */
  int i;                         /* Input match pattern length counter */

  /* Optimize exact matches by looking up the ID in advance to create a simple
   * numeric comparison.  Bypass the remainder of this function. */
  if( matchStyle==MS_EXACT ){
    *pCount = 1;
    return mprintf("(tagid=%d)", db_int(-1,
        "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTag));