comparison libgaim/protocols/qq/file_trans.c @ 14896:fe184dbde619

[gaim-migrate @ 17668] Eliminate this union, as suggested by elb and nosnilmot. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Sun, 05 Nov 2006 00:11:52 +0000
parents dfd272ab67e7
children c039c920e11c
comparison
equal deleted inserted replaced
14895:717ea4589f8d 14896:fe184dbde619
216 } 216 }
217 #else 217 #else
218 static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer) 218 static int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer)
219 { 219 {
220 ft_info *info = xfer->data; 220 ft_info *info = xfer->data;
221 info->u.dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method); 221 info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method);
222 if (info->u.dest_fp == NULL) { 222 if (info->dest_fp == NULL) {
223 return -1; 223 return -1;
224 } 224 }
225 return 0; 225 return 0;
226 } 226 }
227 227
228 static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) 228 static gint _qq_xfer_read_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer)
229 { 229 {
230 ft_info *info = xfer->data; 230 ft_info *info = xfer->data;
231 231
232 fseek(info->u.dest_fp, index * len, SEEK_SET); 232 fseek(info->dest_fp, index * len, SEEK_SET);
233 return fread(buffer, 1, len, info->u.dest_fp); 233 return fread(buffer, 1, len, info->dest_fp);
234 } 234 }
235 235
236 static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer) 236 static gint _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer)
237 { 237 {
238 ft_info *info = xfer->data; 238 ft_info *info = xfer->data;
239 fseek(info->u.dest_fp, index * len, SEEK_SET); 239 fseek(info->dest_fp, index * len, SEEK_SET);
240 return fwrite(buffer, 1, len, info->u.dest_fp); 240 return fwrite(buffer, 1, len, info->dest_fp);
241 } 241 }
242 242
243 void qq_xfer_close_file(GaimXfer *xfer) 243 void qq_xfer_close_file(GaimXfer *xfer)
244 { 244 {
245 ft_info *info = xfer->data; 245 ft_info *info = xfer->data;
246 246
247 if (info->u.dest_fp) fclose(info->u.dest_fp); 247 if (info->dest_fp) fclose(info->dest_fp);
248 } 248 }
249 #endif 249 #endif
250 250
251 static gint _qq_send_file(GaimConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid) 251 static gint _qq_send_file(GaimConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid)
252 { 252 {