static int put_packetheader(NUTContext *nut, ByteIOContext *bc, int max_size)

{

    put_flush_packet(bc);

    nut->last_packet_start= nut->packet_start;

    nut->packet_start+= nut->written_packet_size;

    nut->packet_size_pos = url_ftell(bc);

    nut->written_packet_size = max_size;



    /* packet header */

    put_v(bc, nut->written_packet_size); /* forward ptr */

    put_v(bc, nut->packet_start - nut->last_packet_start); /* backward ptr */



    return 0;

}

static int put_packetheader(NUTContext *nut, ByteIOContext *bc, int max_size)

{

    put_flush_packet(bc);

    nut->last_packet_start= nut->packet_start;

    nut->packet_start+= nut->written_packet_size;

    nut->packet_size_pos = url_ftell(bc);

    nut->written_packet_size = max_size;



    

    put_v(bc, nut->written_packet_size); 

    put_v(bc, nut->packet_start - nut->last_packet_start); 



    return 0;

}

static int FUNC_0(NUTContext *VAR_0, ByteIOContext *VAR_1, int VAR_2)

{

    put_flush_packet(VAR_1);

    VAR_0->last_packet_start= VAR_0->packet_start;

    VAR_0->packet_start+= VAR_0->written_packet_size;

    VAR_0->packet_size_pos = url_ftell(VAR_1);

    VAR_0->written_packet_size = VAR_2;



    

    put_v(VAR_1, VAR_0->written_packet_size); 

    put_v(VAR_1, VAR_0->packet_start - VAR_0->last_packet_start); 



    return 0;

}

static int FUNC_0(NUTContext *VAR_0, ByteIOContext *VAR_1, int VAR_2)
{ put_flush_packet(VAR_1); VAR_0->last_packet_start= VAR_0->packet_start; VAR_0->packet_start+= VAR_0->written_packet_size; VAR_0->packet_size_pos = url_ftell(VAR_1); VAR_0->written_packet_size = VAR_2; put_v(VAR_1, VAR_0->written_packet_size); put_v(VAR_1, VAR_0->packet_start - VAR_0->last_packet_start); return 0; }