Home | History | Annotate | Download | only in lib

Lines Matching defs:fs

70 static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs,
79 static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs)
1294 struct re_fail_stack_t *fs)
1325 else if (fs != NULL
1326 && push_fail_stack (fs, *pidx, candidate, nregs, regs,
1350 if (fs != NULL)
1381 if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL
1394 push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
1398 Idx num = fs->num++;
1399 if (fs->num == fs->alloc)
1402 new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t)
1403 * fs->alloc * 2));
1406 fs->alloc *= 2;
1407 fs->stack = new_array;
1409 fs->stack[num].idx = str_idx;
1410 fs->stack[num].node = dest_node;
1411 fs->stack[num].regs = re_malloc (regmatch_t, nregs);
1412 if (fs->stack[num].regs == NULL)
1414 memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
1415 err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
1421 pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
1424 Idx num = --fs->num;
1426 *pidx = fs->stack[num].idx;
1427 memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
1429 re_free (fs->stack[num].regs);
1430 *eps_via_nodes = fs->stack[num].eps_via_nodes;
1431 return fs->stack[num].node;
1447 struct re_fail_stack_t *fs;
1458 fs = &fs_body;
1459 fs->stack = re_malloc (struct re_fail_stack_ent_t, fs->alloc);
1460 if (fs->stack == NULL)
1464 fs = NULL;
1476 free_fail_stack_return (fs);
1490 if (fs)
1500 return free_fail_stack_return (fs);
1502 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1516 &eps_via_nodes, fs);
1525 free_fail_stack_return (fs);
1528 if (fs)
1529 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1543 return free_fail_stack_return (fs);
1548 free_fail_stack_return (struct re_fail_stack_t *fs)
1550 if (fs)
1553 for (fs_idx = 0; fs_idx < fs->num; ++fs_idx)
1555 re_node_set_free (&fs->stack[fs_idx].eps_via_nodes);
1556 re_free (fs->stack[fs_idx].regs);
1558 re_free (fs->stack);