syncfiles/copy.c
Dietrich Epp 79bca732c8 Convert resource files
GitOrigin-RevId: ee47a60e097c818def27f799dfd97c1396be2a68
2021-03-24 04:20:46 -04:00

20 lines
351 B
C

#include "convert.h"
int copy_data(short srcRef, short destRef, void *buf) {
long count;
int r, r2;
do {
count = kBufferBaseSize;
r = convert_read(srcRef, &count, buf);
if (r == kConvertError) {
return 1;
}
r2 = convert_write(destRef, count, buf);
if (r2 != kConvertOK) {
return 1;
}
} while (r != kConvertEOF);
return 0;
}