Re: Python extension commands in git - request for policy change
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 12, 2012, 01:50 UTC
- Message-ID
- <CACsJy8A9h4QJ_iWvQqTtYa4NPH6Q1Gy0NTozbgukC3=ep58mLA@mail.gmail.com>
- In-Reply-To
- <1355273635-ner-4863@calvin>
On Wed, Dec 12, 2012 at 7:53 AM, Tomas Carnecky <tomas.carnecky@gmail.com> wrote:
Show 10 quoted lines
> If it doesn't, it would be trivial to add. It's a one-liner. It's been a while
> since I used Lua, but it would be something like this:
>
> void L_putenv(lua_State *L) {
> putenv(lua_tostring(L, 1));
> }
>
> and then somewhere during setup:
>
> lua_register(L, "putenv", L_putenv);I should have done my homework before asking, but well.. is there any way to automate this? If we use lua for writing "builtin" commands, we'll need to export a lot of C functions and writing wrappers like this is boring and time consuming. Also, assume I export fn(char*,int) to Lua, then I change the prototype to fn(char*, char*), can Lua spot all the call sites at compile time (or something) so I can update them?
-- Duy