Skip to content

Commit

Permalink
Add (dirty) getter/setter for parent table.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Feb 1, 2025
1 parent 70ebb0b commit 89b6477
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions table.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,14 @@ Table *table_merge(Table *dst, const Table *src)
}
return dst;
}

const Table *table_get_parent(const Table *t)
{
return t->parent;
}

Table *table_set_parent(Table *t, const Table *parent)
{
t->parent = parent;
return t;
}
2 changes: 2 additions & 0 deletions table.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ uint64_t table_get(const Table *t, uint64_t key);
bool table_set_or_put(Table *t, uint64_t key, uint64_t val);
bool table_set(Table *t, uint64_t key, uint64_t val); // set only if found
Table *table_merge(Table *dst, const Table *src);
const Table *table_get_parent(const Table *t);
Table *table_set_parent(Table *t, const Table *parent);

#endif

0 comments on commit 89b6477

Please sign in to comment.