btr.h (548B)
1 typedef struct Btrmsgheader Btrmsgheader; 2 struct Btrmsgheader { 3 int op; 4 vlong id; 5 long nbytes; 6 vlong offset; 7 }; 8 9 enum { 10 BNone, 11 BTstat, 12 BRstat, 13 BRerror, 14 }; 15 16 typedef struct Btrstat Btrstat; 17 struct Btrstat { 18 vlong id; 19 int type; 20 vlong length; 21 }; 22 23 typedef struct Btrctl Btrctl; 24 struct Btrctl { 25 int fd; 26 }; 27 28 Btrstat bstat(Btrctl *bc, vlong id); 29 Btrctl* initbtr(char *path); 30 long bpread(Btrctl *bc, vlong id, void *buf, long nbytes, vlong offset); 31 long bpwrite(Btrctl *bc, vlong id, void *buf, long nbytes, vlong offset); 32 33 //bsendmsg 34 //brecvmsg