X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.h;h=649fc06063707c2465912049edd254ea1f2b6f0d;hb=8b7f1839b1981554979af1aa2e5e8b58ad63fe77;hp=6efb5e3c841ecb9cb834c321f24fe4ffeda84cfa;hpb=2da8baf01e863c80eccdeb5f428f16e1cf3a0473;p=tfcrypt.git diff --git a/tfcrypt.h b/tfcrypt.h index 6efb5e3..649fc06 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. @@ -113,6 +119,9 @@ int xmhexdump(int to, const void *data, size_t szdata, int hgroup, int hexstr, i #define mhexdump(data, szdata, group, newline) xmhexdump(1, data, szdata, group, do_full_hexdump, newline) #define mehexdump(data, szdata, group, newline) xmhexdump(2, data, szdata, group, do_full_hexdump, newline) +size_t xstrlcpy(char *dst, const char *src, size_t size); +size_t xstrlcat(char *dst, const char *src, size_t size); + extern size_t nr_turns; extern int ctr_mode; extern size_t macbits; @@ -133,18 +142,19 @@ 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 tfc_fsize maxkeylen, keyoffset; extern int sfd, kfd, dfd; extern struct stat s_stat; extern size_t blksize, xtsblocks; extern char pwdask[512], pwdagain[512]; extern size_t lio, lrem, ldone, lblock; -extern size_t maxkeylen, ctrsz; +extern size_t ctrsz; extern struct sigaction sigact; extern size_t sksum_turns; extern int do_edcrypt, do_stop, quiet, error_action; extern int counter_opt, mackey_opt, do_mac, do_outfmt, rawkey; extern int idx, write_flags; -extern tfc_yesno catch_all_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1; +extern tfc_yesno catch_all_errors, ignore_seek_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1; extern tfc_yesno do_preserve_time, do_stats_in_gibs, do_statline_dynamic, do_less_stats; extern tfc_yesno no_repeat, do_full_hexdump, verbose, statline_was_shown; extern char *srcfname, *dstfname, *do_mac_file, *counter_file, *sksum_hashlist_file; @@ -154,6 +164,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); @@ -191,7 +204,9 @@ void change_status_timer(int signal); void setup_next_alarm(tfc_useconds useconds); void skein(void *hash, size_t bits, const void *key, const void *data, size_t szdata); void tf_key_tweak_compat(void *key); -tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize readto); +tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize offset, tfc_fsize readto); + +void read_defaults(const char *path, tfc_yesno noerr); void gen_write_bytes(const char *foutname, tfc_fsize offset, tfc_fsize nrbytes); void do_edbase64(char **fargv);