Lines Matching refs:pRe
3970 static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){
3986 if( pRe->nInit ){
3987 unsigned char x = pRe->zInit[0];
3988 while( in.i+pRe->nInit<=in.mx
3990 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
3994 if( in.i+pRe->nInit>in.mx ) return 0;
3998 if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){
4002 pToFree = sqlite3_malloc64( sizeof(ReStateNumber)*2*pRe->nState );
4006 aStateSet[1].aState = &aStateSet[0].aState[pRe->nState];
4012 c = pRe->xNextChar(&in);
4019 switch( pRe->aOp[x] ){
4021 if( pRe->aArg[x]==c ) re_add_state(pNext, x+1);
4066 re_add_state(pThis, x+pRe->aArg[x]);
4071 re_add_state(pThis, x+pRe->aArg[x]);
4084 int n = pRe->aArg[x];
4087 if( pRe->aOp[x+j]==RE_OP_CC_VALUE ){
4088 if( pRe->aArg[x+j]==c ){
4093 if( pRe->aArg[x+j]<=c && pRe->aArg[x+j+1]>=c ){
4101 if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit;
4110 while( pRe->aOp[x]==RE_OP_GOTO ) x += pRe->aArg[x];
4111 if( pRe->aOp[x]==RE_OP_ACCEPT ){ rc = 1; break; }
4404 static void re_free(ReCompiled *pRe){
4405 if( pRe ){
4406 sqlite3_free(pRe->aOp);
4407 sqlite3_free(pRe->aArg);
4408 sqlite3_free(pRe);
4419 ReCompiled *pRe;
4424 pRe = sqlite3_malloc( sizeof(*pRe) );
4425 if( pRe==0 ){
4428 memset(pRe, 0, sizeof(*pRe));
4429 pRe->xNextChar = noCase ? re_next_char_nocase : re_next_char;
4430 if( re_resize(pRe, 30) ){
4431 re_free(pRe);
4437 re_append(pRe, RE_OP_ANYSTAR, 0);
4439 pRe->sIn.z = (unsigned char*)zIn;
4440 pRe->sIn.i = 0;
4441 pRe->sIn.mx = (int)strlen(zIn);
4442 zErr = re_subcompile_re(pRe);
4444 re_free(pRe);
4447 if( pRe->sIn.i>=pRe->sIn.mx ){
4448 re_append(pRe, RE_OP_ACCEPT, 0);
4449 *ppRe = pRe;
4451 re_free(pRe);
4463 if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){
4464 for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){
4465 unsigned x = pRe->aArg[i];
4467 pRe->zInit[j++] = (unsigned char)x;
4469 pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6));
4470 pRe->zInit[j++] = 0x80 | (x&0x3f);
4472 pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12));
4473 pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f);
4474 pRe->zInit[j++] = 0x80 | (x&0x3f);
4479 if( j>0 && pRe->zInit[j-1]==0 ) j--;
4480 pRe->nInit = j;
4482 return pRe->zErr;
4499 ReCompiled *pRe; /* Compiled regular expression */
4506 pRe = sqlite3_get_auxdata(context, 0);
4507 if( pRe==0 ){
4510 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0);
4512 re_free(pRe);
4516 if( pRe==0 ){
4524 sqlite3_result_int(context, re_match(pRe, zStr, -1));
4527 sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free);
4546 ReCompiled *pRe;
4554 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0);
4556 re_free(pRe);
4560 if( pRe==0 ){
4566 if( pRe->nInit>0 ){
4568 for(i=0; i<pRe->nInit; i++){
4569 sqlite3_str_appendf(pStr, "%02x", pRe->zInit[i]);
4573 for(i=0; (unsigned)i<pRe->nState; i++){
4575 ReOpName[(unsigned char)pRe->aOp[i]], pRe->aArg[i]);
4586 re_free(pRe);