mirror of
https://github.com/depp/syncfiles.git
synced 2024-11-25 08:30:55 +00:00
79bca732c8
GitOrigin-RevId: ee47a60e097c818def27f799dfd97c1396be2a68
20 lines
351 B
C
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;
|
|
}
|