util-src/ringbuffer.c
/*
 * Find first position of a substring in buffer
 * (buffer, string) -> number
 */
Find first position of a substring in buffer
(buffer, string) -> number
Find first position of a substring in buffer ( buffer string ) - > number
int rb_find(lua_State *L) {
	size_t l, m;
	ringbuffer *b = luaL_checkudata(L, 1, "ringbuffer_mt");
	const char *s = luaL_checklstring(L, 2, &l);
	m = find(b, s, l);
	if(m > 0) {
		lua_pushinteger(L, m);
		return 1;
	}
	return 0;
}
int rb_find ( lua_State * L ) { size_t l , m ; ringbuffer * b = luaL_checkudata ( L , 1 , " " ) ; const char * s = luaL_checklstring ( L , 2 , & l ) ; m = find ( b , s , l ) ; if ( m > 0 ) { lua_pushinteger ( L , m ) ; return 1 ; } return 0 ; }
Find first position of a substring in buffer
 (buffer, string) -> number
Find first position of a substring in buffer ( buffer string ) - > number