aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_file_information.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-04-30 13:41:07 +0000
committerChristian Grothoff <christian@grothoff.org>2010-04-30 13:41:07 +0000
commite67c5886c645a5fda7753d3f72f62ea655d6655b (patch)
tree3058a0f96ddc820a97e38e47d87e6ebf685b23b8 /src/fs/fs_file_information.c
parentd59ea5663203392637e84dea69feb9671ca2a3de (diff)
downloadgnunet-e67c5886c645a5fda7753d3f72f62ea655d6655b.tar.gz
gnunet-e67c5886c645a5fda7753d3f72f62ea655d6655b.zip
fixes
Diffstat (limited to 'src/fs/fs_file_information.c')
-rw-r--r--src/fs/fs_file_information.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index df5593f75..df53bcc1c 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -131,41 +131,6 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
131 131
132 132
133/** 133/**
134 * Function that provides data by copying from a buffer.
135 *
136 * @param cls closure (points to the buffer)
137 * @param offset offset to read from; it is possible
138 * that the caller might need to go backwards
139 * a bit at times
140 * @param max maximum number of bytes that should be
141 * copied to buf; readers are not allowed
142 * to provide less data unless there is an error;
143 * a value of "0" will be used at the end to allow
144 * the reader to clean up its internal state
145 * @param buf where the reader should write the data
146 * @param emsg location for the reader to store an error message
147 * @return number of bytes written, usually "max", 0 on error
148 */
149static size_t
150data_reader_copy(void *cls,
151 uint64_t offset,
152 size_t max,
153 void *buf,
154 char **emsg)
155{
156 char *data = cls;
157
158 if (max == 0)
159 {
160 GNUNET_free (data);
161 return 0;
162 }
163 memcpy (buf, &data[offset], max);
164 return max;
165}
166
167
168/**
169 * Create an entry for a file in a publish-structure. 134 * Create an entry for a file in a publish-structure.
170 * 135 *
171 * @param h handle to the file sharing subsystem 136 * @param h handle to the file sharing subsystem
@@ -205,7 +170,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
205 return GNUNET_FS_file_information_create_from_reader (h, 170 return GNUNET_FS_file_information_create_from_reader (h,
206 client_info, 171 client_info,
207 length, 172 length,
208 &data_reader_copy, 173 &GNUNET_FS_data_reader_copy_,
209 data, 174 data,
210 keywords, 175 keywords,
211 meta, 176 meta,