• Home
  • Raw
  • Download

Lines Matching refs:set

970 re_node_set_alloc (re_node_set *set, Idx size)  in re_node_set_alloc()  argument
972 set->alloc = size; in re_node_set_alloc()
973 set->nelem = 0; in re_node_set_alloc()
974 set->elems = re_malloc (Idx, size); in re_node_set_alloc()
975 if (BE (set->elems == NULL, 0)) in re_node_set_alloc()
982 re_node_set_init_1 (re_node_set *set, Idx elem) in re_node_set_init_1() argument
984 set->alloc = 1; in re_node_set_init_1()
985 set->nelem = 1; in re_node_set_init_1()
986 set->elems = re_malloc (Idx, 1); in re_node_set_init_1()
987 if (BE (set->elems == NULL, 0)) in re_node_set_init_1()
989 set->alloc = set->nelem = 0; in re_node_set_init_1()
992 set->elems[0] = elem; in re_node_set_init_1()
998 re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2) in re_node_set_init_2() argument
1000 set->alloc = 2; in re_node_set_init_2()
1001 set->elems = re_malloc (Idx, 2); in re_node_set_init_2()
1002 if (BE (set->elems == NULL, 0)) in re_node_set_init_2()
1006 set->nelem = 1; in re_node_set_init_2()
1007 set->elems[0] = elem1; in re_node_set_init_2()
1011 set->nelem = 2; in re_node_set_init_2()
1014 set->elems[0] = elem1; in re_node_set_init_2()
1015 set->elems[1] = elem2; in re_node_set_init_2()
1019 set->elems[0] = elem2; in re_node_set_init_2()
1020 set->elems[1] = elem1; in re_node_set_init_2()
1281 re_node_set_insert (re_node_set *set, Idx elem) in re_node_set_insert() argument
1285 if (set->alloc == 0) in re_node_set_insert()
1286 return BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1); in re_node_set_insert()
1288 if (BE (set->nelem, 0) == 0) in re_node_set_insert()
1291 set->elems[0] = elem; in re_node_set_insert()
1292 ++set->nelem; in re_node_set_insert()
1297 if (set->alloc == set->nelem) in re_node_set_insert()
1300 set->alloc = set->alloc * 2; in re_node_set_insert()
1301 new_elems = re_realloc (set->elems, Idx, set->alloc); in re_node_set_insert()
1304 set->elems = new_elems; in re_node_set_insert()
1309 if (elem < set->elems[0]) in re_node_set_insert()
1312 for (idx = set->nelem; idx > 0; idx--) in re_node_set_insert()
1313 set->elems[idx] = set->elems[idx - 1]; in re_node_set_insert()
1317 for (idx = set->nelem; set->elems[idx - 1] > elem; idx--) in re_node_set_insert()
1318 set->elems[idx] = set->elems[idx - 1]; in re_node_set_insert()
1322 set->elems[idx] = elem; in re_node_set_insert()
1323 ++set->nelem; in re_node_set_insert()
1333 re_node_set_insert_last (re_node_set *set, Idx elem) in re_node_set_insert_last() argument
1336 if (set->alloc == set->nelem) in re_node_set_insert_last()
1339 set->alloc = (set->alloc + 1) * 2; in re_node_set_insert_last()
1340 new_elems = re_realloc (set->elems, Idx, set->alloc); in re_node_set_insert_last()
1343 set->elems = new_elems; in re_node_set_insert_last()
1347 set->elems[set->nelem++] = elem; in re_node_set_insert_last()
1371 re_node_set_contains (const re_node_set *set, Idx elem) in internal_function()
1374 if (! REG_VALID_NONZERO_INDEX (set->nelem)) in internal_function()
1379 right = set->nelem - 1; in internal_function()
1383 if (set->elems[mid] < elem) in internal_function()
1388 return set->elems[idx] == elem ? idx + 1 : 0; in internal_function()
1393 re_node_set_remove_at (re_node_set *set, Idx idx) in re_node_set_remove_at() argument
1395 if (idx < 0 || idx >= set->nelem) in re_node_set_remove_at()
1397 --set->nelem; in re_node_set_remove_at()
1398 for (; idx < set->nelem; idx++) in re_node_set_remove_at()
1399 set->elems[idx] = set->elems[idx + 1]; in re_node_set_remove_at()