summaryrefslogtreecommitdiffstats
path: root/src/file_freeway.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_freeway.c')
-rw-r--r--src/file_freeway.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/file_freeway.c b/src/file_freeway.c
index 1aae1d4..3711771 100644
--- a/src/file_freeway.c
+++ b/src/file_freeway.c
@@ -31,7 +31,6 @@
#include "filegen.h"
static void register_header_check_freeway(file_stat_t *file_stat);
-static int header_check_freeway(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);
const file_hint_t file_hint_freeway= {
.extension="freeway",
@@ -43,24 +42,18 @@ const file_hint_t file_hint_freeway= {
.register_header_check=&register_header_check_freeway
};
-static const unsigned char freeway_header[0x10]= {
- 0x13, 'F' , 'r' , 'e' , 'e' , 'w' , 'a' , 'y' ,
- ' ' , '5' , ' ' , 'P' , 'r' , 'o' , ' ' , '5' ,
-};
-
-static void register_header_check_freeway(file_stat_t *file_stat)
+static int header_check_freeway(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)
{
- register_header_check(0x10, freeway_header, sizeof(freeway_header), &header_check_freeway, file_stat);
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_freeway.extension;
+ return 1;
}
-static int header_check_freeway(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 register_header_check_freeway(file_stat_t *file_stat)
{
- if(memcmp(&buffer[0x10], freeway_header, sizeof(freeway_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_freeway.extension;
- return 1;
- }
- return 0;
+ static const unsigned char freeway_header[0x10]= {
+ 0x13, 'F' , 'r' , 'e' , 'e' , 'w' , 'a' , 'y' ,
+ ' ' , '5' , ' ' , 'P' , 'r' , 'o' , ' ' , '5' ,
+ };
+ register_header_check(0x10, freeway_header, sizeof(freeway_header), &header_check_freeway, file_stat);
}
-