[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: (Q) How to protect C-functions from being redefined?
- From: "Maciej Maczynski" <macmac@...>
- Date: Mon, 31 Jan 2000 14:18:26 -0000
----- Original Message -----
From: Luiz Henrique de Figueiredo <firstname.lastname@example.org>
To: Multiple recipients of list <email@example.com>
Sent: Monday, January 31, 2000 12:48 PM
Subject: Re: (Q) How to protect C-functions from being redefined?
> >From firstname.lastname@example.org Mon Jan 31 08:35:03 2000
> >From: "Maciej Maczynski" <email@example.com>
> >I have C-function registered with lua_register.
> >How can I protect them from being re-defined in Lua code?
> >I've tried the piece of code from FAQ, but it seems to be working only
> >native Lua functions.
> Section 3.3 of the FAQ contains
> This protects *all* Lua functions, because we are using "tag(protect)",
> "protect" is a Lua function.
> To protect a C function named "f", do
> but note that this protects *all* C functions because all C functions have
> same tag.
> If Lua allowed tags to be set for functions, then you could proctect only
> by simply setting a newtag for f and using this tag in settagmethod.
> However, you can use the more elaborated scheme described in FAQ 3.3.
Thanks a lot!
Protecting all C functions is what I need.