aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2022-01-14 22:58:15 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2022-01-14 22:58:15 +0100
commitae5feca119e594767102ce7bcc17d1a3b7580a52 (patch)
treeda00a4ea4e72f05de67d30a604b0d2ca2c0c54cb /include
parent4db9842adc64fe254a2e61ce214b2fabb2fc67f8 (diff)
downloadlibgnunetchat-ae5feca119e594767102ce7bcc17d1a3b7580a52.tar.gz
libgnunetchat-ae5feca119e594767102ce7bcc17d1a3b7580a52.zip
Adjusted API to get current status of file processing
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/gnunet_chat_lib.h45
1 files changed, 40 insertions, 5 deletions
diff --git a/include/gnunet_chat_lib.h b/include/gnunet_chat_lib.h
index 8e8ec4e..7675ad1 100644
--- a/include/gnunet_chat_lib.h
+++ b/include/gnunet_chat_lib.h
@@ -797,7 +797,7 @@ const struct GNUNET_HashCode*
797GNUNET_CHAT_file_get_hash (const struct GNUNET_CHAT_File *file); 797GNUNET_CHAT_file_get_hash (const struct GNUNET_CHAT_File *file);
798 798
799/** 799/**
800 * Returns the file size of a given <i>file</i> handle. 800 * Returns the actual file size of a given <i>file</i> handle.
801 * 801 *
802 * @param[in] file File handle 802 * @param[in] file File handle
803 * @return The file size of file 803 * @return The file size of file
@@ -806,19 +806,33 @@ uint64_t
806GNUNET_CHAT_file_get_size (const struct GNUNET_CHAT_File *file); 806GNUNET_CHAT_file_get_size (const struct GNUNET_CHAT_File *file);
807 807
808/** 808/**
809 * Checks whether a file locally exists of a given <i>file</i> handle and 809 * Returns the local file size of a given <i>file</i> handle.
810 * returns #GNUNET_YES in that case, otherwise #GNUNET_NO. 810 *
811 * This can be less than the actual size of the file once its download
812 * has been completed!
811 * 813 *
812 * @param[in] file File handle 814 * @param[in] file File handle
813 * @return #GNUNET_YES if the file exists locally, otherwise #GNUNET_NO 815 * @return The local file size of file
816 */
817uint64_t
818GNUNET_CHAT_file_get_local_size (const struct GNUNET_CHAT_File *file);
819
820/**
821 * Returns if a given <i>file</i> handle is currently uploading.
822 *
823 * @param[in] file File handle
824 * @return #GNUNET_YES during active upload, #GNUNET_NO otherwise
814 */ 825 */
815int 826int
816GNUNET_CHAT_file_is_local (const struct GNUNET_CHAT_File *file); 827GNUNET_CHAT_file_is_uploading (const struct GNUNET_CHAT_File *file);
817 828
818/** 829/**
819 * Returns the temporary file name of the decrypted file preview 830 * Returns the temporary file name of the decrypted file preview
820 * of a given <i>file</i> handle. 831 * of a given <i>file</i> handle.
821 * 832 *
833 * This can only be used when the file handle is ready to preview!
834 * @see GNUNET_CHAT_file_is_ready()
835 *
822 * @param[in,out] file File handle 836 * @param[in,out] file File handle
823 * @return The temporary file name or NULL on error 837 * @return The temporary file name or NULL on error
824 */ 838 */
@@ -829,6 +843,9 @@ GNUNET_CHAT_file_open_preview (struct GNUNET_CHAT_File *file);
829 * Deletes the temporary decrypted file preview of a given <i>file</i> 843 * Deletes the temporary decrypted file preview of a given <i>file</i>
830 * handle. 844 * handle.
831 * 845 *
846 * This can only be used when the file handle is ready to preview!
847 * @see GNUNET_CHAT_file_is_ready()
848 *
832 * @param[out] file File handle 849 * @param[out] file File handle
833 */ 850 */
834void 851void
@@ -856,6 +873,15 @@ void*
856GNUNET_CHAT_file_get_user_pointer (const struct GNUNET_CHAT_File *file); 873GNUNET_CHAT_file_get_user_pointer (const struct GNUNET_CHAT_File *file);
857 874
858/** 875/**
876 * Returns if a given <i>file</i> handle is currently downloading.
877 *
878 * @param[in] file File handle
879 * @return #GNUNET_YES during active download, #GNUNET_NO otherwise
880 */
881int
882GNUNET_CHAT_file_is_downloading (const struct GNUNET_CHAT_File *file);
883
884/**
859 * Starts downloading a file from a given <i>file</i> handle and sets up a 885 * Starts downloading a file from a given <i>file</i> handle and sets up a
860 * selected callback and custom closure for its progress. 886 * selected callback and custom closure for its progress.
861 * 887 *
@@ -897,6 +923,15 @@ int
897GNUNET_CHAT_file_stop_download (struct GNUNET_CHAT_File *file); 923GNUNET_CHAT_file_stop_download (struct GNUNET_CHAT_File *file);
898 924
899/** 925/**
926 * Returns if a given <i>file</i> handle is currently unindexing.
927 *
928 * @param[in] file File handle
929 * @return #GNUNET_YES during active unindexing, #GNUNET_NO otherwise
930 */
931int
932GNUNET_CHAT_file_is_unindexing (const struct GNUNET_CHAT_File *file);
933
934/**
900 * Unindexes an uploaded file from a given <i>file</i> handle with a selected 935 * Unindexes an uploaded file from a given <i>file</i> handle with a selected
901 * callback and a custom closure. 936 * callback and a custom closure.
902 * 937 *