Lines Matching refs:pRe

7274 static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){  in re_match()  argument
7290 if( pRe->nInit ){ in re_match()
7291 unsigned char x = pRe->zInit[0]; in re_match()
7292 while( in.i+pRe->nInit<=in.mx in re_match()
7294 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0) in re_match()
7298 if( in.i+pRe->nInit>in.mx ) return 0; in re_match()
7302 if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ in re_match()
7306 pToFree = sqlite3_malloc64( sizeof(ReStateNumber)*2*pRe->nState ); in re_match()
7310 aStateSet[1].aState = &aStateSet[0].aState[pRe->nState]; in re_match()
7316 c = pRe->xNextChar(&in); in re_match()
7323 switch( pRe->aOp[x] ){ in re_match()
7325 if( pRe->aArg[x]==c ) re_add_state(pNext, x+1); in re_match()
7370 re_add_state(pThis, x+pRe->aArg[x]); in re_match()
7375 re_add_state(pThis, x+pRe->aArg[x]); in re_match()
7388 int n = pRe->aArg[x]; in re_match()
7391 if( pRe->aOp[x+j]==RE_OP_CC_VALUE ){ in re_match()
7392 if( pRe->aArg[x+j]==c ){ in re_match()
7397 if( pRe->aArg[x+j]<=c && pRe->aArg[x+j+1]>=c ){ in re_match()
7405 if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit; in re_match()
7414 while( pRe->aOp[x]==RE_OP_GOTO ) x += pRe->aArg[x]; in re_match()
7415 if( pRe->aOp[x]==RE_OP_ACCEPT ){ rc = 1; break; } in re_match()
7709 ReCompiled *pRe = (ReCompiled*)p; in re_free() local
7710 if( pRe ){ in re_free()
7711 sqlite3_free(pRe->aOp); in re_free()
7712 sqlite3_free(pRe->aArg); in re_free()
7713 sqlite3_free(pRe); in re_free()
7724 ReCompiled *pRe; in re_compile() local
7729 pRe = sqlite3_malloc( sizeof(*pRe) ); in re_compile()
7730 if( pRe==0 ){ in re_compile()
7733 memset(pRe, 0, sizeof(*pRe)); in re_compile()
7734 pRe->xNextChar = noCase ? re_next_char_nocase : re_next_char; in re_compile()
7735 if( re_resize(pRe, 30) ){ in re_compile()
7736 re_free(pRe); in re_compile()
7742 re_append(pRe, RE_OP_ANYSTAR, 0); in re_compile()
7744 pRe->sIn.z = (unsigned char*)zIn; in re_compile()
7745 pRe->sIn.i = 0; in re_compile()
7746 pRe->sIn.mx = (int)strlen(zIn); in re_compile()
7747 zErr = re_subcompile_re(pRe); in re_compile()
7749 re_free(pRe); in re_compile()
7752 if( pRe->sIn.i>=pRe->sIn.mx ){ in re_compile()
7753 re_append(pRe, RE_OP_ACCEPT, 0); in re_compile()
7754 *ppRe = pRe; in re_compile()
7756 re_free(pRe); in re_compile()
7768 if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){ in re_compile()
7769 for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){ in re_compile()
7770 unsigned x = pRe->aArg[i]; in re_compile()
7772 pRe->zInit[j++] = (unsigned char)x; in re_compile()
7774 pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); in re_compile()
7775 pRe->zInit[j++] = 0x80 | (x&0x3f); in re_compile()
7777 pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12)); in re_compile()
7778 pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f); in re_compile()
7779 pRe->zInit[j++] = 0x80 | (x&0x3f); in re_compile()
7784 if( j>0 && pRe->zInit[j-1]==0 ) j--; in re_compile()
7785 pRe->nInit = j; in re_compile()
7787 return pRe->zErr; in re_compile()
7804 ReCompiled *pRe; /* Compiled regular expression */ in re_sql_func() local
7811 pRe = sqlite3_get_auxdata(context, 0); in re_sql_func()
7812 if( pRe==0 ){ in re_sql_func()
7815 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0); in re_sql_func()
7817 re_free(pRe); in re_sql_func()
7821 if( pRe==0 ){ in re_sql_func()
7829 sqlite3_result_int(context, re_match(pRe, zStr, -1)); in re_sql_func()
7832 sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); in re_sql_func()
7851 ReCompiled *pRe; in re_bytecode_func() local
7860 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0); in re_bytecode_func()
7862 re_free(pRe); in re_bytecode_func()
7866 if( pRe==0 ){ in re_bytecode_func()
7872 if( pRe->nInit>0 ){ in re_bytecode_func()
7874 for(i=0; i<pRe->nInit; i++){ in re_bytecode_func()
7875 sqlite3_str_appendf(pStr, "%02x", pRe->zInit[i]); in re_bytecode_func()
7879 for(i=0; (unsigned)i<pRe->nState; i++){ in re_bytecode_func()
7881 ReOpName[(unsigned char)pRe->aOp[i]], pRe->aArg[i]); in re_bytecode_func()
7892 re_free(pRe); in re_bytecode_func()