diff --git a/readme.txt b/readme.txt index 778ff5d..929d4d8 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Mugen sound extractor by Popov Evgeniy Alekseyevich - Version 2.3.5.1 + Version 2.3.6 System requirement @@ -17,9 +17,10 @@ This program takes a target file name as command line argument. Exit codes 0 - Operation successfully complete. -1 - Can't allocate memory. -2 - File operation error. -3 - Invalid format. +1 - Can't open input file. +2 - Can't create output file. +3 - Can't allocate memory. +4 - Invalid format. License @@ -57,4 +58,5 @@ Version history 2.3.1 - Source code was improved. Linux support has been added. 2.3.1.0.1 – Documentation was updated. 2.3.2 - 2.3.5 - Small changes. -2.3.5.1 - Makefile was updated. \ No newline at end of file +2.3.5.1 - Makefile was updated. +2.3.6 - Small changes. \ No newline at end of file diff --git a/sndextract.c b/sndextract.c index 21ac37f..e4ed090 100644 --- a/sndextract.c +++ b/sndextract.c @@ -14,6 +14,7 @@ FILE *create_output_file(const char *name); void go_offset(FILE *file,const unsigned long int offset); unsigned long int get_file_size(FILE *file); void data_dump(FILE *input,FILE *output,const size_t length); +void fast_data_dump(FILE *input,FILE *output,const size_t length); void write_output_file(FILE *input,const char *name,const size_t length); char *get_string_memory(const size_t length); size_t get_extension_position(const char *source); @@ -43,28 +44,28 @@ int main(int argc, char *argv[]) void show_intro() { - puts(" "); + putchar('\n'); puts("SND EXTRACT"); - puts("Version 2.3.5"); - puts("Mugen sound extractor by Popov Evgeniy Alekseyevich, 2008-2018 year"); + puts("Version 2.3.6"); + puts("Mugen sound extractor by Popov Evgeniy Alekseyevich, 2008-2019 years"); puts("This program distributed under GNU GENERAL PUBLIC LICENSE"); } void command_line_help() { - puts(" "); + putchar('\n'); puts("You must give a target file name as command line argument!"); } void show_start_message() { - puts(" "); + putchar('\n'); puts("Extracting a sounds... Please wait"); } void show_end_message() { - puts(" "); + putchar('\n'); puts("Work finish"); } @@ -80,28 +81,28 @@ void show_progress(const unsigned long int start,const unsigned long int stop) FILE *open_input_file(const char *name) { - FILE *file; - file=fopen(name,"rb"); - if (file==NULL) + FILE *target; + target=fopen(name,"rb"); + if (target==NULL) { - puts(" "); - puts("File operation error"); - exit(2); + putchar('\n'); + puts("Can't open input file"); + exit(1); } - return file; + return target; } FILE *create_output_file(const char *name) { - FILE *file; - file=fopen(name,"wb"); - if (file==NULL) + FILE *target; + target=fopen(name,"wb"); + if (target==NULL) { - puts(" "); - puts("File operation error"); + putchar('\n'); + puts("Can't create ouput file"); exit(2); } - return file; + return target; } void go_offset(FILE *file,const unsigned long int offset) @@ -120,23 +121,29 @@ unsigned long int get_file_size(FILE *file) void data_dump(FILE *input,FILE *output,const size_t length) { - unsigned char single_byte; + unsigned char data; size_t index; + data=0; + for (index=0;index