X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4c7f0d617cfbb8927870ff8f6a1701372788b693..d8770b1245ff0acd81f581c5667563e0d127104a:/sftp.h diff --git a/sftp.h b/sftp.h index f62f2a12..43ee5b1f 100644 --- a/sftp.h +++ b/sftp.h @@ -55,6 +55,18 @@ #define SFTP_PROTO_VERSION 3 +/* + * External references. The sftp client module sftp.c expects to be + * able to get at these functions. + * + * sftp_recvdata must never return less than len. It either blocks + * until len is available, or it returns failure. + * + * Both functions return 1 on success, 0 on failure. + */ +int sftp_senddata(char *data, int len); +int sftp_recvdata(char *data, int len); + struct fxp_attrs { unsigned long flags; uint64 size; @@ -67,6 +79,7 @@ struct fxp_attrs { struct fxp_handle { char *hstring; + int hlen; }; struct fxp_name { @@ -91,7 +104,7 @@ int fxp_init(void); * Canonify a pathname. Concatenate the two given path elements * with a separating slash, unless the second is NULL. */ -char *fxp_realpath(char *path, char *path2); +char *fxp_realpath(char *path); /* * Open a file. @@ -114,6 +127,11 @@ void fxp_close(struct fxp_handle *handle); int fxp_read(struct fxp_handle *handle, char *buffer, uint64 offset, int len); /* + * Write to a file. Returns 0 on error, 1 on OK. + */ +int fxp_write(struct fxp_handle *handle, char *buffer, uint64 offset, int len); + +/* * Read from a directory. */ struct fxp_names *fxp_readdir(struct fxp_handle *handle);