Update example with D ABI

Signed-off-by: Ernesto Castellotti <erny.castell@gmail.com>
This commit is contained in:
Ernesto Castellotti 2019-08-26 01:20:38 +02:00
parent c298f5eed0
commit 082d4663fd
1 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,13 @@ extern(C) int main(int argc, char[]* argv) {
return 1;
}
auto f = fopen(argv[1].ptr, "rb");
auto f = fopen(argv[0].ptr, "rb");
if (!f) {
printf("Open error with file: %s\n", argv[0].ptr);
return 1;
}
fseek(f, 0, SEEK_END);
auto fsize = ftell(f);
@ -25,12 +31,12 @@ extern(C) int main(int argc, char[]* argv) {
usb_extreme_headers headers;
if (oue_read_headers(&headers, data, size) <= 0) {
if (oueReadHeaders(headers, data, size) <= 0) {
return 1;
}
usb_extreme_filestat[10] filestats = void;
int nstats = oue_read(filestats.ptr, headers, 10);
int nstats = oueRead(filestats, headers);
int i;
for(i = 0; i < nstats; i++) {