X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.h;h=c469638f01e07172809c16993328c77fbab3c846;hb=4ae16105a9849ffbd2a9bb0e02fa4dfe8b83ebd6;hp=fcc75eea79c54a518fb6c5c3379a1b73152ce458;hpb=add1a38544028f7f763b0ccf9ac354e8b45bec23;p=tfcrypt.git diff --git a/tfcrypt.h b/tfcrypt.h index fcc75ee..c469638 100644 --- a/tfcrypt.h +++ b/tfcrypt.h @@ -29,6 +29,9 @@ #ifndef _TFCRYPT_H #define _TFCRYPT_H +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif @@ -38,6 +41,9 @@ #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif #ifndef _TFCRYPT_VERSION #error Version number may help you to identify missing functionality. @@ -132,6 +138,7 @@ extern tfc_fsize iseek_blocks, iseek, oseek, maxlen; extern tfc_fsize total_processed_src, total_processed_dst; extern tfc_fsize delta_processed; extern tfc_fsize genrandom_nr_bytes, genzero_nr_bytes; +extern tfc_fsize rdpos; extern int sfd, kfd, dfd; extern struct stat s_stat; extern size_t blksize, xtsblocks; @@ -153,6 +160,9 @@ extern tfc_useconds status_timer, bench_timer; extern tfc_useconds current_time, delta_time; extern struct getpasswd_state getps; +size_t xread(int fd, void *data, size_t szdata); +size_t xwrite(int fd, const void *data, size_t szdata); + void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char *fmt, ...); void xexit(int status); void usage(void); @@ -174,6 +184,7 @@ void xclose(int fd); const char *tfc_modename(int mode); void tfc_getcurtime(tfc_useconds *tx); tfc_fsize tfc_fdsize(int fd); +tfc_fsize tfc_fdgetpos(int fd); tfc_fsize tfc_fnamesize(char *fname, tfc_yesno noexit); tfc_fsize tfc_modifysize(tfc_fsize szmodify, const char *szspec); void fcopy_matime(int fd, const struct stat *st); @@ -198,7 +209,7 @@ void do_benchmark(tfc_useconds useconds, double dseconds); enum { NO, YES }; -enum { TFC_ERRACT_EXIT, TFC_ERRACT_CONT, TFC_ERRACT_SYNC }; +enum { TFC_ERRACT_EXIT, TFC_ERRACT_CONT, TFC_ERRACT_SYNC, TFC_ERRACT_LSYNC }; enum { TFC_STOP_BEGAN = 1, TFC_STOP_FULL }; enum { TFC_DO_PLAIN, TFC_DO_ENCRYPT, TFC_DO_DECRYPT }; enum { TFC_MAC_DROP = -1, TFC_MAC_SIGN = 1, TFC_MAC_VRFY, TFC_MAC_JUST_VRFY };