Lines Matching full:exec
3028 xmlFARegExecSave(xmlRegExecCtxtPtr exec) { in xmlFARegExecSave() argument
3030 if (exec->nbPush > MAX_PUSH) { in xmlFARegExecSave()
3031 exec->status = XML_REGEXP_INTERNAL_LIMIT; in xmlFARegExecSave()
3034 exec->nbPush++; in xmlFARegExecSave()
3037 if (exec->maxRollbacks == 0) { in xmlFARegExecSave()
3038 exec->maxRollbacks = 4; in xmlFARegExecSave()
3039 exec->rollbacks = (xmlRegExecRollback *) xmlMalloc(exec->maxRollbacks * in xmlFARegExecSave()
3041 if (exec->rollbacks == NULL) { in xmlFARegExecSave()
3042 exec->maxRollbacks = 0; in xmlFARegExecSave()
3043 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSave()
3046 memset(exec->rollbacks, 0, in xmlFARegExecSave()
3047 exec->maxRollbacks * sizeof(xmlRegExecRollback)); in xmlFARegExecSave()
3048 } else if (exec->nbRollbacks >= exec->maxRollbacks) { in xmlFARegExecSave()
3050 int len = exec->maxRollbacks; in xmlFARegExecSave()
3052 exec->maxRollbacks *= 2; in xmlFARegExecSave()
3053 tmp = (xmlRegExecRollback *) xmlRealloc(exec->rollbacks, in xmlFARegExecSave()
3054 exec->maxRollbacks * sizeof(xmlRegExecRollback)); in xmlFARegExecSave()
3056 exec->maxRollbacks /= 2; in xmlFARegExecSave()
3057 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSave()
3060 exec->rollbacks = tmp; in xmlFARegExecSave()
3061 tmp = &exec->rollbacks[len]; in xmlFARegExecSave()
3062 memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback)); in xmlFARegExecSave()
3064 exec->rollbacks[exec->nbRollbacks].state = exec->state; in xmlFARegExecSave()
3065 exec->rollbacks[exec->nbRollbacks].index = exec->index; in xmlFARegExecSave()
3066 exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1; in xmlFARegExecSave()
3067 if (exec->comp->nbCounters > 0) { in xmlFARegExecSave()
3068 if (exec->rollbacks[exec->nbRollbacks].counts == NULL) { in xmlFARegExecSave()
3069 exec->rollbacks[exec->nbRollbacks].counts = (int *) in xmlFARegExecSave()
3070 xmlMalloc(exec->comp->nbCounters * sizeof(int)); in xmlFARegExecSave()
3071 if (exec->rollbacks[exec->nbRollbacks].counts == NULL) { in xmlFARegExecSave()
3072 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSave()
3076 memcpy(exec->rollbacks[exec->nbRollbacks].counts, exec->counts, in xmlFARegExecSave()
3077 exec->comp->nbCounters * sizeof(int)); in xmlFARegExecSave()
3079 exec->nbRollbacks++; in xmlFARegExecSave()
3083 xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) { in xmlFARegExecRollBack() argument
3084 if (exec->status != XML_REGEXP_OK) in xmlFARegExecRollBack()
3086 if (exec->nbRollbacks <= 0) { in xmlFARegExecRollBack()
3087 exec->status = XML_REGEXP_NOT_FOUND; in xmlFARegExecRollBack()
3090 exec->nbRollbacks--; in xmlFARegExecRollBack()
3091 exec->state = exec->rollbacks[exec->nbRollbacks].state; in xmlFARegExecRollBack()
3092 exec->index = exec->rollbacks[exec->nbRollbacks].index; in xmlFARegExecRollBack()
3093 exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch; in xmlFARegExecRollBack()
3094 if (exec->comp->nbCounters > 0) { in xmlFARegExecRollBack()
3095 if (exec->rollbacks[exec->nbRollbacks].counts == NULL) { in xmlFARegExecRollBack()
3096 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExecRollBack()
3099 if (exec->counts) { in xmlFARegExecRollBack()
3100 memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts, in xmlFARegExecRollBack()
3101 exec->comp->nbCounters * sizeof(int)); in xmlFARegExecRollBack()
3115 xmlRegExecCtxtPtr exec = &execval; in xmlFARegExec() local
3118 exec->inputString = content; in xmlFARegExec()
3119 exec->index = 0; in xmlFARegExec()
3120 exec->nbPush = 0; in xmlFARegExec()
3121 exec->determinist = 1; in xmlFARegExec()
3122 exec->maxRollbacks = 0; in xmlFARegExec()
3123 exec->nbRollbacks = 0; in xmlFARegExec()
3124 exec->rollbacks = NULL; in xmlFARegExec()
3125 exec->status = XML_REGEXP_OK; in xmlFARegExec()
3126 exec->comp = comp; in xmlFARegExec()
3127 exec->state = comp->states[0]; in xmlFARegExec()
3128 exec->transno = 0; in xmlFARegExec()
3129 exec->transcount = 0; in xmlFARegExec()
3130 exec->inputStack = NULL; in xmlFARegExec()
3131 exec->inputStackMax = 0; in xmlFARegExec()
3133 exec->counts = (int *) xmlMalloc(comp->nbCounters * sizeof(int)); in xmlFARegExec()
3134 if (exec->counts == NULL) { in xmlFARegExec()
3137 memset(exec->counts, 0, comp->nbCounters * sizeof(int)); in xmlFARegExec()
3139 exec->counts = NULL; in xmlFARegExec()
3140 while ((exec->status == XML_REGEXP_OK) && (exec->state != NULL) && in xmlFARegExec()
3141 ((exec->inputString[exec->index] != 0) || in xmlFARegExec()
3142 ((exec->state != NULL) && in xmlFARegExec()
3143 (exec->state->type != XML_REGEXP_FINAL_STATE)))) { in xmlFARegExec()
3155 if ((exec->inputString[exec->index] == 0) && (exec->counts == NULL)) { in xmlFARegExec()
3160 if (exec->transno < exec->state->nbTrans) { in xmlFARegExec()
3161 trans = &exec->state->trans[exec->transno]; in xmlFARegExec()
3171 exec->transcount = 0; in xmlFARegExec()
3172 for (;exec->transno < exec->state->nbTrans;exec->transno++) { in xmlFARegExec()
3173 trans = &exec->state->trans[exec->transno]; in xmlFARegExec()
3183 if (exec->counts == NULL) { in xmlFARegExec()
3184 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3191 count = exec->counts[trans->count]; in xmlFARegExec()
3192 counter = &exec->comp->counters[trans->count]; in xmlFARegExec()
3197 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3199 } else if (exec->inputString[exec->index] != 0) { in xmlFARegExec()
3201 codepoint = xmlGetUTF8Char(&exec->inputString[exec->index], in xmlFARegExec()
3204 exec->status = XML_REGEXP_INVALID_UTF8; in xmlFARegExec()
3220 if ((exec->counts == NULL) || in xmlFARegExec()
3221 (exec->comp == NULL) || in xmlFARegExec()
3222 (exec->comp->counters == NULL)) { in xmlFARegExec()
3223 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3226 counter = &exec->comp->counters[trans->counter]; in xmlFARegExec()
3227 if (exec->counts[trans->counter] >= counter->max) in xmlFARegExec()
3231 if (exec->state->nbTrans > exec->transno + 1) { in xmlFARegExec()
3232 xmlFARegExecSave(exec); in xmlFARegExec()
3233 if (exec->status != XML_REGEXP_OK) in xmlFARegExec()
3237 exec->counts[trans->counter]++; in xmlFARegExec()
3239 exec->transcount = 1; in xmlFARegExec()
3244 if (exec->transcount == atom->max) { in xmlFARegExec()
3247 exec->index += len; in xmlFARegExec()
3251 if (exec->inputString[exec->index] == 0) { in xmlFARegExec()
3252 exec->index -= len; in xmlFARegExec()
3255 if (exec->transcount >= atom->min) { in xmlFARegExec()
3256 int transno = exec->transno; in xmlFARegExec()
3257 xmlRegStatePtr state = exec->state; in xmlFARegExec()
3262 exec->transno = -1; /* trick */ in xmlFARegExec()
3263 exec->state = to; in xmlFARegExec()
3264 xmlFARegExecSave(exec); in xmlFARegExec()
3265 if (exec->status != XML_REGEXP_OK) in xmlFARegExec()
3267 exec->transno = transno; in xmlFARegExec()
3268 exec->state = state; in xmlFARegExec()
3272 &exec->inputString[exec->index], &len); in xmlFARegExec()
3274 exec->status = XML_REGEXP_INVALID_UTF8; in xmlFARegExec()
3278 exec->transcount++; in xmlFARegExec()
3280 if (exec->transcount < atom->min) in xmlFARegExec()
3293 if (exec->counts == NULL) { in xmlFARegExec()
3294 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3297 exec->counts[trans->counter]--; in xmlFARegExec()
3305 exec->transcount = 1; in xmlFARegExec()
3311 exec->transcount = 1; in xmlFARegExec()
3318 (exec->state->nbTrans > exec->transno + 1))) { in xmlFARegExec()
3319 xmlFARegExecSave(exec); in xmlFARegExec()
3320 if (exec->status != XML_REGEXP_OK) in xmlFARegExec()
3327 if ((exec->counts == NULL) || in xmlFARegExec()
3328 (exec->comp == NULL) || in xmlFARegExec()
3329 (exec->comp->counters == NULL)) { in xmlFARegExec()
3330 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3333 counter = &exec->comp->counters[trans->counter]; in xmlFARegExec()
3334 if (exec->counts[trans->counter] >= counter->max) in xmlFARegExec()
3336 exec->counts[trans->counter]++; in xmlFARegExec()
3340 if (exec->counts == NULL) { in xmlFARegExec()
3341 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3344 exec->counts[trans->count] = 0; in xmlFARegExec()
3346 exec->state = comp->states[trans->to]; in xmlFARegExec()
3347 exec->transno = 0; in xmlFARegExec()
3349 exec->index += len; in xmlFARegExec()
3353 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlFARegExec()
3357 if ((exec->transno != 0) || (exec->state->nbTrans == 0)) { in xmlFARegExec()
3362 exec->determinist = 0; in xmlFARegExec()
3363 xmlFARegExecRollBack(exec); in xmlFARegExec()
3369 if (exec->rollbacks != NULL) { in xmlFARegExec()
3370 if (exec->counts != NULL) { in xmlFARegExec()
3373 for (i = 0;i < exec->maxRollbacks;i++) in xmlFARegExec()
3374 if (exec->rollbacks[i].counts != NULL) in xmlFARegExec()
3375 xmlFree(exec->rollbacks[i].counts); in xmlFARegExec()
3377 xmlFree(exec->rollbacks); in xmlFARegExec()
3379 if (exec->state == NULL) in xmlFARegExec()
3381 if (exec->counts != NULL) in xmlFARegExec()
3382 xmlFree(exec->counts); in xmlFARegExec()
3383 if (exec->status == XML_REGEXP_OK) in xmlFARegExec()
3385 if (exec->status == XML_REGEXP_NOT_FOUND) in xmlFARegExec()
3387 return(exec->status); in xmlFARegExec()
3409 xmlRegExecCtxtPtr exec; in xmlRegNewExecCtxt() local
3415 exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt)); in xmlRegNewExecCtxt()
3416 if (exec == NULL) in xmlRegNewExecCtxt()
3418 memset(exec, 0, sizeof(xmlRegExecCtxt)); in xmlRegNewExecCtxt()
3419 exec->inputString = NULL; in xmlRegNewExecCtxt()
3420 exec->index = 0; in xmlRegNewExecCtxt()
3421 exec->determinist = 1; in xmlRegNewExecCtxt()
3422 exec->maxRollbacks = 0; in xmlRegNewExecCtxt()
3423 exec->nbRollbacks = 0; in xmlRegNewExecCtxt()
3424 exec->rollbacks = NULL; in xmlRegNewExecCtxt()
3425 exec->status = XML_REGEXP_OK; in xmlRegNewExecCtxt()
3426 exec->comp = comp; in xmlRegNewExecCtxt()
3428 exec->state = comp->states[0]; in xmlRegNewExecCtxt()
3429 exec->transno = 0; in xmlRegNewExecCtxt()
3430 exec->transcount = 0; in xmlRegNewExecCtxt()
3431 exec->callback = callback; in xmlRegNewExecCtxt()
3432 exec->data = data; in xmlRegNewExecCtxt()
3435 * For error handling, exec->counts is allocated twice the size in xmlRegNewExecCtxt()
3438 exec->counts = (int *) xmlMalloc(comp->nbCounters * sizeof(int) in xmlRegNewExecCtxt()
3440 if (exec->counts == NULL) { in xmlRegNewExecCtxt()
3441 xmlFree(exec); in xmlRegNewExecCtxt()
3444 memset(exec->counts, 0, comp->nbCounters * sizeof(int) * 2); in xmlRegNewExecCtxt()
3445 exec->errCounts = &exec->counts[comp->nbCounters]; in xmlRegNewExecCtxt()
3447 exec->counts = NULL; in xmlRegNewExecCtxt()
3448 exec->errCounts = NULL; in xmlRegNewExecCtxt()
3450 exec->inputStackMax = 0; in xmlRegNewExecCtxt()
3451 exec->inputStackNr = 0; in xmlRegNewExecCtxt()
3452 exec->inputStack = NULL; in xmlRegNewExecCtxt()
3453 exec->errStateNo = -1; in xmlRegNewExecCtxt()
3454 exec->errString = NULL; in xmlRegNewExecCtxt()
3455 exec->nbPush = 0; in xmlRegNewExecCtxt()
3456 return(exec); in xmlRegNewExecCtxt()
3461 * @exec: a regular expression evaluation context
3466 xmlRegFreeExecCtxt(xmlRegExecCtxtPtr exec) { in xmlRegFreeExecCtxt() argument
3467 if (exec == NULL) in xmlRegFreeExecCtxt()
3470 if (exec->rollbacks != NULL) { in xmlRegFreeExecCtxt()
3471 if (exec->counts != NULL) { in xmlRegFreeExecCtxt()
3474 for (i = 0;i < exec->maxRollbacks;i++) in xmlRegFreeExecCtxt()
3475 if (exec->rollbacks[i].counts != NULL) in xmlRegFreeExecCtxt()
3476 xmlFree(exec->rollbacks[i].counts); in xmlRegFreeExecCtxt()
3478 xmlFree(exec->rollbacks); in xmlRegFreeExecCtxt()
3480 if (exec->counts != NULL) in xmlRegFreeExecCtxt()
3481 xmlFree(exec->counts); in xmlRegFreeExecCtxt()
3482 if (exec->inputStack != NULL) { in xmlRegFreeExecCtxt()
3485 for (i = 0;i < exec->inputStackNr;i++) { in xmlRegFreeExecCtxt()
3486 if (exec->inputStack[i].value != NULL) in xmlRegFreeExecCtxt()
3487 xmlFree(exec->inputStack[i].value); in xmlRegFreeExecCtxt()
3489 xmlFree(exec->inputStack); in xmlRegFreeExecCtxt()
3491 if (exec->errString != NULL) in xmlRegFreeExecCtxt()
3492 xmlFree(exec->errString); in xmlRegFreeExecCtxt()
3493 xmlFree(exec); in xmlRegFreeExecCtxt()
3497 xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) { in xmlRegExecSetErrString() argument
3498 if (exec->errString != NULL) in xmlRegExecSetErrString()
3499 xmlFree(exec->errString); in xmlRegExecSetErrString()
3501 exec->errString = NULL; in xmlRegExecSetErrString()
3503 exec->errString = xmlStrdup(value); in xmlRegExecSetErrString()
3504 if (exec->errString == NULL) { in xmlRegExecSetErrString()
3505 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlRegExecSetErrString()
3513 xmlFARegExecSaveInputString(xmlRegExecCtxtPtr exec, const xmlChar *value, in xmlFARegExecSaveInputString() argument
3515 if (exec->inputStackMax == 0) { in xmlFARegExecSaveInputString()
3516 exec->inputStackMax = 4; in xmlFARegExecSaveInputString()
3517 exec->inputStack = (xmlRegInputTokenPtr) in xmlFARegExecSaveInputString()
3518 xmlMalloc(exec->inputStackMax * sizeof(xmlRegInputToken)); in xmlFARegExecSaveInputString()
3519 if (exec->inputStack == NULL) { in xmlFARegExecSaveInputString()
3520 exec->inputStackMax = 0; in xmlFARegExecSaveInputString()
3521 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSaveInputString()
3524 } else if (exec->inputStackNr + 1 >= exec->inputStackMax) { in xmlFARegExecSaveInputString()
3527 exec->inputStackMax *= 2; in xmlFARegExecSaveInputString()
3528 tmp = (xmlRegInputTokenPtr) xmlRealloc(exec->inputStack, in xmlFARegExecSaveInputString()
3529 exec->inputStackMax * sizeof(xmlRegInputToken)); in xmlFARegExecSaveInputString()
3531 exec->inputStackMax /= 2; in xmlFARegExecSaveInputString()
3532 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSaveInputString()
3535 exec->inputStack = tmp; in xmlFARegExecSaveInputString()
3538 exec->inputStack[exec->inputStackNr].value = NULL; in xmlFARegExecSaveInputString()
3540 exec->inputStack[exec->inputStackNr].value = xmlStrdup(value); in xmlFARegExecSaveInputString()
3541 if (exec->inputStack[exec->inputStackNr].value == NULL) { in xmlFARegExecSaveInputString()
3542 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlFARegExecSaveInputString()
3546 exec->inputStack[exec->inputStackNr].data = data; in xmlFARegExecSaveInputString()
3547 exec->inputStackNr++; in xmlFARegExecSaveInputString()
3548 exec->inputStack[exec->inputStackNr].value = NULL; in xmlFARegExecSaveInputString()
3549 exec->inputStack[exec->inputStackNr].data = NULL; in xmlFARegExecSaveInputString()
3604 * @exec: a regexp execution context
3605 * @comp: the precompiled exec with a compact table
3615 xmlRegCompactPushString(xmlRegExecCtxtPtr exec, in xmlRegCompactPushString() argument
3619 int state = exec->index; in xmlRegCompactPushString()
3643 exec->index = target; in xmlRegCompactPushString()
3644 if ((exec->callback != NULL) && (comp->transdata != NULL)) { in xmlRegCompactPushString()
3645 exec->callback(exec->data, value, in xmlRegCompactPushString()
3664 exec->errStateNo = state; in xmlRegCompactPushString()
3665 exec->status = XML_REGEXP_NOT_FOUND; in xmlRegCompactPushString()
3666 xmlRegExecSetErrString(exec, value); in xmlRegCompactPushString()
3667 return(exec->status); in xmlRegCompactPushString()
3672 * @exec: a regexp execution context or NULL to indicate the end
3683 xmlRegExecPushStringInternal(xmlRegExecCtxtPtr exec, const xmlChar *value, in xmlRegExecPushStringInternal() argument
3691 if (exec == NULL) in xmlRegExecPushStringInternal()
3693 if (exec->comp == NULL) in xmlRegExecPushStringInternal()
3695 if (exec->status != XML_REGEXP_OK) in xmlRegExecPushStringInternal()
3696 return(exec->status); in xmlRegExecPushStringInternal()
3698 if (exec->comp->compact != NULL) in xmlRegExecPushStringInternal()
3699 return(xmlRegCompactPushString(exec, exec->comp, value, data)); in xmlRegExecPushStringInternal()
3702 if (exec->state->type == XML_REGEXP_FINAL_STATE) in xmlRegExecPushStringInternal()
3711 if ((value != NULL) && (exec->inputStackNr > 0)) { in xmlRegExecPushStringInternal()
3712 xmlFARegExecSaveInputString(exec, value, data); in xmlRegExecPushStringInternal()
3713 value = exec->inputStack[exec->index].value; in xmlRegExecPushStringInternal()
3714 data = exec->inputStack[exec->index].data; in xmlRegExecPushStringInternal()
3717 while ((exec->status == XML_REGEXP_OK) && in xmlRegExecPushStringInternal()
3720 (exec->state->type != XML_REGEXP_FINAL_STATE)))) { in xmlRegExecPushStringInternal()
3727 if ((value == NULL) && (exec->counts == NULL)) in xmlRegExecPushStringInternal()
3730 exec->transcount = 0; in xmlRegExecPushStringInternal()
3731 for (;exec->transno < exec->state->nbTrans;exec->transno++) { in xmlRegExecPushStringInternal()
3732 trans = &exec->state->trans[exec->transno]; in xmlRegExecPushStringInternal()
3751 for (i = 0;i < exec->state->nbTrans;i++) { in xmlRegExecPushStringInternal()
3752 t = &exec->state->trans[i]; in xmlRegExecPushStringInternal()
3755 counter = &exec->comp->counters[t->counter]; in xmlRegExecPushStringInternal()
3756 count = exec->counts[t->counter]; in xmlRegExecPushStringInternal()
3783 for (i = 0;i < exec->state->nbTrans;i++) { in xmlRegExecPushStringInternal()
3784 t = &exec->state->trans[i]; in xmlRegExecPushStringInternal()
3787 counter = &exec->comp->counters[t->counter]; in xmlRegExecPushStringInternal()
3788 count = exec->counts[t->counter]; in xmlRegExecPushStringInternal()
3802 count = exec->counts[trans->count]; in xmlRegExecPushStringInternal()
3803 counter = &exec->comp->counters[trans->count]; in xmlRegExecPushStringInternal()
3806 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlRegExecPushStringInternal()
3819 count = exec->counts[trans->counter]; in xmlRegExecPushStringInternal()
3820 counter = &exec->comp->counters[trans->counter]; in xmlRegExecPushStringInternal()
3826 xmlRegStatePtr to = exec->comp->states[trans->to]; in xmlRegExecPushStringInternal()
3831 if (exec->state->nbTrans > exec->transno + 1) { in xmlRegExecPushStringInternal()
3832 if (exec->inputStackNr <= 0) { in xmlRegExecPushStringInternal()
3833 xmlFARegExecSaveInputString(exec, value, data); in xmlRegExecPushStringInternal()
3835 xmlFARegExecSave(exec); in xmlRegExecPushStringInternal()
3837 exec->transcount = 1; in xmlRegExecPushStringInternal()
3842 if (exec->transcount == atom->max) { in xmlRegExecPushStringInternal()
3845 exec->index++; in xmlRegExecPushStringInternal()
3846 value = exec->inputStack[exec->index].value; in xmlRegExecPushStringInternal()
3847 data = exec->inputStack[exec->index].data; in xmlRegExecPushStringInternal()
3853 exec->index --; in xmlRegExecPushStringInternal()
3856 if (exec->transcount >= atom->min) { in xmlRegExecPushStringInternal()
3857 int transno = exec->transno; in xmlRegExecPushStringInternal()
3858 xmlRegStatePtr state = exec->state; in xmlRegExecPushStringInternal()
3863 exec->transno = -1; /* trick */ in xmlRegExecPushStringInternal()
3864 exec->state = to; in xmlRegExecPushStringInternal()
3865 if (exec->inputStackNr <= 0) { in xmlRegExecPushStringInternal()
3866 xmlFARegExecSaveInputString(exec, value, data); in xmlRegExecPushStringInternal()
3868 xmlFARegExecSave(exec); in xmlRegExecPushStringInternal()
3869 exec->transno = transno; in xmlRegExecPushStringInternal()
3870 exec->state = state; in xmlRegExecPushStringInternal()
3873 exec->transcount++; in xmlRegExecPushStringInternal()
3875 if (exec->transcount < atom->min) in xmlRegExecPushStringInternal()
3890 if ((exec->callback != NULL) && (atom != NULL) && in xmlRegExecPushStringInternal()
3892 exec->callback(exec->data, atom->valuep, in xmlRegExecPushStringInternal()
3895 if (exec->state->nbTrans > exec->transno + 1) { in xmlRegExecPushStringInternal()
3896 if (exec->inputStackNr <= 0) { in xmlRegExecPushStringInternal()
3897 xmlFARegExecSaveInputString(exec, value, data); in xmlRegExecPushStringInternal()
3899 xmlFARegExecSave(exec); in xmlRegExecPushStringInternal()
3902 exec->counts[trans->counter]++; in xmlRegExecPushStringInternal()
3906 exec->counts[trans->count] = 0; in xmlRegExecPushStringInternal()
3908 if ((exec->comp->states[trans->to] != NULL) && in xmlRegExecPushStringInternal()
3909 (exec->comp->states[trans->to]->type == in xmlRegExecPushStringInternal()
3915 if (xmlRegExecSetErrString(exec, value) < 0) in xmlRegExecPushStringInternal()
3917 exec->errState = exec->state; in xmlRegExecPushStringInternal()
3918 memcpy(exec->errCounts, exec->counts, in xmlRegExecPushStringInternal()
3919 exec->comp->nbCounters * sizeof(int)); in xmlRegExecPushStringInternal()
3921 exec->state = exec->comp->states[trans->to]; in xmlRegExecPushStringInternal()
3922 exec->transno = 0; in xmlRegExecPushStringInternal()
3924 if (exec->inputStack != NULL) { in xmlRegExecPushStringInternal()
3925 exec->index++; in xmlRegExecPushStringInternal()
3926 if (exec->index < exec->inputStackNr) { in xmlRegExecPushStringInternal()
3927 value = exec->inputStack[exec->index].value; in xmlRegExecPushStringInternal()
3928 data = exec->inputStack[exec->index].data; in xmlRegExecPushStringInternal()
3940 exec->status = XML_REGEXP_INTERNAL_ERROR; in xmlRegExecPushStringInternal()
3944 if ((exec->transno != 0) || (exec->state->nbTrans == 0)) { in xmlRegExecPushStringInternal()
3950 if ((progress) && (exec->state != NULL) && in xmlRegExecPushStringInternal()
3951 (exec->state->type != XML_REGEXP_SINK_STATE)) { in xmlRegExecPushStringInternal()
3953 if (xmlRegExecSetErrString(exec, value) < 0) in xmlRegExecPushStringInternal()
3955 exec->errState = exec->state; in xmlRegExecPushStringInternal()
3956 if (exec->comp->nbCounters) in xmlRegExecPushStringInternal()
3957 memcpy(exec->errCounts, exec->counts, in xmlRegExecPushStringInternal()
3958 exec->comp->nbCounters * sizeof(int)); in xmlRegExecPushStringInternal()
3964 exec->determinist = 0; in xmlRegExecPushStringInternal()
3965 xmlFARegExecRollBack(exec); in xmlRegExecPushStringInternal()
3966 if ((exec->inputStack != NULL ) && in xmlRegExecPushStringInternal()
3967 (exec->status == XML_REGEXP_OK)) { in xmlRegExecPushStringInternal()
3968 value = exec->inputStack[exec->index].value; in xmlRegExecPushStringInternal()
3969 data = exec->inputStack[exec->index].data; in xmlRegExecPushStringInternal()
3976 if (exec->status == XML_REGEXP_OK) { in xmlRegExecPushStringInternal()
3977 return(exec->state->type == XML_REGEXP_FINAL_STATE); in xmlRegExecPushStringInternal()
3979 return(exec->status); in xmlRegExecPushStringInternal()
3984 * @exec: a regexp execution context or NULL to indicate the end
3994 xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar *value, in xmlRegExecPushString() argument
3996 return(xmlRegExecPushStringInternal(exec, value, data, 0)); in xmlRegExecPushString()
4001 * @exec: a regexp execution context or NULL to indicate the end
4012 xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value, in xmlRegExecPushString2() argument
4018 if (exec == NULL) in xmlRegExecPushString2()
4020 if (exec->comp == NULL) in xmlRegExecPushString2()
4022 if (exec->status != XML_REGEXP_OK) in xmlRegExecPushString2()
4023 return(exec->status); in xmlRegExecPushString2()
4026 return(xmlRegExecPushString(exec, value, data)); in xmlRegExecPushString2()
4034 exec->status = XML_REGEXP_OUT_OF_MEMORY; in xmlRegExecPushString2()
4045 if (exec->comp->compact != NULL) in xmlRegExecPushString2()
4046 ret = xmlRegCompactPushString(exec, exec->comp, str, data); in xmlRegExecPushString2()
4048 ret = xmlRegExecPushStringInternal(exec, str, data, 1); in xmlRegExecPushString2()
4057 * @exec: a regexp execution context
4070 xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err, in xmlRegExecGetValues() argument
4076 if ((exec == NULL) || (nbval == NULL) || (nbneg == NULL) || in xmlRegExecGetValues()
4083 if ((exec->comp != NULL) && (exec->comp->compact != NULL)) { in xmlRegExecGetValues()
4087 comp = exec->comp; in xmlRegExecGetValues()
4090 if (exec->errStateNo == -1) return(-1); in xmlRegExecGetValues()
4091 state = exec->errStateNo; in xmlRegExecGetValues()
4093 state = exec->index; in xmlRegExecGetValues()
4127 if (exec->state->type == XML_REGEXP_FINAL_STATE) in xmlRegExecGetValues()
4134 if (exec->errState == NULL) return(-1); in xmlRegExecGetValues()
4135 state = exec->errState; in xmlRegExecGetValues()
4137 if (exec->state == NULL) return(-1); in xmlRegExecGetValues()
4138 state = exec->state; in xmlRegExecGetValues()
4158 count = exec->errCounts[trans->counter]; in xmlRegExecGetValues()
4160 count = exec->counts[trans->counter]; in xmlRegExecGetValues()
4161 if (exec->comp != NULL) in xmlRegExecGetValues()
4162 counter = &exec->comp->counters[trans->counter]; in xmlRegExecGetValues()
4171 if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) && in xmlRegExecGetValues()
4172 (exec->comp->states[trans->to]->type != in xmlRegExecGetValues()
4198 if ((exec->comp->states[trans->to] != NULL) && in xmlRegExecGetValues()
4199 (exec->comp->states[trans->to]->type == in xmlRegExecGetValues()
4215 * @exec: a regexp execution context
4225 * returned will be freed with the @exec context and don't need to be
4231 xmlRegExecNextValues(xmlRegExecCtxtPtr exec, int *nbval, int *nbneg, in xmlRegExecNextValues() argument
4233 return(xmlRegExecGetValues(exec, 0, nbval, nbneg, values, terminal)); in xmlRegExecNextValues()
4238 * @exec: a regexp execution context generating an error
4250 * returned will be freed with the @exec context and don't need to be
4256 xmlRegExecErrInfo(xmlRegExecCtxtPtr exec, const xmlChar **string, in xmlRegExecErrInfo() argument
4258 if (exec == NULL) in xmlRegExecErrInfo()
4261 if (exec->status != XML_REGEXP_OK) in xmlRegExecErrInfo()
4262 *string = exec->errString; in xmlRegExecErrInfo()
4266 return(xmlRegExecGetValues(exec, 1, nbval, nbneg, values, terminal)); in xmlRegExecErrInfo()