src/t_buf_seg.c
int
luaopen_t_buf_seg( lua_State *L )
{
	// T.Buffer.Segment instance metatable
	luaL_newmetatable( L, T_BUF_SEG_TYPE );
	luaL_setfuncs( L, t_buf_seg_m, 0 );
	lua_pop( L, 1 );  // balance the stack

	// T.Buffer.Segment class
	luaL_newlib( L, t_buf_seg_cf );
	luaL_newlib( L, t_buf_seg_fm );
	lua_setmetatable( L, -2 );
	return 1;
}
/**--------------------------------------------------------------------------
 * Pushes this library onto the stack.
 *          - creates Metatable with functions
 *          - creates metatable with methods
 * \param   L      The lua state.
 * \lreturn table  the library
 * \return  int    # of values pushed onto the stack.
 * --------------------------------------------------------------------------*/
Pushes this library onto the stack.
- creates Metatable with functions
- creates metatable with methods
\param   L      The lua state.
\lreturn table  the library
\return  int    # of values pushed onto the stack.
Pushes this library onto the stack . - creates Metatable with functions - creates metatable with methods \ param L The lua state . \ lreturn table the library \ return int # of values pushed onto the stack .
int
luaopen_t_buf_seg( lua_State *L )
{
	luaL_newmetatable( L, T_BUF_SEG_TYPE );
	luaL_setfuncs( L, t_buf_seg_m, 0 );
	lua_pop( L, 1 );  
	luaL_newlib( L, t_buf_seg_cf );
	luaL_newlib( L, t_buf_seg_fm );
	lua_setmetatable( L, -2 );
	return 1;
}
int luaopen_t_buf_seg ( lua_State * L ) { luaL_newmetatable ( L , T_BUF_SEG_TYPE ) ; luaL_setfuncs ( L , t_buf_seg_m , 0 ) ; lua_pop ( L , 1 ) ; luaL_newlib ( L , t_buf_seg_cf ) ; luaL_newlib ( L , t_buf_seg_fm ) ; lua_setmetatable ( L , -2 ) ; return 1 ; }
Pushes this library onto the stack.
Pushes this library onto the stack .
// T.Buffer.Segment instance metatable // balance the stack // T.Buffer.Segment class