Fossil SCM

Improve comment

andygoth 2016-10-23 15:42 andygoth-timeline-ms
Commit c1afe56ffa50bf118c06284413f5a3e680180224
1 file changed +12 -5
+12 -5
--- src/timeline.c
+++ src/timeline.c
@@ -1229,11 +1229,22 @@
12291229
MS_GLOB, /* Matches tags against a list of GLOB patterns. */
12301230
MS_REGEXP /* Matches tags against a list of regular expressions. */
12311231
} MatchStyle;
12321232
12331233
/*
1234
-** Construct the tag match expression.
1234
+** Construct the tag match SQL expression.
1235
+**
1236
+** This function is adapted from glob_expr() to support the MS_EXACT, MS_LIKE,
1237
+** MS_GLOB, and MS_REGEXP match styles. For MS_EXACT, the returned expression
1238
+** checks for integer match against the tag ID which is looked up directly by
1239
+** this function. For the other modes, the returned SQL expression performs
1240
+** string comparisons against the tag names, so it is necessary to join against
1241
+** the tag table to access the "tagname" column.
1242
+**
1243
+** Each pattern is adjusted to to start with "sym-" and be anchored at end.
1244
+**
1245
+** In MS_REGEXP mode, backslash can be used to protect delimiter characters.
12351246
*/
12361247
static const char *tagMatchExpression(
12371248
MatchStyle matchStyle, /* Match style code */
12381249
const char *zTag, /* Tag name, match pattern, or list of patterns */
12391250
int *pCount /* Pointer to match pattern count variable */
@@ -1264,14 +1275,10 @@
12641275
}else/* if( matchStyle==MS_REGEXP )*/{
12651276
zPre = "REGEXP '^sym-";
12661277
zSuf = "$'";
12671278
}
12681279
1269
- /* The following code is glob_expr() modified to support LIKE and REGEXP, plus
1270
- * adjust each pattern to start with "sym-" and be anchored at end. In REGEXP
1271
- * mode, it allows backslash to protect delimiter characters. */
1272
-
12731280
/* Convert the list of matches into an SQL expression. */
12741281
*pCount = 0;
12751282
blob_zero(&blob);
12761283
while( 1 ){
12771284
/* Skip leading delimiters. */
12781285
--- src/timeline.c
+++ src/timeline.c
@@ -1229,11 +1229,22 @@
1229 MS_GLOB, /* Matches tags against a list of GLOB patterns. */
1230 MS_REGEXP /* Matches tags against a list of regular expressions. */
1231 } MatchStyle;
1232
1233 /*
1234 ** Construct the tag match expression.
 
 
 
 
 
 
 
 
 
 
 
1235 */
1236 static const char *tagMatchExpression(
1237 MatchStyle matchStyle, /* Match style code */
1238 const char *zTag, /* Tag name, match pattern, or list of patterns */
1239 int *pCount /* Pointer to match pattern count variable */
@@ -1264,14 +1275,10 @@
1264 }else/* if( matchStyle==MS_REGEXP )*/{
1265 zPre = "REGEXP '^sym-";
1266 zSuf = "$'";
1267 }
1268
1269 /* The following code is glob_expr() modified to support LIKE and REGEXP, plus
1270 * adjust each pattern to start with "sym-" and be anchored at end. In REGEXP
1271 * mode, it allows backslash to protect delimiter characters. */
1272
1273 /* Convert the list of matches into an SQL expression. */
1274 *pCount = 0;
1275 blob_zero(&blob);
1276 while( 1 ){
1277 /* Skip leading delimiters. */
1278
--- src/timeline.c
+++ src/timeline.c
@@ -1229,11 +1229,22 @@
1229 MS_GLOB, /* Matches tags against a list of GLOB patterns. */
1230 MS_REGEXP /* Matches tags against a list of regular expressions. */
1231 } MatchStyle;
1232
1233 /*
1234 ** Construct the tag match SQL expression.
1235 **
1236 ** This function is adapted from glob_expr() to support the MS_EXACT, MS_LIKE,
1237 ** MS_GLOB, and MS_REGEXP match styles. For MS_EXACT, the returned expression
1238 ** checks for integer match against the tag ID which is looked up directly by
1239 ** this function. For the other modes, the returned SQL expression performs
1240 ** string comparisons against the tag names, so it is necessary to join against
1241 ** the tag table to access the "tagname" column.
1242 **
1243 ** Each pattern is adjusted to to start with "sym-" and be anchored at end.
1244 **
1245 ** In MS_REGEXP mode, backslash can be used to protect delimiter characters.
1246 */
1247 static const char *tagMatchExpression(
1248 MatchStyle matchStyle, /* Match style code */
1249 const char *zTag, /* Tag name, match pattern, or list of patterns */
1250 int *pCount /* Pointer to match pattern count variable */
@@ -1264,14 +1275,10 @@
1275 }else/* if( matchStyle==MS_REGEXP )*/{
1276 zPre = "REGEXP '^sym-";
1277 zSuf = "$'";
1278 }
1279
 
 
 
 
1280 /* Convert the list of matches into an SQL expression. */
1281 *pCount = 0;
1282 blob_zero(&blob);
1283 while( 1 ){
1284 /* Skip leading delimiters. */
1285

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button