| typedef struct SshSftRec* SshSft |
Main context used in all operations.
| typedef unsigned int SshSftBoolean |
Boolean variables are integers. FALSE is 0 and all nonzero values are interpreted as TRUE.
| typedef struct SshSftDirRec* SshSftDir |
Context used in directory operations.
| typedef struct SshSftFileRec* SshSftFile |
Context used in file operations.
| typedef struct SshSftFileAttributesRec SshSftFileAttributesStruct |
Data structure for representing file attributes.
| typedef struct SshSftGlobRec* SshSftGlob |
Context used in globbing.
| typedef signed int SshSftInt32 |
Signed 32 bit integers.
| typedef signed long long SshSftInt64 |
Signed 64 bit integers.
| typedef void(*) SshSftMessageCB(void *message_cb_ctx, void *progress_cb_ctx, SshSftOperation operation, SshSftAction action, char *src_path, char *src_name, char *dst_path, char *dst_name, char *long_name, SshSftFileAttributes attrs, SshSftError res, char *status_msg, SshSftInteract *interact_ret) |
Function prototype for message callback.
SFT library calls message callback function when it needs to interact with the application. Different operations have different actions:
SSH_SFT_OPERATION_FILE_COPY -> SSH_SFT_ACTION_START (start file copy?) SSH_SFT_ACTION_OVERWRITE (overwrite file?) SSH_SFT_ACTION_ASCII_CONVERSION_SRC (conversion from source?) SSH_SFT_ACTION_ASCII_CONVERSION_DST (conversion to destination?)
SSH_SFT_OPERATION_FILE_MOVE -> SSH_SFT_ACTION_START (start file copy?) SSH_SFT_ACTION_OVERWRITE (overwrite file?) SSH_SFT_ACTION_ASCII_CONVERSION_SRC (conversion from source?) SSH_SFT_ACTION_ASCII_CONVERSION_DST (conversion to destination?) SSH_SFT_ACTION_REMOVE (remove file?)
SSH_SFT_OPERATION_DIR_COPY -> SSH_SFT_ACTION_ENTER_DIR (enter directory?) SSH_SFT_ACTION_LIST (list file/directory?) SSH_SFT_ACTION_CREATE_DIR (create directory?) SSH_SFT_ACTION_START (start file copy?) SSH_SFT_ACTION_OVERWRITE (overwrite file?) SSH_SFT_ACTION_ASCII_CONVERSION_SRC (conversion from source?) SSH_SFT_ACTION_ASCII_CONVERSION_DST (conversion to destination?) SSH_SFT_ACTION_REPORT_ERROR (continue with error?) SSH_SFT_ACTION_REPORT_WARNING (-) SSH_SFT_ACTION_REPORT_INFO (-)
SSH_SFT_OPERATION_DIR_MOVE -> SSH_SFT_ACTION_ENTER_DIR (enter directory?) SSH_SFT_ACTION_LIST (list file/directory?) SSH_SFT_ACTION_CREATE_DIR (create directory?) SSH_SFT_ACTION_START (start file copy?) SSH_SFT_ACTION_OVERWRITE (overwrite file?) SSH_SFT_ACTION_ASCII_CONVERSION_SRC (conversion from source?) SSH_SFT_ACTION_ASCII_CONVERSION_DST (conversion to destination?) SSH_SFT_ACTION_REMOVE (remove file?) SSH_SFT_ACTION_REMOVE_DIR (remove directory?) SSH_SFT_ACTION_REPORT_ERROR (continue with error?) SSH_SFT_ACTION_REPORT_WARNING (-) SSH_SFT_ACTION_REPORT_INFO (-)
SSH_SFT_OPERATION_DIR_REMOVE -> SSH_SFT_ACTION_ENTER_DIR (enter directory?) SSH_SFT_ACTION_LIST (list file/directory?) SSH_SFT_ACTION_REMOVE (remove file?) SSH_SFT_ACTION_REMOVE_DIR (remove directory?) SSH_SFT_ACTION_REPORT_ERROR (continue with error?) SSH_SFT_ACTION_REPORT_WARNING (-) SSH_SFT_ACTION_REPORT_INFO (-)
| message_cb_ctx | Message callback function context. | |
| progress_cb_ctx | Progress callback function context. | |
| operation | Operation. | |
| action | Action. | |
| src_path | Path to the source file. | |
| src_name | Name of the source file. | |
| dst_path | Path to the destination file. | |
| dst_name | Name of the destination file. | |
| long_name | Long name of the file in action SSH_SFT_ACTION_LIST. | |
| attrs | File attributes in action SSH_SFT_ACTION_LIST. | |
| res | Status code for the SFT operation. | |
| status_msg | Status message for the SFT operation. | |
| interact_ret | Interact return value. |
| typedef struct SshSftOffsetRec SshSftOffsetStruct |
Offsets used in file copy.
| typedef struct SshSftParamRec SshSftParamStruct |
SFT parameters.
Each SFT session can be configured with parameters.
| typedef void(*) SshSftProgressCB(void *context, SshSftUInt64 start_offset, SshSftUInt64 offset, SshSftUInt64 block_len, SshSftUInt64 total_len, SshSftBoolean finished) |
Function prototype for file copy progress callback.
SFT library calls progress callback function after each succesful data transfer. This means that the progress callback function is called very often and should not perform any heavy functionality. It is suggested that progress callback function only updates statistics and some other thread performs further actions, like drawing the progress bar.
| context | Application specific context. | |
| start_offset | Initial offset in the file. | |
| offset | Current offset in the file. | |
| block_len | Length of the transferred block. | |
| total_len | Total length of the file. | |
| finished | Flag to specify, whether transfer is finished. |
| typedef void(*) SshSftProgressCtxCreateCB(void *context, char *src_path, char *src_name, char *dst_path, char *dst_name, void **progress_cb_ctx_ret) |
Function prototype for creating file copy progress context.
Directory copy is performed so that more than one file is copied at the same time. For this reason, application must provide one context for each file transfer. SFT library calls progress context creation function before each file transfer. This context is then given to progress callback function during the file transfer.
| context | Application specific context. | |
| src_path | Path to the source file. | |
| src_name | Name of the source file. | |
| dst_path | Path to the destination file. | |
| dst_name | Name of the destination file. | |
| progress_cb_ctx_ret | Returned progress callback context. |
| typedef void(*) SshSftProgressCtxDestroyCB(void *context, void *progress_cb_ctx) |
Function prototype for destroying file copy progress context.
After file transfer SFT library calls progress context destroy function. Application can then free resources bound to the context.
| context | Application specific context. | |
| progress_cb_ctx | Progress callback context. |
| typedef int(*) SshSftSignalCB(void *context, SshSftSignal signal_type) |
Function prototype for signal callback function.
Signal callback is used by the library to tell the application that it has performed some action. For example, if library loses the connection (SSH_SFT_SIGNAL_KILL), the application must tear done the corresponding contexts. Also, for example if the application aborts file operation with 'ssh_sft_abort' function, SSH_SFT_SIGNAL_ABORT is received when abort is ready.
| context | Application specific context. | |
| signal_type | Type of the signal requested. |
| typedef SshSftInt64 SshSftTime |
Timestamps are signed 64 bit integers.
| typedef unsigned int SshSftUInt32 |
Unsigned 32 bit integers.
| typedef unsigned long long SshSftUInt64 |
Unsigned 64 bit integers.
| anonymous enum |
| enum SshSftAction |
SFT action code.
Action codes are used in directory and other operations to tell the user what kind of action starts. The user can then decide whether the action can start or not.
| enum SshSftChecksum |
Checksum types.
SFT can use checksums to check whether two files are identical. There is also separate checkpoint database that can be used for saving the state of the file transfer. If the file transfer is interrupted, the database can be used for determining the point from where file transfer can be resumed.
| enum SshSftDirSortFlags |
| enum SshSftError |
Return values for SFT API functions.
All SFT API functions return these values. There is always a descriptive status message returned with the return value.
| enum SshSftFileAttrFlags |
Attribute flags are used for specifying, which attributes are present.
| enum SshSftFileFlags |
File open flags.
Different flags are used in opening file.
| enum SshSftFileType |
File types.
Different file types are used in SFT operations.
| enum SshSftInteract |
Return values for user interaction.
These values are used when user interaction is needed to perform some operation. Interaction callback function is called from the library and the function must return the value for the library.