aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_file.h')
-rw-r--r--src/gnunet_chat_file.h79
1 files changed, 71 insertions, 8 deletions
diff --git a/src/gnunet_chat_file.h b/src/gnunet_chat_file.h
index e4f4e12..3642896 100644
--- a/src/gnunet_chat_file.h
+++ b/src/gnunet_chat_file.h
@@ -32,6 +32,38 @@
32#include <gnunet/gnunet_messenger_service.h> 32#include <gnunet/gnunet_messenger_service.h>
33#include <gnunet/gnunet_util_lib.h> 33#include <gnunet/gnunet_util_lib.h>
34 34
35#include "gnunet_chat_lib.h"
36
37struct GNUNET_CHAT_FileUpload
38{
39 struct GNUNET_CHAT_FileUpload* prev;
40 struct GNUNET_CHAT_FileUpload* next;
41
42 GNUNET_CHAT_FileUploadCallback callback;
43
44 void *cls;
45};
46
47struct GNUNET_CHAT_FileDownload
48{
49 struct GNUNET_CHAT_FileDownload* prev;
50 struct GNUNET_CHAT_FileDownload* next;
51
52 GNUNET_CHAT_FileDownloadCallback callback;
53
54 void *cls;
55};
56
57struct GNUNET_CHAT_FileUnindex
58{
59 struct GNUNET_CHAT_FileUnindex* prev;
60 struct GNUNET_CHAT_FileUnindex* next;
61
62 GNUNET_CHAT_FileUnindexCallback callback;
63
64 void *cls;
65};
66
35struct GNUNET_CHAT_Handle; 67struct GNUNET_CHAT_Handle;
36 68
37struct GNUNET_CHAT_File 69struct GNUNET_CHAT_File
@@ -43,16 +75,23 @@ struct GNUNET_CHAT_File
43 struct GNUNET_HashCode hash; 75 struct GNUNET_HashCode hash;
44 struct GNUNET_CRYPTO_SymmetricSessionKey key; 76 struct GNUNET_CRYPTO_SymmetricSessionKey key;
45 77
46 uint64_t published;
47 uint64_t downloaded;
48 uint64_t unindexed;
49
50 struct GNUNET_CONTAINER_MetaData *meta; 78 struct GNUNET_CONTAINER_MetaData *meta;
51 79
52 struct GNUNET_FS_Uri* uri; 80 struct GNUNET_FS_Uri *uri;
53 struct GNUNET_FS_DownloadContext* download; 81 struct GNUNET_FS_DownloadContext *download;
54 struct GNUNET_FS_PublishContext* publish; 82 struct GNUNET_FS_PublishContext *publish;
55 struct GNUNET_FS_UnindexContext* unindex; 83 struct GNUNET_FS_UnindexContext *unindex;
84
85 struct GNUNET_CHAT_FileUpload *upload_head;
86 struct GNUNET_CHAT_FileUpload *upload_tail;
87
88 struct GNUNET_CHAT_FileDownload *download_head;
89 struct GNUNET_CHAT_FileDownload *download_tail;
90
91 struct GNUNET_CHAT_FileUnindex *unindex_head;
92 struct GNUNET_CHAT_FileUnindex *unindex_tail;
93
94 void *user_pointer;
56}; 95};
57 96
58struct GNUNET_CHAT_File* 97struct GNUNET_CHAT_File*
@@ -67,4 +106,28 @@ file_create_from_disk (struct GNUNET_CHAT_Handle *handle,
67void 106void
68file_destroy (struct GNUNET_CHAT_File* file); 107file_destroy (struct GNUNET_CHAT_File* file);
69 108
109void
110file_bind_upload (struct GNUNET_CHAT_File* file,
111 GNUNET_CHAT_FileUploadCallback cb, void *cls);
112
113void
114file_bind_downlaod (struct GNUNET_CHAT_File* file,
115 GNUNET_CHAT_FileDownloadCallback cb, void *cls);
116
117void
118file_bind_unindex (struct GNUNET_CHAT_File* file,
119 GNUNET_CHAT_FileUnindexCallback cb, void *cls);
120
121void
122file_update_upload (struct GNUNET_CHAT_File* file, uint64_t completed,
123 uint64_t size);
124
125void
126file_update_download (struct GNUNET_CHAT_File* file, uint64_t completed,
127 uint64_t size);
128
129void
130file_update_unindex (struct GNUNET_CHAT_File* file, uint64_t completed,
131 uint64_t size);
132
70#endif /* GNUNET_CHAT_FILE_H_ */ 133#endif /* GNUNET_CHAT_FILE_H_ */