#include #include #include #include "surface.h" Surf surf; char string[65536]; void main(void) { int n, rc; unsigned char buf[32]; unsigned int version; FILE *fp; surf_init(&surf); version = surf_version(&surf); rc = surf_descriptor(&surf, 0x80, 0x06, 0x0303, 0x03, buf, sizeof(buf)); n = surf_peek_queue(&surf); surf_poke_queue(&surf,"hello, world\n"); n = surf_peek_queue(&surf); n = surf_read_queue(&surf,string,sizeof(string)); fp = fopen("c:/file.foo", "wb"); fwrite(string, 1, n, fp); fclose(fp); surf_close(&surf); }