62 return !pwl || pwl->
length == 0;
84 if (idx < 0 || pwl->length <= idx) {
85 prod->
kind = VUT_NONE;
118 if (idx < 0 || pwl->length <= idx) {
123 for (i = idx; i < pwl->
length - 1; i++) {
146 pwl->
entries[next_index] = *prod;
163 if (idx < 0 || idx > pwl->
length) {
170 for (i = new_len - 2; i >= idx; i--) {
192 for (i = 0; i < wlist1->
length; i++) {
#define fc_assert_ret_val(condition, val)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
Return TRUE iff the two sources are equivalent.
struct universal entries[MAX_LEN_WORKLIST]
const struct impr_type * building
void worklist_advance(struct worklist *pwl)
Remove first element from worklist.
bool worklist_peek(const struct worklist *pwl, struct universal *prod)
Fill in the id and is_unit values for the head of the worklist if the worklist is non-empty.
void worklist_copy(struct worklist *dst, const struct worklist *src)
Copy contents from worklist src to worklist dst.
void worklist_init(struct worklist *pwl)
Initialize a worklist to be empty.
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
Fill in the id and is_unit values for the ith element in the worklist.
bool worklist_is_empty(const struct worklist *pwl)
Returns whether worklist has no elements.
bool worklist_append(struct worklist *pwl, const struct universal *prod)
Adds the id to the next available slot in the worklist.
bool worklist_insert(struct worklist *pwl, const struct universal *prod, int idx)
Inserts the production at the location idx in the worklist, thus moving all subsequent entries down.
void worklist_remove(struct worklist *pwl, int idx)
Remove element from position idx.
bool are_worklists_equal(const struct worklist *wlist1, const struct worklist *wlist2)
Return TRUE iff the two worklists are equal.
int worklist_length(const struct worklist *pwl)
Returns the number of entries in the worklist.