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

{

    put_flush_packet(bc);

    nut->packet_start[2]= url_ftell(bc) - 8;

    nut->written_packet_size = max_size;

    

    if(calculate_checksum)

        init_checksum(bc, update_adler32, 0);



    /* packet header */

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



    return 0;

}

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

{

    put_flush_packet(bc);

    nut->packet_start[2]= url_ftell(bc) - 8;

    nut->written_packet_size = max_size;

    

    if(calculate_checksum)

        init_checksum(bc, update_adler32, 0);



    

    put_v(bc, nut->written_packet_size); 



    return 0;

}

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

{

    put_flush_packet(VAR_1);

    VAR_0->packet_start[2]= url_ftell(VAR_1) - 8;

    VAR_0->written_packet_size = VAR_2;

    

    if(VAR_3)

        init_checksum(VAR_1, update_adler32, 0);



    

    put_v(VAR_1, VAR_0->written_packet_size); 



    return 0;

}

static int FUNC_0(NUTContext *VAR_0, ByteIOContext *VAR_1, int VAR_2, int VAR_3)
{ put_flush_packet(VAR_1); VAR_0->packet_start[2]= url_ftell(VAR_1) - 8; VAR_0->written_packet_size = VAR_2; if(VAR_3)
init_checksum(VAR_1, update_adler32, 0); put_v(VAR_1, VAR_0->written_packet_size); return 0; }