summaryrefslogtreecommitdiffstats
path: root/src/file_logic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_logic.c')
-rw-r--r--src/file_logic.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/file_logic.c b/src/file_logic.c
index 1e418d6..ac3bc5a 100644
--- a/src/file_logic.c
+++ b/src/file_logic.c
@@ -31,7 +31,6 @@
#include "filegen.h"
static void register_header_check_logic(file_stat_t *file_stat);
-static int header_check_logic(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_logic= {
.extension="logic",
@@ -43,22 +42,17 @@ const file_hint_t file_hint_logic= {
.register_header_check=&register_header_check_logic
};
-static const unsigned char logic_header[12]= {
- 0xab, 0xc0, 0x47, 0x13, 0x05, 0x17, 0x00, 0x15, 0x00, 0x04, 0x00, 0x24
-};
-
-static void register_header_check_logic(file_stat_t *file_stat)
+static int header_check_logic(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(0, logic_header,sizeof(logic_header), &header_check_logic, file_stat);
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_logic.extension;
+ return 1;
}
-static int header_check_logic(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_logic(file_stat_t *file_stat)
{
- if(memcmp(buffer,logic_header,sizeof(logic_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_logic.extension;
- return 1;
- }
- return 0;
+ static const unsigned char logic_header[12]= {
+ 0xab, 0xc0, 0x47, 0x13, 0x05, 0x17, 0x00, 0x15, 0x00, 0x04, 0x00, 0x24
+ };
+ register_header_check(0, logic_header,sizeof(logic_header), &header_check_logic, file_stat);
}