diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2021-06-06 14:10:22 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2021-06-07 06:24:28 +0000 |
commit | 5dbaa8d3b28cf32a103408868fa4cf5b63dd6a56 (patch) | |
tree | af6a8eb8f355d29acf99e7583839336c5121ccb2 /wsutil/filesystem.h | |
parent | 6895f71574c68a8231925d61443c6fbcb33ee7af (diff) |
wsutil: Add filesystem write_file_binary_mode()
Add a generic function to write content to file. Use this on write
TLS session keys from UI and tshark, and for export objects.
Remove the now unused export_object_ui.[ch].
Diffstat (limited to 'wsutil/filesystem.h')
-rw-r--r-- | wsutil/filesystem.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index 284dd1d01e..5ed146a1d9 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -308,6 +308,17 @@ WS_DLL_PUBLIC gboolean files_identical(const char *fname1, const char *fname2); WS_DLL_PUBLIC gboolean file_needs_reopen(int fd, const char* filename); /* + * Write content to a file in binary mode, for those operating systems that + * care about such things. This should be OK for all files, even text files, as + * we'll write the raw bytes, and we don't look at the bytes as we copy them. + * + * Returns TRUE on success, FALSE on failure. If a failure, it also + * displays a simple dialog window with the error message. + */ +WS_DLL_PUBLIC gboolean write_file_binary_mode(const char *filename, + const void *content, size_t content_len); + +/* * Copy a file in binary mode, for those operating systems that care about * such things. This should be OK for all files, even text files, as * we'll copy the raw bytes, and we don't look at the bytes as we copy |