util-src/ringbuffer.c
/*
 * Move read position forward without returning the data
 * (buffer, number) -> boolean
 */
Move read position forward without returning the data
(buffer, number) -> boolean
Move read position forward without returning the data ( buffer number ) - > boolean
int rb_discard(lua_State *L) {
	ringbuffer *b = luaL_checkudata(L, 1, "ringbuffer_mt");
	size_t r = luaL_checkinteger(L, 2);
	if(r > b->blen) {
		lua_pushboolean(L, 0);
		return 1;
	}
	b->blen -= r;
	b->rpos += r;
	modpos(b);
	lua_pushboolean(L, 1);
	return 1;
}
int rb_discard ( lua_State * L ) { ringbuffer * b = luaL_checkudata ( L , 1 , " " ) ; size_t r = luaL_checkinteger ( L , 2 ) ; if ( r > b -> blen ) { lua_pushboolean ( L , 0 ) ; return 1 ; } b -> blen -= r ; b -> rpos += r ; modpos ( b ) ; lua_pushboolean ( L , 1 ) ; return 1 ; }
Move read position forward without returning the data
 (buffer, number) -> boolean
Move read position forward without returning the data ( buffer number ) - > boolean