if (!pktin) { fxp_internal_error("could not connect"); return 0; }
int fxp_init(void) {    struct sftp_packet *pktout, *pktin;    int remotever;    pktout = sftp_pkt_init(SSH_FXP_INIT);    sftp_pkt_adduint32(pktout, SFTP_PROTO_VERSION);    sftp_send(pktout);    pktin = sftp_recv();    if (pktin->type != SSH_FXP_VERSION) {	fxp_internal_error("did not receive FXP_VERSION");	return 0;    }    remotever = sftp_pkt_getuint32(pktin);    if (remotever > SFTP_PROTO_VERSION) {	fxp_internal_error("remote protocol is more advanced than we support");	return 0;    }    /*     * In principle, this packet might also contain extension-     * string pairs. We should work through them and look for any     * we recognise. In practice we don't currently do so because     * we know we don't recognise _any_.     */    sftp_pkt_free(pktin);    return 1;}