summaryrefslogtreecommitdiffstats
path: root/src/file_bld.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:36:24 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:40:04 +0100
commit3213247d998d58627eb4029afce6be8680de3b30 (patch)
tree96d4a64aca2201410703b5c15589715fe1557aa1 /src/file_bld.c
parent5de0329f2184bdf89e087f414b651448df096c1f (diff)
PhotoRec: use an enum for values returned by data_check()
rename .m2ts and .ts using pid from header
Diffstat (limited to 'src/file_bld.c')
-rw-r--r--src/file_bld.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/file_bld.c b/src/file_bld.c
index 5fdb2ad..ad8777b 100644
--- a/src/file_bld.c
+++ b/src/file_bld.c
@@ -33,10 +33,10 @@
static void register_header_check_blend(file_stat_t *file_stat);
static int header_check_blend(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 int data_check_blend4le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
-static int data_check_blend8le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
-static int data_check_blend4be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
-static int data_check_blend8be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
+static data_check_t data_check_blend4le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
+static data_check_t data_check_blend8le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
+static data_check_t data_check_blend4be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
+static data_check_t data_check_blend8be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);
const file_hint_t file_hint_blend= {
.extension="blend",
@@ -83,7 +83,7 @@ static int header_check_blend(const unsigned char *buffer, const unsigned int bu
return 0;
}
-static int data_check_blend4le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_blend4le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + buffer_size/2 >= file_recovery->file_size &&
file_recovery->calculated_file_size + 0x14 < file_recovery->file_size + buffer_size/2)
@@ -100,14 +100,14 @@ static int data_check_blend4le(const unsigned char *buffer, const unsigned int b
if(memcmp(&buffer[i],blend_header_footer,sizeof(blend_header_footer))==0)
{
file_recovery->calculated_file_size+=0x14;
- return 2;
+ return DC_STOP;
}
file_recovery->calculated_file_size+=0x14+len;
}
- return 1;
+ return DC_CONTINUE;
}
-static int data_check_blend8le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_blend8le(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + 0x18 < file_recovery->file_size + buffer_size/2)
{
@@ -123,14 +123,14 @@ static int data_check_blend8le(const unsigned char *buffer, const unsigned int b
if(memcmp(&buffer[i],blend_header_footer,sizeof(blend_header_footer))==0)
{
file_recovery->calculated_file_size+=0x18;
- return 2;
+ return DC_STOP;
}
file_recovery->calculated_file_size+=0x18+len;
}
- return 1;
+ return DC_CONTINUE;
}
-static int data_check_blend4be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_blend4be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + 0x14 < file_recovery->file_size + buffer_size/2)
{
@@ -146,14 +146,14 @@ static int data_check_blend4be(const unsigned char *buffer, const unsigned int b
if(memcmp(&buffer[i],blend_header_footer,sizeof(blend_header_footer))==0)
{
file_recovery->calculated_file_size+=0x14;
- return 2;
+ return DC_STOP;
}
file_recovery->calculated_file_size+=0x14+len;
}
- return 1;
+ return DC_CONTINUE;
}
-static int data_check_blend8be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_blend8be(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
while(file_recovery->calculated_file_size + 0x18 < file_recovery->file_size + buffer_size/2)
{
@@ -169,9 +169,9 @@ static int data_check_blend8be(const unsigned char *buffer, const unsigned int b
if(memcmp(&buffer[i],blend_header_footer,sizeof(blend_header_footer))==0)
{
file_recovery->calculated_file_size+=0x18;
- return 2;
+ return DC_STOP;
}
file_recovery->calculated_file_size+=0x18+len;
}
- return 1;
+ return DC_CONTINUE;
}