1 // Copyright (C) 2021-2023 Harry Godden (hgn) - All Rights Reserved
7 #define CHUNK_SIZE 4096
9 int main( int argc
, char *argv
[] ){
13 vg_error( "Usage: %s <file>\n", argv
[0] );
17 for( int i
=0; i
<argc
-1; i
++ ){
18 FILE *f
= fopen( argv
[i
+1], "rb" );
20 vg_error( "vg_disk_open_read: %s\n", strerror(errno
) );
27 for( u32 i
=0; 1; i
++ ){
28 buffer
= realloc( buffer
, current
+ CHUNK_SIZE
);
29 u64 l
= fread( buffer
+ current
, 1, CHUNK_SIZE
, f
);
32 if( l
!= CHUNK_SIZE
){
39 vg_fatal_error( "read error" );
43 vg_fatal_error( "unknown error codition" );
51 printf( "%s (%u bytes):", argv
[i
+1], (u32
)current
);
54 vg_msg_init( &msg
, buffer
, current
);
55 vg_msg_print( &msg
, current
);