X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_file.h;h=b52347574c05d440348a6a954b81be670bacb8cc;hb=07a12ade201ee7c2fe2358084ca079d2facac500;hp=20718c3f3b0a577624adbb03c7350fc1a1938e20;hpb=58aa424fadc697715b616e2f0d6134d194335e00;p=palacios.git diff --git a/palacios/include/palacios/vmm_file.h b/palacios/include/palacios/vmm_file.h index 20718c3..b523475 100644 --- a/palacios/include/palacios/vmm_file.h +++ b/palacios/include/palacios/vmm_file.h @@ -28,37 +28,37 @@ #define V3_FileOpen(path, mode) \ ({ \ - extern struct v3_file_hooks *file_hooks; \ - ((file_hooks) && (file_hooks)->file_open) ? \ - (file_hooks)->file_open((path), (mode)) : -1 ; \ + extern struct v3_file_hooks * file_hooks; \ + ((file_hooks) && (file_hooks)->file_open) ? \ + (file_hooks)->file_open((path), (mode)) : -1; \ }) #define V3_FileClose(fd) \ ({ \ - extern struct v3_file_hooks *file_hooks; \ - ((file_hooks) && (file_hooks)->file_close) ? \ - (file_hooks)->file_close((fd)) : -1 ; \ + extern struct v3_file_hooks * file_hooks; \ + ((file_hooks) && (file_hooks)->file_close) ? \ + (file_hooks)->file_close((fd)) : -1; \ }) -#define V3_FileSize(fd) \ +#define V3_FileSize(fd) \ ({ \ - extern struct v3_file_hooks *file_hooks; \ - ((file_hooks) && (file_hooks)->file_size) ? \ - (file_hooks)->file_size((fd)) : -1 ; \ + extern struct v3_file_hooks * file_hooks; \ + ((file_hooks) && (file_hooks)->file_size) ? \ + (file_hooks)->file_size((fd)) : -1; \ }) -#define V3_FileRead(fd,start,buf,len) \ +#define V3_FileRead(fd, start, buf, len) \ ({ \ - extern struct v3_file_hooks *file_hooks; \ - ((file_hooks) && (file_hooks)->file_read) ? \ - (file_hooks)->file_read((fd),(start),(buf),(len)) : -1 ; \ + extern struct v3_file_hooks * file_hooks; \ + ((file_hooks) && (file_hooks)->file_read) ? \ + (file_hooks)->file_read((fd), (buf), (len), (start)) : -1; \ }) #define V3_FileWrite(fd,start,buf,len) \ ({ \ - extern struct v3_file_hooks *file_hooks; \ - ((file_hooks) && (file_hooks)->file_write) ? \ - (file_hooks)->file_write((fd),(start),(buf),(len)) : -1 ; \ + extern struct v3_file_hooks * file_hooks; \ + ((file_hooks) && (file_hooks)->file_write) ? \ + (file_hooks)->file_write((fd), (buf), (len), (start)) : -1; \ }) @@ -69,14 +69,14 @@ struct v3_file_hooks { - int (*file_open)(const char *path, int mode); + int (*file_open)(const char * path, int mode); int (*file_close)(int fd); long long (*file_size)(int fd); // blocking reads and writes - long long (*file_read)(int fd, long long start, void *buffer, long long length); - long long (*file_write)(int fd, long long start, void *buffer, long long length); + long long (*file_read)(int fd, void * buffer, long long length, long long offset); + long long (*file_write)(int fd, void * buffer, long long length, long long offset); };