Fossil SCM
s/re_exec\b/re_execute/g, for compatibility with BSD.
Commit
6a26eb349743852f9c215d9cc5a9f6b2adfecaf3
Parent
8fec4c959c430c3…
2 files changed
+1
-1
+6
-6
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -423,11 +423,11 @@ | ||
| 423 | 423 | ReCompiled *pRe, /* The regular expression to be matched */ |
| 424 | 424 | DLine *aDLine, /* First of N DLines to compare against */ |
| 425 | 425 | int N /* Number of DLines to check */ |
| 426 | 426 | ){ |
| 427 | 427 | while( N-- ){ |
| 428 | - if( re_exec(pRe, aDLine->z, LENGTH(aDLine)) ){ | |
| 428 | + if( re_execute(pRe, aDLine->z, LENGTH(aDLine)) ){ | |
| 429 | 429 | return 1; |
| 430 | 430 | } |
| 431 | 431 | aDLine++; |
| 432 | 432 | } |
| 433 | 433 | return 0; |
| 434 | 434 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -423,11 +423,11 @@ | |
| 423 | ReCompiled *pRe, /* The regular expression to be matched */ |
| 424 | DLine *aDLine, /* First of N DLines to compare against */ |
| 425 | int N /* Number of DLines to check */ |
| 426 | ){ |
| 427 | while( N-- ){ |
| 428 | if( re_exec(pRe, aDLine->z, LENGTH(aDLine)) ){ |
| 429 | return 1; |
| 430 | } |
| 431 | aDLine++; |
| 432 | } |
| 433 | return 0; |
| 434 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -423,11 +423,11 @@ | |
| 423 | ReCompiled *pRe, /* The regular expression to be matched */ |
| 424 | DLine *aDLine, /* First of N DLines to compare against */ |
| 425 | int N /* Number of DLines to check */ |
| 426 | ){ |
| 427 | while( N-- ){ |
| 428 | if( re_execute(pRe, aDLine->z, LENGTH(aDLine)) ){ |
| 429 | return 1; |
| 430 | } |
| 431 | aDLine++; |
| 432 | } |
| 433 | return 0; |
| 434 |
+6
-6
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -178,11 +178,11 @@ | ||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | 182 | */ |
| 183 | -int re_exec(ReCompiled *pRe, const unsigned char *zIn, int nIn){ | |
| 183 | +int re_execute(ReCompiled *pRe, const unsigned char *zIn, int nIn){ | |
| 184 | 184 | ReStateSet aStateSet[2], *pThis, *pNext; |
| 185 | 185 | ReStateNumber aSpace[100]; |
| 186 | 186 | ReStateNumber *pToFree; |
| 187 | 187 | unsigned int i = 0; |
| 188 | 188 | unsigned int iSwap = 0; |
| @@ -275,11 +275,11 @@ | ||
| 275 | 275 | re_add_state(pThis, x+pRe->aArg[x]); |
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | case RE_OP_ACCEPT: { |
| 279 | 279 | rc = 1; |
| 280 | - goto re_exec_end; | |
| 280 | + goto re_execute_end; | |
| 281 | 281 | } |
| 282 | 282 | case RE_OP_CC_INC: |
| 283 | 283 | case RE_OP_CC_EXC: { |
| 284 | 284 | int j = 1; |
| 285 | 285 | int n = pRe->aArg[x]; |
| @@ -307,11 +307,11 @@ | ||
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | for(i=0; i<pNext->nState; i++){ |
| 310 | 310 | if( pRe->aOp[pNext->aState[i]]==RE_OP_ACCEPT ){ rc = 1; break; } |
| 311 | 311 | } |
| 312 | -re_exec_end: | |
| 312 | +re_execute_end: | |
| 313 | 313 | fossil_free(pToFree); |
| 314 | 314 | return rc; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /* Resize the opcode and argument arrays for an RE under construction. |
| @@ -599,11 +599,11 @@ | ||
| 599 | 599 | } |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | /* |
| 603 | 603 | ** Compile a textual regular expression in zIn[] into a compiled regular |
| 604 | -** expression suitable for us by re_exec() and return a pointer to the | |
| 604 | +** expression suitable for us by re_execute() and return a pointer to the | |
| 605 | 605 | ** compiled regular expression in *ppRe. Return NULL on success or an |
| 606 | 606 | ** error message if something goes wrong. |
| 607 | 607 | */ |
| 608 | 608 | const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ |
| 609 | 609 | ReCompiled *pRe; |
| @@ -700,11 +700,11 @@ | ||
| 700 | 700 | } |
| 701 | 701 | sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); |
| 702 | 702 | } |
| 703 | 703 | zStr = (const unsigned char*)sqlite3_value_text(argv[1]); |
| 704 | 704 | if( zStr!=0 ){ |
| 705 | - sqlite3_result_int(context, re_exec(pRe, zStr, -1)); | |
| 705 | + sqlite3_result_int(context, re_execute(pRe, zStr, -1)); | |
| 706 | 706 | } |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | 709 | /* |
| 710 | 710 | ** Invoke this routine in order to install the REGEXP function in an |
| @@ -731,11 +731,11 @@ | ||
| 731 | 731 | char zLine[2000]; |
| 732 | 732 | while( fgets(zLine, sizeof(zLine), in) ){ |
| 733 | 733 | ln++; |
| 734 | 734 | n = (int)strlen(zLine); |
| 735 | 735 | while( n && (zLine[n-1]=='\n' || zLine[n-1]=='\r') ) n--; |
| 736 | - if( re_exec(pRe, (const unsigned char*)zLine, n) ){ | |
| 736 | + if( re_execute(pRe, (const unsigned char*)zLine, n) ){ | |
| 737 | 737 | printf("%s:%d:%.*s\n", zFile, ln, n, zLine); |
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -178,11 +178,11 @@ | |
| 178 | } |
| 179 | |
| 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | */ |
| 183 | int re_exec(ReCompiled *pRe, const unsigned char *zIn, int nIn){ |
| 184 | ReStateSet aStateSet[2], *pThis, *pNext; |
| 185 | ReStateNumber aSpace[100]; |
| 186 | ReStateNumber *pToFree; |
| 187 | unsigned int i = 0; |
| 188 | unsigned int iSwap = 0; |
| @@ -275,11 +275,11 @@ | |
| 275 | re_add_state(pThis, x+pRe->aArg[x]); |
| 276 | break; |
| 277 | } |
| 278 | case RE_OP_ACCEPT: { |
| 279 | rc = 1; |
| 280 | goto re_exec_end; |
| 281 | } |
| 282 | case RE_OP_CC_INC: |
| 283 | case RE_OP_CC_EXC: { |
| 284 | int j = 1; |
| 285 | int n = pRe->aArg[x]; |
| @@ -307,11 +307,11 @@ | |
| 307 | } |
| 308 | } |
| 309 | for(i=0; i<pNext->nState; i++){ |
| 310 | if( pRe->aOp[pNext->aState[i]]==RE_OP_ACCEPT ){ rc = 1; break; } |
| 311 | } |
| 312 | re_exec_end: |
| 313 | fossil_free(pToFree); |
| 314 | return rc; |
| 315 | } |
| 316 | |
| 317 | /* Resize the opcode and argument arrays for an RE under construction. |
| @@ -599,11 +599,11 @@ | |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | /* |
| 603 | ** Compile a textual regular expression in zIn[] into a compiled regular |
| 604 | ** expression suitable for us by re_exec() and return a pointer to the |
| 605 | ** compiled regular expression in *ppRe. Return NULL on success or an |
| 606 | ** error message if something goes wrong. |
| 607 | */ |
| 608 | const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ |
| 609 | ReCompiled *pRe; |
| @@ -700,11 +700,11 @@ | |
| 700 | } |
| 701 | sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); |
| 702 | } |
| 703 | zStr = (const unsigned char*)sqlite3_value_text(argv[1]); |
| 704 | if( zStr!=0 ){ |
| 705 | sqlite3_result_int(context, re_exec(pRe, zStr, -1)); |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | /* |
| 710 | ** Invoke this routine in order to install the REGEXP function in an |
| @@ -731,11 +731,11 @@ | |
| 731 | char zLine[2000]; |
| 732 | while( fgets(zLine, sizeof(zLine), in) ){ |
| 733 | ln++; |
| 734 | n = (int)strlen(zLine); |
| 735 | while( n && (zLine[n-1]=='\n' || zLine[n-1]=='\r') ) n--; |
| 736 | if( re_exec(pRe, (const unsigned char*)zLine, n) ){ |
| 737 | printf("%s:%d:%.*s\n", zFile, ln, n, zLine); |
| 738 | } |
| 739 | } |
| 740 | } |
| 741 | |
| 742 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -178,11 +178,11 @@ | |
| 178 | } |
| 179 | |
| 180 | /* Run a compiled regular expression on the zero-terminated input |
| 181 | ** string zIn[]. Return true on a match and false if there is no match. |
| 182 | */ |
| 183 | int re_execute(ReCompiled *pRe, const unsigned char *zIn, int nIn){ |
| 184 | ReStateSet aStateSet[2], *pThis, *pNext; |
| 185 | ReStateNumber aSpace[100]; |
| 186 | ReStateNumber *pToFree; |
| 187 | unsigned int i = 0; |
| 188 | unsigned int iSwap = 0; |
| @@ -275,11 +275,11 @@ | |
| 275 | re_add_state(pThis, x+pRe->aArg[x]); |
| 276 | break; |
| 277 | } |
| 278 | case RE_OP_ACCEPT: { |
| 279 | rc = 1; |
| 280 | goto re_execute_end; |
| 281 | } |
| 282 | case RE_OP_CC_INC: |
| 283 | case RE_OP_CC_EXC: { |
| 284 | int j = 1; |
| 285 | int n = pRe->aArg[x]; |
| @@ -307,11 +307,11 @@ | |
| 307 | } |
| 308 | } |
| 309 | for(i=0; i<pNext->nState; i++){ |
| 310 | if( pRe->aOp[pNext->aState[i]]==RE_OP_ACCEPT ){ rc = 1; break; } |
| 311 | } |
| 312 | re_execute_end: |
| 313 | fossil_free(pToFree); |
| 314 | return rc; |
| 315 | } |
| 316 | |
| 317 | /* Resize the opcode and argument arrays for an RE under construction. |
| @@ -599,11 +599,11 @@ | |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | /* |
| 603 | ** Compile a textual regular expression in zIn[] into a compiled regular |
| 604 | ** expression suitable for us by re_execute() and return a pointer to the |
| 605 | ** compiled regular expression in *ppRe. Return NULL on success or an |
| 606 | ** error message if something goes wrong. |
| 607 | */ |
| 608 | const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ |
| 609 | ReCompiled *pRe; |
| @@ -700,11 +700,11 @@ | |
| 700 | } |
| 701 | sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); |
| 702 | } |
| 703 | zStr = (const unsigned char*)sqlite3_value_text(argv[1]); |
| 704 | if( zStr!=0 ){ |
| 705 | sqlite3_result_int(context, re_execute(pRe, zStr, -1)); |
| 706 | } |
| 707 | } |
| 708 | |
| 709 | /* |
| 710 | ** Invoke this routine in order to install the REGEXP function in an |
| @@ -731,11 +731,11 @@ | |
| 731 | char zLine[2000]; |
| 732 | while( fgets(zLine, sizeof(zLine), in) ){ |
| 733 | ln++; |
| 734 | n = (int)strlen(zLine); |
| 735 | while( n && (zLine[n-1]=='\n' || zLine[n-1]=='\r') ) n--; |
| 736 | if( re_execute(pRe, (const unsigned char*)zLine, n) ){ |
| 737 | printf("%s:%d:%.*s\n", zFile, ln, n, zLine); |
| 738 | } |
| 739 | } |
| 740 | } |
| 741 | |
| 742 |