[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: absolute stack index
- From: Tobias Käs <tobias.kaes@...>
- Date: Sat, 28 Jun 2003 16:59:07 +0200
----- Original Message -----
From: "Wim Couwenberg" <w.couwenberg@chello.nl>
> int abs_index = lua_gettop(L) + neg_index + 1;
>
> Bye,
> Wim
>
I wonder why such a macro is not in the API, I need it for almost every C
function which receives a stack index as parameter, to ensure it stays
valid.
Well, I'll add it to my library of "missing features" ;-)
#define lua_absindex(L,n) ((n) < 0 ? lua_gettop(L) + (n) + 1 : (n))