mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
Improve the sftp seek functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@605 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -443,8 +443,10 @@ ssize_t sftp_write(SFTP_FILE *file, const void *buf, size_t count);
|
|||||||
* @param file Open sftp file handle to seek in.
|
* @param file Open sftp file handle to seek in.
|
||||||
*
|
*
|
||||||
* @param new_offset Offset in bytes to seek.
|
* @param new_offset Offset in bytes to seek.
|
||||||
|
*
|
||||||
|
* @return 0 on success, < 0 on error.
|
||||||
*/
|
*/
|
||||||
void sftp_seek(SFTP_FILE *file, int new_offset);
|
int sftp_seek(SFTP_FILE *file, u32 new_offset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Seek to a specific location in a file. This is the
|
* @brief Seek to a specific location in a file. This is the
|
||||||
@@ -453,8 +455,10 @@ void sftp_seek(SFTP_FILE *file, int new_offset);
|
|||||||
* @param file Open sftp file handle to seek in.
|
* @param file Open sftp file handle to seek in.
|
||||||
*
|
*
|
||||||
* @param new_offset Offset in bytes to seek.
|
* @param new_offset Offset in bytes to seek.
|
||||||
|
*
|
||||||
|
* @return 0 on success, < 0 on error.
|
||||||
*/
|
*/
|
||||||
void sftp_seek64(SFTP_FILE *file, u64 new_offset);
|
int sftp_seek64(SFTP_FILE *file, u64 new_offset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Report current byte position in file.
|
* @brief Report current byte position in file.
|
||||||
|
|||||||
@@ -1744,12 +1744,24 @@ ssize_t sftp_write(SFTP_FILE *file, const void *buf, size_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Seek to a specific location in a file. */
|
/* Seek to a specific location in a file. */
|
||||||
void sftp_seek(SFTP_FILE *file, int new_offset){
|
int sftp_seek(SFTP_FILE *file, u32 new_offset) {
|
||||||
file->offset=new_offset;
|
if (file == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
file->offset = new_offset;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sftp_seek64(SFTP_FILE *file, u64 new_offset){
|
int sftp_seek64(SFTP_FILE *file, u64 new_offset) {
|
||||||
file->offset=new_offset;
|
if (file == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
file->offset = new_offset;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Report current byte position in file. */
|
/* Report current byte position in file. */
|
||||||
|
|||||||
Reference in New Issue
Block a user