PhotoRec: src/file_ses.c code reorganisation
This commit is contained in:
parent
00e01f8727
commit
2326a5f02d
1 changed files with 7 additions and 19 deletions
|
@ -26,16 +26,12 @@
|
|||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "types.h"
|
||||
#include "common.h"
|
||||
#include "filegen.h"
|
||||
|
||||
static void register_header_check_ses(file_stat_t *file_stat);
|
||||
static int header_check_ses(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_ses= {
|
||||
.extension="ses",
|
||||
|
@ -47,22 +43,14 @@ const file_hint_t file_hint_ses= {
|
|||
.register_header_check=®ister_header_check_ses
|
||||
};
|
||||
|
||||
static const unsigned char ses_magic[8]= {
|
||||
'C', 'O', 'O', 'L', 'N', 'E', 'S', 'S'
|
||||
};
|
||||
static int header_check_ses(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)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_ses.extension;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void register_header_check_ses(file_stat_t *file_stat)
|
||||
{
|
||||
register_header_check(0, ses_magic, sizeof(ses_magic), &header_check_ses, file_stat);
|
||||
}
|
||||
|
||||
static int header_check_ses(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, ses_magic, sizeof(ses_magic))==0)
|
||||
{
|
||||
reset_file_recovery(file_recovery_new);
|
||||
file_recovery_new->extension=file_hint_ses.extension;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
register_header_check(0, "COOLNESS", 8, &header_check_ses, file_stat);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue