actube/src/cw/cw_put_image_data.c
7u83@mail.ru d4ddbc0618 Moved a lot of macros from capwap.h to cw.h
FossilOrigin-Name: 09114fbdffe3dd78d32f93da671f8f0cf9c40056a7b8f93114b12646f25db512
2016-03-11 21:23:00 +00:00

27 lines
303 B
C

#include "cw.h"
int cw_put_image_data(uint8_t *dst,FILE *infile)
{
int bytes = fread(dst+1,1,1024,infile);
if (ferror(infile)){
cw_put_byte(dst+0,5);
return 1;
}
if ( feof(infile)){
/* Last image block */
cw_put_byte(dst,2);
}
else{
cw_put_byte(dst,1);
}
return bytes+1;
}