[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_putchar
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 3 May 2001 07:01:47 -0300
>I have made a translation of lua header for pascal and I have a problem for
>converting the macro luaL_putchar.
>I don't what it does exactly. Anyone can tell me what it does or where I can
>found a documentation about it.
Here is the definition of luaL_putchar:
#define luaL_putchar(B,c) \
((void)((B)->p < &(B)->buffer[LUAL_BUFFERSIZE] || luaL_prepbuffer(B)), \
(*(B)->p++ = (char)(c)))
This translates to
if ((B)->p >= &(B)->buffer[LUAL_BUFFERSIZE]) luaL_prepbuffer(B);
*(B)->p++ = (char)(c);
In words:
add c to the buffer, calling luaL_prepbuffer first, if the buffer is full.
Perhaps you'll need to turn luaL_putchar into a function with the body above
and export this function to Pascal.
--lhf