diff options
author | Christophe Grenier <[email protected]> | 2019-10-13 11:06:57 +0200 |
---|---|---|
committer | Christophe Grenier <[email protected]> | 2019-10-13 11:06:57 +0200 |
commit | 54fb54dd4b0e16438a5e415f988a979ab8659ee7 (patch) | |
tree | 2eb971fcf526b834afcb46232fe65e8742c9d5e0 /src | |
parent | 920c1660395aa5cbaff9f0926622f40d32ec7952 (diff) |
move del_search_space() from src/filegen.h to src/photorec.h
Diffstat (limited to 'src')
-rw-r--r-- | src/exfatp.c | 1 | ||||
-rw-r--r-- | src/ext2p.c | 1 | ||||
-rw-r--r-- | src/fatp.c | 1 | ||||
-rw-r--r-- | src/filegen.c | 7 | ||||
-rw-r--r-- | src/filegen.h | 12 | ||||
-rw-r--r-- | src/ntfsp.c | 1 | ||||
-rw-r--r-- | src/photorec.c | 5 | ||||
-rw-r--r-- | src/photorec.h | 6 |
8 files changed, 21 insertions, 13 deletions
diff --git a/src/exfatp.c b/src/exfatp.c index 00374ac3..06c24ec2 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 84b2ca6f..6cbb0f7c 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 @@ -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 eb960cc5..8e909858 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 2654443b..75f66b8f 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 6da68227..b6a040ae 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 f98ee433..c84d54c9 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 4aa30e0f..ed1c08df 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 |