[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: luaL_putchar define not using?
- From: "l.jay Yuan" <pass86@...>
- Date: Tue, 26 Jun 2012 01:03:26 +0800
Lua 5.0 's code
typedef struct luaL_Buffer {
char *p; /* current position in buffer */
int lvl; /* number of strings in the stack (level) */
lua_State *L;
char buffer[LUAL_BUFFERSIZE];
} luaL_Buffer;
#define luaL_putchar(B,c) \
((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
(*(B)->p++ = (char)(c)))
Lua 5.2 's code
typedef struct luaL_Buffer {
char *b; /* buffer address */
size_t size; /* buffer size */
size_t n; /* number of characters in buffer */
lua_State *L;
char initb[LUAL_BUFFERSIZE]; /* initial buffer */
} luaL_Buffer;
can not find luaL_putchar
I define it myself
#define luaL_putchar(B,c) \
((void)((B)->b < ((B)->initb+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \
(*(B)->b++ = (char)(c)))
Can I do that?