src/t_buf_seg.c
static int
lt_buf_seg_shift( lua_State *L )
{
	struct t_buf_seg *seg   = t_buf_seg_check_ud( L, 1, 1 );
	lua_Integer       val   = luaL_checkinteger( L, 2 );

	lua_getiuservalue( L, 1, T_BUF_SEG_BUFIDX );            //S: seg val buf
	t_buf_seg_set( L, seg, t_buf_check_ud( L, -1, 1), seg->idx + val, seg->len );
	lua_pop( L, 1 );
	lua_pushboolean( L, 1 );

	return 1;
}
/**--------------------------------------------------------------------------
 * shift method for Buffer.Segment to shift along buffer.
 * \param   L      Lua state.
 * \lparam  ud     T.Buffer.Segement userdata instance.
 * \lparam  val    integer to shift Segment.
 * \lreturn value  boolean if operation was successful.
 * \return  int    # of values pushed onto the stack.
 * --------------------------------------------------------------------------*/
shift method for Buffer.Segment to shift along buffer.
\param   L      Lua state.
\lparam  ud     T.Buffer.Segement userdata instance.
\lparam  val    integer to shift Segment.
\lreturn value  boolean if operation was successful.
\return  int    # of values pushed onto the stack.
shift method for Buffer . Segment to shift along buffer . \ param L Lua state . \ lparam ud T . Buffer . Segement userdata instance . \ lparam val integer to shift Segment . \ lreturn value boolean if operation was successful . \ return int # of values pushed onto the stack .
static int
lt_buf_seg_shift( lua_State *L )
{
	struct t_buf_seg *seg   = t_buf_seg_check_ud( L, 1, 1 );
	lua_Integer       val   = luaL_checkinteger( L, 2 );
	lua_getiuservalue( L, 1, T_BUF_SEG_BUFIDX );            
	t_buf_seg_set( L, seg, t_buf_check_ud( L, -1, 1), seg->idx + val, seg->len );
	lua_pop( L, 1 );
	lua_pushboolean( L, 1 );
	return 1;
}
static int lt_buf_seg_shift ( lua_State * L ) { struct t_buf_seg * seg = t_buf_seg_check_ud ( L , 1 , 1 ) ; lua_Integer val = luaL_checkinteger ( L , 2 ) ; lua_getiuservalue ( L , 1 , T_BUF_SEG_BUFIDX ) ; t_buf_seg_set ( L , seg , t_buf_check_ud ( L , -1 , 1 ) , seg -> idx + val , seg -> len ) ; lua_pop ( L , 1 ) ; lua_pushboolean ( L , 1 ) ; return 1 ; }
shift method for Buffer.Segment to shift along buffer.
shift method for Buffer . Segment to shift along buffer .
//S: seg val buf