Lines Matching refs:pRe
6492 static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){ in re_match() argument
6508 if( pRe->nInit ){ in re_match()
6509 unsigned char x = pRe->zInit[0]; in re_match()
6510 while( in.i+pRe->nInit<=in.mx in re_match()
6512 strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0) in re_match()
6516 if( in.i+pRe->nInit>in.mx ) return 0; in re_match()
6520 if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ in re_match()
6524 pToFree = sqlite3_malloc64( sizeof(ReStateNumber)*2*pRe->nState ); in re_match()
6528 aStateSet[1].aState = &aStateSet[0].aState[pRe->nState]; in re_match()
6534 c = pRe->xNextChar(&in); in re_match()
6541 switch( pRe->aOp[x] ){ in re_match()
6543 if( pRe->aArg[x]==c ) re_add_state(pNext, x+1); in re_match()
6588 re_add_state(pThis, x+pRe->aArg[x]); in re_match()
6593 re_add_state(pThis, x+pRe->aArg[x]); in re_match()
6606 int n = pRe->aArg[x]; in re_match()
6609 if( pRe->aOp[x+j]==RE_OP_CC_VALUE ){ in re_match()
6610 if( pRe->aArg[x+j]==c ){ in re_match()
6615 if( pRe->aArg[x+j]<=c && pRe->aArg[x+j+1]>=c ){ in re_match()
6623 if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit; in re_match()
6632 while( pRe->aOp[x]==RE_OP_GOTO ) x += pRe->aArg[x]; in re_match()
6633 if( pRe->aOp[x]==RE_OP_ACCEPT ){ rc = 1; break; } in re_match()
6926 static void re_free(ReCompiled *pRe){ in re_free() argument
6927 if( pRe ){ in re_free()
6928 sqlite3_free(pRe->aOp); in re_free()
6929 sqlite3_free(pRe->aArg); in re_free()
6930 sqlite3_free(pRe); in re_free()
6941 ReCompiled *pRe; in re_compile() local
6946 pRe = sqlite3_malloc( sizeof(*pRe) ); in re_compile()
6947 if( pRe==0 ){ in re_compile()
6950 memset(pRe, 0, sizeof(*pRe)); in re_compile()
6951 pRe->xNextChar = noCase ? re_next_char_nocase : re_next_char; in re_compile()
6952 if( re_resize(pRe, 30) ){ in re_compile()
6953 re_free(pRe); in re_compile()
6959 re_append(pRe, RE_OP_ANYSTAR, 0); in re_compile()
6961 pRe->sIn.z = (unsigned char*)zIn; in re_compile()
6962 pRe->sIn.i = 0; in re_compile()
6963 pRe->sIn.mx = (int)strlen(zIn); in re_compile()
6964 zErr = re_subcompile_re(pRe); in re_compile()
6966 re_free(pRe); in re_compile()
6969 if( pRe->sIn.i>=pRe->sIn.mx ){ in re_compile()
6970 re_append(pRe, RE_OP_ACCEPT, 0); in re_compile()
6971 *ppRe = pRe; in re_compile()
6973 re_free(pRe); in re_compile()
6985 if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){ in re_compile()
6986 for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){ in re_compile()
6987 unsigned x = pRe->aArg[i]; in re_compile()
6989 pRe->zInit[j++] = (unsigned char)x; in re_compile()
6991 pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); in re_compile()
6992 pRe->zInit[j++] = 0x80 | (x&0x3f); in re_compile()
6994 pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12)); in re_compile()
6995 pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f); in re_compile()
6996 pRe->zInit[j++] = 0x80 | (x&0x3f); in re_compile()
7001 if( j>0 && pRe->zInit[j-1]==0 ) j--; in re_compile()
7002 pRe->nInit = j; in re_compile()
7004 return pRe->zErr; in re_compile()
7021 ReCompiled *pRe; /* Compiled regular expression */ in re_sql_func() local
7028 pRe = sqlite3_get_auxdata(context, 0); in re_sql_func()
7029 if( pRe==0 ){ in re_sql_func()
7032 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0); in re_sql_func()
7034 re_free(pRe); in re_sql_func()
7038 if( pRe==0 ){ in re_sql_func()
7046 sqlite3_result_int(context, re_match(pRe, zStr, -1)); in re_sql_func()
7049 sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); in re_sql_func()
7068 ReCompiled *pRe; in re_bytecode_func() local
7077 zErr = re_compile(&pRe, zPattern, sqlite3_user_data(context)!=0); in re_bytecode_func()
7079 re_free(pRe); in re_bytecode_func()
7083 if( pRe==0 ){ in re_bytecode_func()
7089 if( pRe->nInit>0 ){ in re_bytecode_func()
7091 for(i=0; i<pRe->nInit; i++){ in re_bytecode_func()
7092 sqlite3_str_appendf(pStr, "%02x", pRe->zInit[i]); in re_bytecode_func()
7096 for(i=0; (unsigned)i<pRe->nState; i++){ in re_bytecode_func()
7098 ReOpName[(unsigned char)pRe->aOp[i]], pRe->aArg[i]); in re_bytecode_func()
7109 re_free(pRe); in re_bytecode_func()