summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-10-13 11:06:57 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-10-13 11:06:57 +0200
commit54fb54dd4b0e16438a5e415f988a979ab8659ee7 (patch)
tree2eb971fcf526b834afcb46232fe65e8742c9d5e0
parent920c1660395aa5cbaff9f0926622f40d32ec7952 (diff)
move del_search_space() from src/filegen.h to src/photorec.h
-rw-r--r--src/exfatp.c1
-rw-r--r--src/ext2p.c1
-rw-r--r--src/fatp.c1
-rw-r--r--src/filegen.c7
-rw-r--r--src/filegen.h12
-rw-r--r--src/ntfsp.c1
-rw-r--r--src/photorec.c5
-rw-r--r--src/photorec.h6
8 files changed, 21 insertions, 13 deletions
diff --git a/src/exfatp.c b/src/exfatp.c
index 00374ac..06c24ec 100644
--- a/src/exfatp.c
+++ b/src/exfatp.c
@@ -31,6 +31,7 @@
#include "common.h"
#include "list.h"
#include "filegen.h"
+#include "photorec.h"
#include "exfatp.h"
#include "exfat.h"
#include "log.h"
diff --git a/src/ext2p.c b/src/ext2p.c
index 84b2ca6..6cbb0f7 100644
--- a/src/ext2p.c
+++ b/src/ext2p.c
@@ -33,6 +33,7 @@
#include "common.h"
#include "list.h"
#include "filegen.h"
+#include "photorec.h"
#include "intrf.h"
#include "dir.h"
#ifdef HAVE_EXT2FS_EXT2_FS_H
diff --git a/src/fatp.c b/src/fatp.c
index af33ec3..81fd62f 100644
--- a/src/fatp.c
+++ b/src/fatp.c
@@ -31,6 +31,7 @@
#include "common.h"
#include "list.h"
#include "filegen.h"
+#include "photorec.h"
#include "fatp.h"
#include "fat.h"
#include "fat_common.h"
diff --git a/src/filegen.c b/src/filegen.c
index eb960cc..8e90985 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -237,7 +237,12 @@ void file_search_footer(file_recovery_t *file_recovery, const void*footer, const
}
#if 0
-void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length)
+/*@
+ @ requires \valid(file_recovery);
+ @ requires footer_length > 0;
+ @ requires \valid_read((char *)footer+(0..footer_length-1));
+ @*/
+static void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length)
{
const unsigned int read_size=4096;
unsigned char*buffer;
diff --git a/src/filegen.h b/src/filegen.h
index 2654443..75f66b8 100644
--- a/src/filegen.h
+++ b/src/filegen.h
@@ -140,18 +140,6 @@ uint64_t file_rsearch(FILE *handle, uint64_t offset, const void*footer, const un
void file_search_footer(file_recovery_t *file_recovery, const void*footer, const unsigned int footer_length, const unsigned int extra_length);
/*@
- @ requires \valid(file_recovery);
- @ requires footer_length > 0;
- @ requires \valid_read((char *)footer+(0..footer_length-1));
- @*/
-void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length);
-
-/*@
- @ requires \valid(list_search_space);
- @*/
-void del_search_space(alloc_data_t *list_search_space, const uint64_t start, const uint64_t end);
-
-/*@
@ requires buffer_size > 0;
@ requires \valid_read((char *)buffer+(0..buffer_size-1));
@ requires \valid(file_recovery);
diff --git a/src/ntfsp.c b/src/ntfsp.c
index 6da6822..b6a040a 100644
--- a/src/ntfsp.c
+++ b/src/ntfsp.c
@@ -37,6 +37,7 @@
#include "common.h"
#include "list.h"
#include "filegen.h"
+#include "photorec.h"
#ifdef HAVE_LIBNTFS
#include <ntfs/attrib.h>
#endif
diff --git a/src/photorec.c b/src/photorec.c
index f98ee43..c84d54c 100644
--- a/src/photorec.c
+++ b/src/photorec.c
@@ -85,6 +85,11 @@ void del_search_space(alloc_data_t *list_search_space, const uint64_t start, con
update_search_space_aux(list_search_space, start, end, NULL, NULL);
}
+/*@
+ @ requires \valid(list_search_space);
+ @ requires new_current_search_space == \null || \valid(*new_current_search_space);
+ @ requires offset == \null || \valid(*offset);
+ @*/
static void update_search_space_aux(alloc_data_t *list_search_space, const uint64_t start, const uint64_t end, alloc_data_t **new_current_search_space, uint64_t *offset)
{
struct td_list_head *search_walker = NULL;
diff --git a/src/photorec.h b/src/photorec.h
index 4aa30e0..ed1c08d 100644
--- a/src/photorec.h
+++ b/src/photorec.h
@@ -93,6 +93,12 @@ void file_block_log(const file_recovery_t *file_recovery, const unsigned int sec
void file_block_free(alloc_list_t *list_allocation);
void file_block_append(file_recovery_t *file_recovery, alloc_data_t *list_search_space, alloc_data_t **new_current_search_space, uint64_t *offset, const unsigned int blocksize, const unsigned int data);
void file_block_truncate_and_move(file_recovery_t *file_recovery, alloc_data_t *list_search_space, const unsigned int blocksize, alloc_data_t **new_current_search_space, uint64_t *offset, unsigned char *buffer);
+
+/*@
+ @ requires \valid(list_search_space);
+ @*/
+void del_search_space(alloc_data_t *list_search_space, const uint64_t start, const uint64_t end);
+
#ifdef __cplusplus
} /* closing brace for extern "C" */
#endif