diff options
Diffstat (limited to 'src/fs/fs.h')
-rw-r--r-- | src/fs/fs.h | 137 |
1 files changed, 80 insertions, 57 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h index 68bab5916..11cfc755e 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -759,17 +759,17 @@ struct GNUNET_FS_SearchResult | |||
759 | * @param blocks number of blocks this download has | 759 | * @param blocks number of blocks this download has |
760 | * @return queue handle | 760 | * @return queue handle |
761 | */ | 761 | */ |
762 | struct GNUNET_FS_QueueEntry *GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, | 762 | struct GNUNET_FS_QueueEntry * |
763 | GNUNET_FS_QueueStart start, | 763 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, |
764 | GNUNET_FS_QueueStop stop, | 764 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks); |
765 | void *cls, unsigned int blocks); | ||
766 | 765 | ||
767 | 766 | ||
768 | /** | 767 | /** |
769 | * Dequeue a job from the queue. | 768 | * Dequeue a job from the queue. |
770 | * @param qh handle for the job | 769 | * @param qh handle for the job |
771 | */ | 770 | */ |
772 | void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | 771 | void |
772 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | ||
773 | 773 | ||
774 | 774 | ||
775 | /** | 775 | /** |
@@ -788,9 +788,9 @@ void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | |||
788 | * @param emsg location for the reader to store an error message | 788 | * @param emsg location for the reader to store an error message |
789 | * @return number of bytes written, usually "max", 0 on error | 789 | * @return number of bytes written, usually "max", 0 on error |
790 | */ | 790 | */ |
791 | size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | 791 | size_t |
792 | size_t max, void *buf, | 792 | GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf, |
793 | char **emsg); | 793 | char **emsg); |
794 | 794 | ||
795 | 795 | ||
796 | /** | 796 | /** |
@@ -799,7 +799,8 @@ size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | |||
799 | * @param filename file to read | 799 | * @param filename file to read |
800 | * @return closure to use | 800 | * @return closure to use |
801 | */ | 801 | */ |
802 | void *GNUNET_FS_make_file_reader_context_ (const char *filename); | 802 | void * |
803 | GNUNET_FS_make_file_reader_context_ (const char *filename); | ||
803 | 804 | ||
804 | 805 | ||
805 | 806 | ||
@@ -819,8 +820,9 @@ void *GNUNET_FS_make_file_reader_context_ (const char *filename); | |||
819 | * @param emsg location for the reader to store an error message | 820 | * @param emsg location for the reader to store an error message |
820 | * @return number of bytes written, usually "max", 0 on error | 821 | * @return number of bytes written, usually "max", 0 on error |
821 | */ | 822 | */ |
822 | size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | 823 | size_t |
823 | void *buf, char **emsg); | 824 | GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf, |
825 | char **emsg); | ||
824 | 826 | ||
825 | /** | 827 | /** |
826 | * Notification of FS that a search probe has made progress. | 828 | * Notification of FS that a search probe has made progress. |
@@ -837,9 +839,9 @@ size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | |||
837 | * will be passed to future callbacks in the respective | 839 | * will be passed to future callbacks in the respective |
838 | * field in the GNUNET_FS_ProgressInfo struct. | 840 | * field in the GNUNET_FS_ProgressInfo struct. |
839 | */ | 841 | */ |
840 | void *GNUNET_FS_search_probe_progress_ (void *cls, | 842 | void * |
841 | const struct GNUNET_FS_ProgressInfo | 843 | GNUNET_FS_search_probe_progress_ (void *cls, |
842 | *info); | 844 | const struct GNUNET_FS_ProgressInfo *info); |
843 | 845 | ||
844 | 846 | ||
845 | /** | 847 | /** |
@@ -848,8 +850,9 @@ void *GNUNET_FS_search_probe_progress_ (void *cls, | |||
848 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload | 850 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload |
849 | * @param tc task context | 851 | * @param tc task context |
850 | */ | 852 | */ |
851 | void GNUNET_FS_publish_main_ (void *cls, | 853 | void |
852 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 854 | GNUNET_FS_publish_main_ (void *cls, |
855 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
853 | 856 | ||
854 | 857 | ||
855 | /** | 858 | /** |
@@ -859,8 +862,8 @@ void GNUNET_FS_publish_main_ (void *cls, | |||
859 | * @param cls closure, unindex context | 862 | * @param cls closure, unindex context |
860 | * @param file_id computed hash, NULL on error | 863 | * @param file_id computed hash, NULL on error |
861 | */ | 864 | */ |
862 | void GNUNET_FS_unindex_process_hash_ (void *cls, | 865 | void |
863 | const GNUNET_HashCode * file_id); | 866 | GNUNET_FS_unindex_process_hash_ (void *cls, const GNUNET_HashCode * file_id); |
864 | 867 | ||
865 | 868 | ||
866 | /** | 869 | /** |
@@ -873,10 +876,11 @@ void GNUNET_FS_unindex_process_hash_ (void *cls, | |||
873 | * @param offset where in the file are we so far | 876 | * @param offset where in the file are we so far |
874 | * @return value returned from callback | 877 | * @return value returned from callback |
875 | */ | 878 | */ |
876 | void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 879 | void * |
877 | struct GNUNET_FS_PublishContext *sc, | 880 | GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
878 | const struct GNUNET_FS_FileInformation *p, | 881 | struct GNUNET_FS_PublishContext *sc, |
879 | uint64_t offset); | 882 | const struct GNUNET_FS_FileInformation *p, |
883 | uint64_t offset); | ||
880 | 884 | ||
881 | 885 | ||
882 | /** | 886 | /** |
@@ -886,8 +890,9 @@ void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
886 | * @param pi structure to fill in | 890 | * @param pi structure to fill in |
887 | * @param dc overall download context | 891 | * @param dc overall download context |
888 | */ | 892 | */ |
889 | void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 893 | void |
890 | struct GNUNET_FS_DownloadContext *dc); | 894 | GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
895 | struct GNUNET_FS_DownloadContext *dc); | ||
891 | 896 | ||
892 | 897 | ||
893 | /** | 898 | /** |
@@ -897,9 +902,9 @@ void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
897 | * @param cls the 'struct GNUNET_FS_DownloadContext' | 902 | * @param cls the 'struct GNUNET_FS_DownloadContext' |
898 | * @param tc scheduler context | 903 | * @param tc scheduler context |
899 | */ | 904 | */ |
900 | void GNUNET_FS_download_start_task_ (void *cls, | 905 | void |
901 | const struct GNUNET_SCHEDULER_TaskContext | 906 | GNUNET_FS_download_start_task_ (void *cls, |
902 | *tc); | 907 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
903 | 908 | ||
904 | 909 | ||
905 | 910 | ||
@@ -911,9 +916,10 @@ void GNUNET_FS_download_start_task_ (void *cls, | |||
911 | * @param uc overall unindex context | 916 | * @param uc overall unindex context |
912 | * @param offset where we are in the file (for progress) | 917 | * @param offset where we are in the file (for progress) |
913 | */ | 918 | */ |
914 | void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 919 | void |
915 | struct GNUNET_FS_UnindexContext *uc, | 920 | GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
916 | uint64_t offset); | 921 | struct GNUNET_FS_UnindexContext *uc, |
922 | uint64_t offset); | ||
917 | 923 | ||
918 | /** | 924 | /** |
919 | * Fill in all of the generic fields for a search event and | 925 | * Fill in all of the generic fields for a search event and |
@@ -923,8 +929,9 @@ void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
923 | * @param sc overall search context | 929 | * @param sc overall search context |
924 | * @return value returned by the callback | 930 | * @return value returned by the callback |
925 | */ | 931 | */ |
926 | void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 932 | void * |
927 | struct GNUNET_FS_SearchContext *sc); | 933 | GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
934 | struct GNUNET_FS_SearchContext *sc); | ||
928 | 935 | ||
929 | 936 | ||
930 | /** | 937 | /** |
@@ -932,7 +939,8 @@ void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
932 | * | 939 | * |
933 | * @param uc context for the unindex operation. | 940 | * @param uc context for the unindex operation. |
934 | */ | 941 | */ |
935 | void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | 942 | void |
943 | GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | ||
936 | 944 | ||
937 | /** | 945 | /** |
938 | * Build the request and actually initiate the search using the | 946 | * Build the request and actually initiate the search using the |
@@ -941,15 +949,16 @@ void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | |||
941 | * @param sc search context | 949 | * @param sc search context |
942 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 950 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
943 | */ | 951 | */ |
944 | int GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | 952 | int |
953 | GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | ||
945 | 954 | ||
946 | /** | 955 | /** |
947 | * Start the downloading process (by entering the queue). | 956 | * Start the downloading process (by entering the queue). |
948 | * | 957 | * |
949 | * @param dc our download context | 958 | * @param dc our download context |
950 | */ | 959 | */ |
951 | void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | 960 | void |
952 | *dc); | 961 | GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc); |
953 | 962 | ||
954 | 963 | ||
955 | /** | 964 | /** |
@@ -957,7 +966,8 @@ void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | |||
957 | * | 966 | * |
958 | * @param sr the search result | 967 | * @param sr the search result |
959 | */ | 968 | */ |
960 | void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | 969 | void |
970 | GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | ||
961 | 971 | ||
962 | /** | 972 | /** |
963 | * Remove serialization/deserialization file from disk. | 973 | * Remove serialization/deserialization file from disk. |
@@ -966,8 +976,9 @@ void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | |||
966 | * @param ext component of the path | 976 | * @param ext component of the path |
967 | * @param ent entity identifier | 977 | * @param ent entity identifier |
968 | */ | 978 | */ |
969 | void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | 979 | void |
970 | const char *ent); | 980 | GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, |
981 | const char *ent); | ||
971 | 982 | ||
972 | 983 | ||
973 | /** | 984 | /** |
@@ -977,8 +988,9 @@ void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
977 | * @param ext component of the path | 988 | * @param ext component of the path |
978 | * @param uni unique name of parent | 989 | * @param uni unique name of parent |
979 | */ | 990 | */ |
980 | void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | 991 | void |
981 | const char *uni); | 992 | GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, |
993 | const char *uni); | ||
982 | 994 | ||
983 | 995 | ||
984 | /** | 996 | /** |
@@ -989,7 +1001,8 @@ void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
989 | * | 1001 | * |
990 | * @param fi the struct to sync | 1002 | * @param fi the struct to sync |
991 | */ | 1003 | */ |
992 | void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | 1004 | void |
1005 | GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | ||
993 | 1006 | ||
994 | /** | 1007 | /** |
995 | * Synchronize this publishing struct with its mirror | 1008 | * Synchronize this publishing struct with its mirror |
@@ -999,7 +1012,8 @@ void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | |||
999 | * | 1012 | * |
1000 | * @param pc the struct to sync | 1013 | * @param pc the struct to sync |
1001 | */ | 1014 | */ |
1002 | void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | 1015 | void |
1016 | GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | ||
1003 | 1017 | ||
1004 | /** | 1018 | /** |
1005 | * Synchronize this unindex struct with its mirror | 1019 | * Synchronize this unindex struct with its mirror |
@@ -1009,7 +1023,8 @@ void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | |||
1009 | * | 1023 | * |
1010 | * @param uc the struct to sync | 1024 | * @param uc the struct to sync |
1011 | */ | 1025 | */ |
1012 | void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | 1026 | void |
1027 | GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | ||
1013 | 1028 | ||
1014 | /** | 1029 | /** |
1015 | * Synchronize this search struct with its mirror | 1030 | * Synchronize this search struct with its mirror |
@@ -1019,7 +1034,8 @@ void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | |||
1019 | * | 1034 | * |
1020 | * @param sc the struct to sync | 1035 | * @param sc the struct to sync |
1021 | */ | 1036 | */ |
1022 | void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | 1037 | void |
1038 | GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | ||
1023 | 1039 | ||
1024 | /** | 1040 | /** |
1025 | * Synchronize this search result with its mirror | 1041 | * Synchronize this search result with its mirror |
@@ -1029,7 +1045,8 @@ void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | |||
1029 | * | 1045 | * |
1030 | * @param sr the struct to sync | 1046 | * @param sr the struct to sync |
1031 | */ | 1047 | */ |
1032 | void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | 1048 | void |
1049 | GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | ||
1033 | 1050 | ||
1034 | /** | 1051 | /** |
1035 | * Synchronize this download struct with its mirror | 1052 | * Synchronize this download struct with its mirror |
@@ -1039,7 +1056,8 @@ void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | |||
1039 | * | 1056 | * |
1040 | * @param dc the struct to sync | 1057 | * @param dc the struct to sync |
1041 | */ | 1058 | */ |
1042 | void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | 1059 | void |
1060 | GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | ||
1043 | 1061 | ||
1044 | /** | 1062 | /** |
1045 | * Create SUSPEND event for the given publish operation | 1063 | * Create SUSPEND event for the given publish operation |
@@ -1047,7 +1065,8 @@ void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | |||
1047 | * | 1065 | * |
1048 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for | 1066 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for |
1049 | */ | 1067 | */ |
1050 | void GNUNET_FS_publish_signal_suspend_ (void *cls); | 1068 | void |
1069 | GNUNET_FS_publish_signal_suspend_ (void *cls); | ||
1051 | 1070 | ||
1052 | /** | 1071 | /** |
1053 | * Create SUSPEND event for the given search operation | 1072 | * Create SUSPEND event for the given search operation |
@@ -1055,7 +1074,8 @@ void GNUNET_FS_publish_signal_suspend_ (void *cls); | |||
1055 | * | 1074 | * |
1056 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for | 1075 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for |
1057 | */ | 1076 | */ |
1058 | void GNUNET_FS_search_signal_suspend_ (void *cls); | 1077 | void |
1078 | GNUNET_FS_search_signal_suspend_ (void *cls); | ||
1059 | 1079 | ||
1060 | /** | 1080 | /** |
1061 | * Create SUSPEND event for the given download operation | 1081 | * Create SUSPEND event for the given download operation |
@@ -1063,7 +1083,8 @@ void GNUNET_FS_search_signal_suspend_ (void *cls); | |||
1063 | * | 1083 | * |
1064 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for | 1084 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for |
1065 | */ | 1085 | */ |
1066 | void GNUNET_FS_download_signal_suspend_ (void *cls); | 1086 | void |
1087 | GNUNET_FS_download_signal_suspend_ (void *cls); | ||
1067 | 1088 | ||
1068 | /** | 1089 | /** |
1069 | * Create SUSPEND event for the given unindex operation | 1090 | * Create SUSPEND event for the given unindex operation |
@@ -1071,7 +1092,8 @@ void GNUNET_FS_download_signal_suspend_ (void *cls); | |||
1071 | * | 1092 | * |
1072 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for | 1093 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for |
1073 | */ | 1094 | */ |
1074 | void GNUNET_FS_unindex_signal_suspend_ (void *cls); | 1095 | void |
1096 | GNUNET_FS_unindex_signal_suspend_ (void *cls); | ||
1075 | 1097 | ||
1076 | /** | 1098 | /** |
1077 | * Function signature of the functions that can be called | 1099 | * Function signature of the functions that can be called |
@@ -1118,9 +1140,9 @@ struct TopLevelActivity | |||
1118 | * @param ssf_cls closure for ssf | 1140 | * @param ssf_cls closure for ssf |
1119 | * @return fresh top-level activity handle | 1141 | * @return fresh top-level activity handle |
1120 | */ | 1142 | */ |
1121 | struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | 1143 | struct TopLevelActivity * |
1122 | SuspendSignalFunction ssf, | 1144 | GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, |
1123 | void *ssf_cls); | 1145 | void *ssf_cls); |
1124 | 1146 | ||
1125 | 1147 | ||
1126 | /** | 1148 | /** |
@@ -1129,8 +1151,8 @@ struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | |||
1129 | * @param h global fs handle | 1151 | * @param h global fs handle |
1130 | * @param top top level activity entry | 1152 | * @param top top level activity entry |
1131 | */ | 1153 | */ |
1132 | void GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, | 1154 | void |
1133 | struct TopLevelActivity *top); | 1155 | GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top); |
1134 | 1156 | ||
1135 | 1157 | ||
1136 | 1158 | ||
@@ -1736,7 +1758,8 @@ struct DownloadRequest | |||
1736 | * | 1758 | * |
1737 | * @param dr request to free | 1759 | * @param dr request to free |
1738 | */ | 1760 | */ |
1739 | void GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | 1761 | void |
1762 | GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | ||
1740 | 1763 | ||
1741 | 1764 | ||
1742 | /** | 1765 | /** |