static int protocol_version(VncState *vs, char *version, size_t len)

{

    char local[13];

    int maj, min;



    memcpy(local, version, 12);

    local[12] = 0;



    if (sscanf(local, "RFB %03d.%03d\n", &maj, &min) != 2) {

	vnc_client_error(vs);

	return 0;

    }



    vnc_write_u32(vs, 1); /* None */

    vnc_flush(vs);



    vnc_read_when(vs, protocol_client_init, 1);



    return 0;

}

static int protocol_version(VncState *vs, char *version, size_t len)

{

    char local[13];

    int maj, min;



    memcpy(local, version, 12);

    local[12] = 0;



    if (sscanf(local, "RFB %03d.%03d\n", &maj, &min) != 2) {

	vnc_client_error(vs);

	return 0;

    }



    vnc_write_u32(vs, 1); 

    vnc_flush(vs);



    vnc_read_when(vs, protocol_client_init, 1);



    return 0;

}

static int FUNC_0(VncState *VAR_0, char *VAR_1, size_t VAR_2)

{

    char VAR_3[13];

    int VAR_4, VAR_5;



    memcpy(VAR_3, VAR_1, 12);

    VAR_3[12] = 0;



    if (sscanf(VAR_3, "RFB %03d.%03d\n", &VAR_4, &VAR_5) != 2) {

	vnc_client_error(VAR_0);

	return 0;

    }



    vnc_write_u32(VAR_0, 1); 

    vnc_flush(VAR_0);



    vnc_read_when(VAR_0, protocol_client_init, 1);



    return 0;

}

static int FUNC_0(VncState *VAR_0, char *VAR_1, size_t VAR_2)
{ char VAR_3[13]; int VAR_4, VAR_5; memcpy(VAR_3, VAR_1, 12); VAR_3[12] = 0; if (sscanf(VAR_3, "RFB %03d.%03d\n", &VAR_4, &VAR_5) != 2) { vnc_client_error(VAR_0); return 0; } vnc_write_u32(VAR_0, 1); vnc_flush(VAR_0); vnc_read_when(VAR_0, protocol_client_init, 1); return 0; }