summaryrefslogtreecommitdiffstats
path: root/src/file_mus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_mus.c')
-rw-r--r--src/file_mus.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/file_mus.c b/src/file_mus.c
index 459460d..fcfa88c 100644
--- a/src/file_mus.c
+++ b/src/file_mus.c
@@ -30,10 +30,7 @@
#include "types.h"
#include "filegen.h"
-
static void register_header_check_mus(file_stat_t *file_stat);
-static int header_check_mus(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new);
-static void file_check_mus(file_recovery_t *file_recovery);
const file_hint_t file_hint_mus= {
.extension="mus",
@@ -45,28 +42,23 @@ const file_hint_t file_hint_mus= {
.register_header_check=&register_header_check_mus
};
-static const unsigned char mus_header[18] = { 'E','N','I','G','M','A',' ','B','I','N','A','R','Y',' ','F','I','L','E' };
-
-static void register_header_check_mus(file_stat_t *file_stat)
+static void file_check_mus(file_recovery_t *file_recovery)
{
- register_header_check(0, mus_header,sizeof(mus_header), &header_check_mus, file_stat);
+ const unsigned char mus_footer[5]= {'-','^','e','n','d'};
+ file_search_footer(file_recovery, mus_footer, sizeof(mus_footer), 0);
}
static int header_check_mus(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
- if(memcmp(buffer,mus_header,sizeof(mus_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->min_filesize=18;
- file_recovery_new->file_check=&file_check_mus;
- file_recovery_new->extension=file_hint_mus.extension;
- return 1;
- }
- return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->min_filesize=18;
+ file_recovery_new->file_check=&file_check_mus;
+ file_recovery_new->extension=file_hint_mus.extension;
+ return 1;
}
-static void file_check_mus(file_recovery_t *file_recovery)
+static void register_header_check_mus(file_stat_t *file_stat)
{
- const unsigned char mus_footer[5]= {'-','^','e','n','d'};
- file_search_footer(file_recovery, mus_footer, sizeof(mus_footer), 0);
+ static const unsigned char mus_header[18] = { 'E','N','I','G','M','A',' ','B','I','N','A','R','Y',' ','F','I','L','E' };
+ register_header_check(0, mus_header,sizeof(mus_header), &header_check_mus, file_stat);
}