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 FILE *f
= fopen( argv
[1], "rb" );
19 vg_error( "vg_disk_open_read: %s\n", strerror(errno
) );
26 for( u32 i
=0; 1; i
++ ){
27 buffer
= realloc( buffer
, current
+ CHUNK_SIZE
);
28 u64 l
= fread( buffer
+ current
, 1, CHUNK_SIZE
, f
);
31 if( l
!= CHUNK_SIZE
){
38 vg_fatal_error( "read error" );
42 vg_fatal_error( "unknown error codition" );
51 vg_msg_init( &msg
, buffer
, current
);
52 vg_msg_print( &msg
, current
);