I need to perform operations on Lua tables from C where the tables are treated as lists or queues. Specifically I need to insert an element at the head, and remove the head element, and have the other elements move to accommodate the new element.
This would be simple in straight lua, i'd use table.insert and table.remove. But in C?
There are functions in the Lua C api such as lua_settable, but no equivalents for table.insert and table.remove that are surfaced. It looks like there are internal C functions inside the interpreter called tinsert and tremove, but they are not part of the api.
Do I really have to call out to a lua function that does it for me?