Lines Matching defs:states
319 int nbState; /* the number of states */
372 xmlRelaxNGStatesPtr states; /* the accumulated state list */
374 xmlRelaxNGStatesPtr freeState; /* the pool of free valid states */
1023 xmlRngVErrMemory(ctxt, "allocating states\n");
1032 xmlRngVErrMemory(ctxt, "allocating states\n");
1042 * @states: the states container
1052 xmlRelaxNGStatesPtr states,
1058 if (states->nbState >= states->maxState) {
1062 size = states->maxState * 2;
1063 tmp = (xmlRelaxNGValidStatePtr *) xmlRealloc(states->tabState,
1068 xmlRngVErrMemory(ctxt, "adding states\n");
1071 states->tabState = tmp;
1072 states->maxState = size;
1074 states->tabState[states->nbState++] = state;
1081 * @states: the states container
1090 xmlRelaxNGStatesPtr states,
1098 if (states->nbState >= states->maxState) {
1102 size = states->maxState * 2;
1103 tmp = (xmlRelaxNGValidStatePtr *) xmlRealloc(states->tabState,
1108 xmlRngVErrMemory(ctxt, "adding states\n");
1111 states->tabState = tmp;
1112 states->maxState = size;
1114 for (i = 0; i < states->nbState; i++) {
1115 if (xmlRelaxNGEqualValidState(ctxt, state, states->tabState[i])) {
1120 states->tabState[states->nbState++] = state;
1127 * @states: teh container
1133 xmlRelaxNGStatesPtr states)
1135 if (states == NULL)
1143 xmlRngVErrMemory(ctxt, "storing states\n");
1154 xmlRngVErrMemory(ctxt, "storing states\n");
1155 xmlFree(states->tabState);
1156 xmlFree(states);
1163 xmlFree(states->tabState);
1164 xmlFree(states);
1166 ctxt->freeStates[ctxt->freeStatesNr++] = states;
1210 xmlRngVErrMemory(ctxt, "allocating states\n");
1234 xmlRngVErrMemory(ctxt, "allocating states\n");
1243 xmlRngVErrMemory(ctxt, "allocating states\n");
1292 xmlRngVErrMemory(ctxt, "allocating states\n");
1308 xmlRngVErrMemory(ctxt, "allocating states\n");
1318 xmlRngVErrMemory(ctxt, "allocating states\n");
1337 * Compare the validation states for equality
8100 } else if (ctxt->states != NULL) {
8105 for (i = 0; i < ctxt->states->nbState; i++) {
8106 state = ctxt->states->tabState[i];
8122 for (i = 0; i < ctxt->states->nbState; i++) {
8123 xmlRelaxNGFreeValidState(ctxt, ctxt->states->tabState[i]);
8125 xmlRelaxNGFreeStates(ctxt, ctxt->states);
8126 ctxt->states = NULL;
9038 if ((ctxt->state != NULL) || (ctxt->states != NULL)) {
9272 } else if (ctxt->states != NULL) {
9282 for (j = 0; j < ctxt->states->nbState; j++) {
9283 cur = ctxt->states->tabState[j]->seq;
9287 lowattr = ctxt->states->tabState[j]->nbAttrLeft;
9291 if (ctxt->states->tabState[j]->nbAttrLeft <= lowattr) {
9293 lowattr = ctxt->states->tabState[j]->nbAttrLeft;
9300 lowattr = ctxt->states->tabState[j]->nbAttrLeft;
9303 if (ctxt->states->tabState[j]->nbAttrLeft <= lowattr) {
9305 lowattr = ctxt->states->tabState[j]->nbAttrLeft;
9313 if (ctxt->states->nbState > 0) {
9316 oldstate = ctxt->states->tabState[best];
9317 ctxt->states->tabState[best] = NULL;
9320 ctxt->states->tabState[ctxt->states->nbState - 1];
9321 ctxt->states->tabState[ctxt->states->nbState - 1] = NULL;
9324 for (j = 0; j < ctxt->states->nbState ; j++) {
9325 xmlRelaxNGFreeValidState(ctxt, ctxt->states->tabState[j]);
9327 xmlRelaxNGFreeStates(ctxt, ctxt->states);
9328 ctxt->states = NULL;
9397 if ((ctxt->state != NULL) || (ctxt->states != NULL)) {
9530 * Find the "best" state in the ctxt->states list of states to report
9545 if ((ctxt == NULL) || (ctxt->states == NULL) ||
9546 (ctxt->states->nbState <= 0))
9549 for (i = 0; i < ctxt->states->nbState; i++) {
9550 state = ctxt->states->tabState[i];
9573 * Find the "best" state in the ctxt->states list of states to report
9581 if ((ctxt == NULL) || (ctxt->states == NULL) ||
9582 (ctxt->states->nbState <= 0))
9586 if ((best >= 0) && (best < ctxt->states->nbState)) {
9587 ctxt->state = ctxt->states->tabState[best];
9776 xmlRelaxNGStatesPtr tmpstates = ctxt->states;
9781 ctxt->states = NULL;
9788 ctxt->states = tmpstates;
9799 if (ctxt->states != NULL) {
9802 for (i = 0; i < ctxt->states->nbState; i++) {
9803 state = ctxt->states->tabState[i];
9819 for (i = 0; i < ctxt->states->nbState; i++) {
9821 ctxt->states->
9824 xmlRelaxNGFreeStates(ctxt, ctxt->states);
9826 ctxt->states = NULL;
9856 if (ctxt->states != NULL) {
9859 for (i = 0; i < ctxt->states->nbState; i++) {
9860 state = ctxt->states->tabState[i];
9875 for (i = 0; i < ctxt->states->nbState; i++) {
9877 ctxt->states->
9880 xmlRelaxNGFreeStates(ctxt, ctxt->states);
9882 ctxt->states = NULL;
9947 if (ctxt->states != NULL) {
9948 xmlRelaxNGAddStates(ctxt, ctxt->states, oldstate);
9950 ctxt->states = xmlRelaxNGNewStates(ctxt, 1);
9951 if (ctxt->states == NULL) {
9959 xmlRelaxNGAddStates(ctxt, ctxt->states, oldstate);
9960 xmlRelaxNGAddStates(ctxt, ctxt->states, ctxt->state);
9980 xmlRelaxNGStatesPtr states = NULL, res = NULL;
9990 * All the input states are also exit states
9998 for (j = 0; j < ctxt->states->nbState; j++) {
10002 states->
10013 if (ctxt->states != NULL) {
10014 states = ctxt->states;
10015 for (i = 0; i < states->nbState; i++) {
10016 ctxt->state = states->tabState[i];
10017 ctxt->states = NULL;
10028 } else if (ctxt->states != NULL) {
10029 for (j = 0; j < ctxt->states->nbState;
10034 states->
10041 ctxt->states);
10042 ctxt->states = NULL;
10067 } else if (ctxt->states != NULL) {
10068 for (j = 0; j < ctxt->states->nbState; j++) {
10071 states->
10076 if (states == NULL) {
10077 states = ctxt->states;
10080 ctxt->states);
10082 ctxt->states = NULL;
10097 if (states == NULL) {
10100 states = ctxt->states;
10101 if (states == NULL) {
10106 states->nbState = 0;
10108 xmlRelaxNGAddStates(ctxt, states,
10112 ctxt->states = states;
10116 if (states != NULL) {
10117 xmlRelaxNGFreeStates(ctxt, states);
10119 ctxt->states = res;
10133 xmlRelaxNGStatesPtr states = NULL;
10191 if (states == NULL) {
10192 states = xmlRelaxNGNewStates(ctxt, 1);
10195 xmlRelaxNGAddStates(ctxt, states, ctxt->state);
10196 } else if (ctxt->states != NULL) {
10197 for (i = 0; i < ctxt->states->nbState; i++) {
10198 xmlRelaxNGAddStates(ctxt, states,
10199 ctxt->states->
10202 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10203 ctxt->states = NULL;
10211 if (states != NULL) {
10213 ctxt->states = states;
10217 ctxt->states = NULL;
10423 xmlRelaxNGStatesPtr states, res;
10427 * We should NOT have both ctxt->state and ctxt->states
10429 if ((ctxt->state != NULL) && (ctxt->states != NULL)) {
10434 if ((ctxt->states == NULL) || (ctxt->states->nbState == 1)) {
10435 if (ctxt->states != NULL) {
10436 ctxt->state = ctxt->states->tabState[0];
10437 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10438 ctxt->states = NULL;
10441 if ((ctxt->state != NULL) && (ctxt->states != NULL)) {
10445 if ((ctxt->states != NULL) && (ctxt->states->nbState == 1)) {
10446 ctxt->state = ctxt->states->tabState[0];
10447 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10448 ctxt->states = NULL;
10453 states = ctxt->states;
10454 ctxt->states = NULL;
10459 for (i = 0; i < states->nbState; i++) {
10460 ctxt->state = states->tabState[i];
10461 ctxt->states = NULL;
10464 * We should NOT have both ctxt->state and ctxt->states
10466 if ((ctxt->state != NULL) && (ctxt->states != NULL)) {
10471 if (ctxt->states == NULL) {
10477 /* add the state directly in states */
10478 states->tabState[j++] = ctxt->state;
10484 res = ctxt->states;
10485 ctxt->states = NULL;
10488 states->tabState[k]);
10491 for (k = 0; k < ctxt->states->nbState; k++)
10493 ctxt->states->tabState[k]);
10494 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10495 ctxt->states = NULL;
10502 } else if (ctxt->states != NULL) {
10503 for (k = 0; k < ctxt->states->nbState; k++)
10505 ctxt->states->tabState[k]);
10506 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10507 ctxt->states = NULL;
10513 xmlRelaxNGFreeStates(ctxt, states);
10514 ctxt->states = res;
10517 states->nbState = j;
10518 ctxt->states = states;
10521 ctxt->state = states->tabState[0];
10522 xmlRelaxNGFreeStates(ctxt, states);
10526 xmlRelaxNGFreeStates(ctxt, states);
10527 if (ctxt->states != NULL) {
10528 xmlRelaxNGFreeStates(ctxt, ctxt->states);
10529 ctxt->states = NULL;
10532 if ((ctxt->state != NULL) && (ctxt->states != NULL)) {
10580 } else if (ctxt->states != NULL) {
10584 for (i = 0; i < ctxt->states->nbState; i++) {
10585 state = ctxt->states->tabState[i];
10667 ret->states = NULL;
10687 if (ctxt->states != NULL)
10688 xmlRelaxNGFreeStates(NULL, ctxt->states);