summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-10 16:04:39 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-10 16:04:39 +0100
commit86f46991fb400a57d6c84699818dfeccfa08cc2a (patch)
treeb4b66dfa6ce9ec06c4de918104054497ab38eae8
parent38ce28702691b4adc56898262a09cd1f0500a681 (diff)
Modify header files for C function declaration if C++ compilation
-rw-r--r--src/adv.h8
-rw-r--r--src/analyse.h7
-rw-r--r--src/bfs.h7
-rw-r--r--src/bsd.h7
-rw-r--r--src/chgtype.h6
-rw-r--r--src/common.h8
-rw-r--r--src/cramfs.h7
-rw-r--r--src/crc.h6
-rw-r--r--src/dimage.h6
-rw-r--r--src/dirpart.h6
-rw-r--r--src/diskacc.h7
-rw-r--r--src/diskcapa.h29
-rw-r--r--src/edit.h7
-rw-r--r--src/ewf.h7
-rw-r--r--src/ext2.h8
-rw-r--r--src/ext2_dir.h7
-rw-r--r--src/ext2_sb.h8
-rw-r--r--src/ext2grp.h8
-rw-r--r--src/ext2p.h6
-rw-r--r--src/fat.h10
-rw-r--r--src/fat1x.h7
-rw-r--r--src/fat32.h8
-rw-r--r--src/fat_adv.h8
-rw-r--r--src/fat_dir.h7
-rw-r--r--src/fatp.h8
-rw-r--r--src/fatx.h7
-rw-r--r--src/file_tar.h6
-rw-r--r--src/file_tiff.h7
-rw-r--r--src/filegen.h11
-rw-r--r--src/fnctdsk.h7
-rw-r--r--src/godmode.h8
-rw-r--r--src/hdaccess.h30
-rw-r--r--src/hdcache.h7
-rw-r--r--src/hdwin32.h8
-rw-r--r--src/hfs.h7
-rw-r--r--src/hpa_dco.h8
-rw-r--r--src/io_redir.h6
-rw-r--r--src/jfs.h7
-rw-r--r--src/lang.h8
-rw-r--r--src/list.h8
-rw-r--r--src/luks.h8
-rw-r--r--src/lvm.h6
-rw-r--r--src/md.h8
-rw-r--r--src/misc.h8
-rw-r--r--src/msdos.h7
-rw-r--r--src/netware.h7
-rw-r--r--src/next.h7
-rw-r--r--src/ntfs.h7
-rw-r--r--src/ntfs_dir.h6
-rw-r--r--src/ntfs_udl.h8
-rw-r--r--src/ntfs_utl.h6
-rw-r--r--src/ntfsp.h7
-rw-r--r--src/partauto.h6
-rw-r--r--src/partnone.h8
-rw-r--r--src/pblocksize.h8
-rw-r--r--src/pdisksel.h7
-rw-r--r--src/phcfg.h8
-rw-r--r--src/rfs.h7
-rw-r--r--src/rfs_dir.h7
-rw-r--r--src/savehdr.h7
-rw-r--r--src/sessionp.h7
-rw-r--r--src/sudo.h6
-rw-r--r--src/sun.h6
-rw-r--r--src/swap.h7
-rw-r--r--src/sysv.h6
-rw-r--r--src/tanalyse.h7
-rw-r--r--src/tdelete.h8
-rw-r--r--src/tdiskop.h7
-rw-r--r--src/tdisksel.h6
-rw-r--r--src/testdisk.h7
-rw-r--r--src/thfs.h8
-rw-r--r--src/tload.h8
-rw-r--r--src/tlog.h8
-rw-r--r--src/tmbrcode.h7
-rw-r--r--src/tntfs.h8
-rw-r--r--src/toptions.h8
-rw-r--r--src/tpartwr.h8
-rw-r--r--src/ufs.h6
-rw-r--r--src/unicode.h7
-rw-r--r--src/win32.h6
-rw-r--r--src/xfs.h6
81 files changed, 622 insertions, 6 deletions
diff --git a/src/adv.h b/src/adv.h
index 120c3c7..339ecf5 100644
--- a/src/adv.h
+++ b/src/adv.h
@@ -19,5 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const unsigned int expert, char**current_cmd);
int is_part_linux(const partition_t *partition);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/analyse.h b/src/analyse.h
index 3ed5e6e..94f553a 100644
--- a/src/analyse.h
+++ b/src/analyse.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int search_type_0(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
int search_type_1(unsigned char *buffer, disk_t *disk_car,partition_t *partition,const int verbose, const int dump_ind);
@@ -31,3 +34,7 @@ int search_FAT_backup(unsigned char *buffer, disk_t *disk_car,partition_t *parti
int search_HFS_backup(unsigned char *buffer, disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind);
int search_NTFS_backup(unsigned char *buffer, disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind);
list_part_t *search_superblock(disk_t *disk_car, const partition_t *partition, const int verbose, const int dump_ind, const int interface);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/bfs.h b/src/bfs.h
index 8eb2f3f..7ce5d4c 100644
--- a/src/bfs.h
+++ b/src/bfs.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
/* real size is 164 */
#define BFS_SUPERBLOCK_SIZE 512
@@ -81,3 +84,7 @@ typedef struct disk_super_block /* super block as it is on disk */
/* int test_beos(struct disk_super_block *,partition_t); */
int check_BeFS(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_BeFS(disk_t *disk_car, const struct disk_super_block *beos_block,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/bsd.h b/src/bsd.h
index 1c14459..5739b12 100644
--- a/src/bsd.h
+++ b/src/bsd.h
@@ -23,6 +23,9 @@
#ifndef _BSD_H
#define _BSD_H
+#ifdef __cplusplus
+extern "C" {
+#endif
/* BSD_DISKLABEL_SIZE is 276 */
#define BSD_DISKLABEL_SIZE 512
#define STANDALONE
@@ -167,5 +170,7 @@ struct disklabel {
#define TST_FS_JFS2 21 /* IBM JFS2 */
int check_BSD(disk_t *disk_car,partition_t *partition,const int verbose,const unsigned int max_partitions);
int recover_BSD(disk_t *disk_car, const struct disklabel*bsd_header,partition_t *partition,const int verbose, const int dump_ind);
-
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/chgtype.h b/src/chgtype.h
index 85cf2bd..20f138f 100644
--- a/src/chgtype.h
+++ b/src/chgtype.h
@@ -19,7 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
void change_geometry(disk_t *disk_car, char **current_cmd);
void change_part_type(const disk_t *disk_car,partition_t *partition, char **current_cmd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/common.h b/src/common.h
index a8f91a1..959f0b3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -21,6 +21,10 @@
*/
#ifndef _COMMON_H
#define _COMMON_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct efi_guid_s efi_guid_t;
struct efi_guid_s
{
@@ -442,4 +446,8 @@ int strncasecmp(const char * s1, const char * s2, size_t len);
typeof(y) _y = (y); \
(void) (&_x == &_y); \
_x > _y ? _x : _y; })
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/cramfs.h b/src/cramfs.h
index 39a5326..c525234 100644
--- a/src/cramfs.h
+++ b/src/cramfs.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
/* real size is 76 */
#define CRAMFS_SUPERBLOCK_SIZE 512
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
@@ -81,3 +84,7 @@ struct cramfs_super {
int check_cramfs(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_cramfs(disk_t *disk_car, const struct cramfs_super *sb,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/crc.h b/src/crc.h
index 700f896..1c9646b 100644
--- a/src/crc.h
+++ b/src/crc.h
@@ -20,6 +20,9 @@
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -33,3 +36,6 @@ unsigned int get_crc32_gen(const unsigned char *s, const unsigned int len, const
#endif
unsigned int get_crc32(const void *s, const unsigned int len, const uint32_t seed);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/dimage.h b/src/dimage.h
index bac6056..52c48c1 100644
--- a/src/dimage.h
+++ b/src/dimage.h
@@ -19,4 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int disk_image(disk_t *disk_car, const partition_t *partition, const char *image_dd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/dirpart.h b/src/dirpart.h
index 0a77ce1..38445c6 100644
--- a/src/dirpart.h
+++ b/src/dirpart.h
@@ -19,5 +19,11 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int dir_partition(disk_t *disk_car, const partition_t *partition, const int verbose, char **current_cmd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/diskacc.h b/src/diskacc.h
index 94bd5ff..9f2ac3d 100644
--- a/src/diskacc.h
+++ b/src/diskacc.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int interface_check_disk_access(disk_t *disk_car, char **current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/diskcapa.h b/src/diskcapa.h
index 2c51749..b140991 100644
--- a/src/diskcapa.h
+++ b/src/diskcapa.h
@@ -1 +1,30 @@
+/*
+
+ File: diskcapa.h
+
+ Copyright (C) 2008-2009 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int interface_check_disk_capacity(disk_t *disk_car);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/edit.h b/src/edit.h
index dd5fb91..d7326b7 100644
--- a/src/edit.h
+++ b/src/edit.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void interface_editor(disk_t *disk_car);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ewf.h b/src/ewf.h
index d6ffb3e..3398071 100644
--- a/src/ewf.h
+++ b/src/ewf.h
@@ -19,8 +19,15 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(HAVE_LIBEWF_H) && defined(HAVE_LIBEWF)
disk_t *fewf_init(const char *device, const int verbose, const arch_fnct_t *arch, const int testdisk_mode);
#endif
const char*td_ewf_version(void);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ext2.h b/src/ext2.h
index d5db2e8..efabe22 100644
--- a/src/ext2.h
+++ b/src/ext2.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define EXT2_SUPERBLOCK_SIZE 1024
#define EXT2_SB(sb) (sb)
@@ -149,3 +153,7 @@ struct ext2_super_block {
};
int check_EXT2(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_EXT2(disk_t *disk_car, const struct ext2_super_block *sb,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ext2_dir.h b/src/ext2_dir.h
index bfe8c2c..33258c8 100644
--- a/src/ext2_dir.h
+++ b/src/ext2_dir.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int dir_partition_ext2_init(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const int verbose);
const char*td_ext2fs_version(void);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ext2_sb.h b/src/ext2_sb.h
index 0c84a67..fae7c31 100644
--- a/src/ext2_sb.h
+++ b/src/ext2_sb.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int interface_superblock(disk_t *disk_car,list_part_t *list_part,char**current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ext2grp.h b/src/ext2grp.h
index 803a08f..ad854fe 100644
--- a/src/ext2grp.h
+++ b/src/ext2grp.h
@@ -19,5 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int ext2_fix_group(alloc_data_t *list_search_space, disk_t *disk, partition_t *partition);
unsigned int ext2_fix_inode(alloc_data_t *list_search_space, disk_t *disk, partition_t *partition);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ext2p.h b/src/ext2p.h
index 7d5d5f1..ee3c3bf 100644
--- a/src/ext2p.h
+++ b/src/ext2p.h
@@ -19,6 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef HAVE_LIBEXT2FS
unsigned int ext2_remove_used_space(disk_t *disk, const partition_t *partition, alloc_data_t *list_search_space);
#endif
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fat.h b/src/fat.h
index a211b26..5517cc0 100644
--- a/src/fat.h
+++ b/src/fat.h
@@ -22,6 +22,10 @@
#ifndef _FAT_H
#define _FAT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define FAT1X_PART_NAME 0x2B
#define FAT32_PART_NAME 0x47
#define FAT_NAME1 0x36
@@ -144,7 +148,6 @@ int fat32_free_info(disk_t *disk_car,const partition_t *partition, const unsigne
#define FAT16_EOC 0xFFF8
#define FAT32_BAD 0x0FFFFFF7
#define FAT32_EOC 0x0FFFFFF8
-#endif
#define FAT1x_BOOT_SECTOR_SIZE 0x200
int recover_FAT(disk_t *disk_car,const struct fat_boot_sector*fat_header, partition_t *partition, const int verbose, const int dump_ind, const int backup);
@@ -155,3 +158,8 @@ int check_HPFS(disk_t *disk_car,partition_t *partition, const int verbose);
int recover_OS2MB(disk_t *disk_car, const struct fat_boot_sector*fat_header, partition_t *partition, const int verbose, const int dump_ind);
int check_OS2MB(disk_t *disk_car,partition_t *partition, const int verbose);
int check_VFAT_volume_name(const char *name, const unsigned int max_size);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
+#endif
diff --git a/src/fat1x.h b/src/fat1x.h
index 998d20c..5b91900 100644
--- a/src/fat1x.h
+++ b/src/fat1x.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int fat1x_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind, const unsigned int expert, char **current_cmd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fat32.h b/src/fat32.h
index a004354..d75b917 100644
--- a/src/fat32.h
+++ b/src/fat32.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int fat32_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind, const unsigned int expert, char **current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fat_adv.h b/src/fat_adv.h
index d18379a..dd9c31a 100644
--- a/src/fat_adv.h
+++ b/src/fat_adv.h
@@ -21,7 +21,15 @@
*/
#ifndef _FAT_ADV_H
#define _FAT_ADV_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int rebuild_FAT_BS(disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind,const int interface, const unsigned int expert, char**current_cmd);
int FAT_init_rootdir(disk_t *disk_car, partition_t *partition, const int verbose);
int repair_FAT_table(disk_t *disk_car, partition_t *partition, const int verbose);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/fat_dir.h b/src/fat_dir.h
index 695a066..3c80083 100644
--- a/src/fat_dir.h
+++ b/src/fat_dir.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
file_data_t *dir_fat_aux(const unsigned char*buffer, const unsigned int size, const unsigned int cluster_size, const unsigned int param);
int dir_partition_fat_init(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const int verbose);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fatp.h b/src/fatp.h
index 06e6eac..de68f17 100644
--- a/src/fatp.h
+++ b/src/fatp.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int fat_remove_used_space(disk_t *disk_car,const partition_t *partition, alloc_data_t *list_search_space);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fatx.h b/src/fatx.h
index e4b1a5b..9287b44 100644
--- a/src/fatx.h
+++ b/src/fatx.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
struct disk_fatx
{
@@ -31,3 +34,7 @@ struct disk_fatx
int check_FATX(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_FATX(disk_t *disk_car, const struct disk_fatx *fatx_block, partition_t *partition, const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/file_tar.h b/src/file_tar.h
index 6938e54..fd078a2 100644
--- a/src/file_tar.h
+++ b/src/file_tar.h
@@ -19,6 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int header_check_tar(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);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/file_tiff.h b/src/file_tiff.h
index 0d08970..e09b76e 100644
--- a/src/file_tiff.h
+++ b/src/file_tiff.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define TIFF_BIGENDIAN 0x4d4d
#define TIFF_LITTLEENDIAN 0x4949
#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */
@@ -54,3 +58,6 @@ struct ifd_header {
time_t get_date_from_tiff_header(const TIFFHeader *tiff, const unsigned int tiff_size);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/filegen.h b/src/filegen.h
index b3aa74b..4764886 100644
--- a/src/filegen.h
+++ b/src/filegen.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "list.h"
#if defined(DJGPP)
@@ -108,10 +112,11 @@ typedef struct
file_check_t file_checks[256];
} file_check_list_t;
-void free_header_check(void);
#define NL_BARENL (1 << 0)
#define NL_CRLF (1 << 1)
#define NL_BARECR (1 << 2)
+
+void free_header_check(void);
void file_allow_nl(file_recovery_t *file_recovery, const unsigned int nl_mode);
void file_search_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length);
void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length);
@@ -125,4 +130,6 @@ void register_header_check(const unsigned int offset, const unsigned char *value
file_stat_t *file_stat);
void index_header_check(void);
-
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/fnctdsk.h b/src/fnctdsk.h
index 9c4ab84..935c46f 100644
--- a/src/fnctdsk.h
+++ b/src/fnctdsk.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned long int C_H_S2LBA(const disk_t *disk_car,const unsigned int C, const unsigned int H, const unsigned int S);
uint64_t CHS2offset(const disk_t *disk_car,const CHS_t*CHS);
unsigned int offset2sector(const disk_t *disk_car, const uint64_t offset);
@@ -41,3 +45,6 @@ int delete_list_disk(list_disk_t *list_disk);
const char *size_to_unit(uint64_t disk_size, char *buffer);
int is_part_overlapping(const list_part_t *list_part);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/godmode.h b/src/godmode.h
index f72ea73..1733121 100644
--- a/src/godmode.h
+++ b/src/godmode.h
@@ -19,7 +19,15 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum part_offset { PART_OFFSET128, PART_OFFSET2, PART_OFFSET1, PART_OFFSET0, PART_QUIT};
typedef enum part_offset part_offset_t;
int interface_recovery(disk_t *disk_car, const list_part_t * list_part_org, const int verbose, const int dump_ind, int align, const int ask_part_order, const unsigned int expert, const int search_vista_part, char **current_cmd);
void only_one_bootable( list_part_t *list_part, list_part_t *part_boot);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/hdaccess.h b/src/hdaccess.h
index 9a06ffe..2f0a129 100644
--- a/src/hdaccess.h
+++ b/src/hdaccess.h
@@ -1,3 +1,29 @@
+/*
+
+ File: hdaccess.h
+
+ Copyright (C) 1998-2009 Christophe GRENIER <grenier@cgsecurity.org>
+
+ This software is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write the Free Software Foundation, Inc., 51
+ Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
void hd_update_geometry(disk_t *disk_car, const int allow_partial_last_cylinder, const int verbose);
void hd_update_all_geometry(const list_disk_t * list_disk, const int allow_partial_last_cylinder, const int verbose);
list_disk_t *hd_parse(list_disk_t *list_disk, const int verbose, const arch_fnct_t *arch, const int testdisk_mode);
@@ -6,3 +32,7 @@ void autoset_unit(disk_t *disk_car);
void update_disk_car_fields(disk_t *disk_car);
int generic_clean(disk_t *disk_car);
void init_disk(disk_t *disk);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/hdcache.h b/src/hdcache.h
index 5dc4c79..4bc76dc 100644
--- a/src/hdcache.h
+++ b/src/hdcache.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
disk_t *new_diskcache(disk_t *disk_car, const unsigned int cache_size_min);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/hdwin32.h b/src/hdwin32.h
index f4c066e..f78d55d 100644
--- a/src/hdwin32.h
+++ b/src/hdwin32.h
@@ -21,7 +21,15 @@
*/
#ifndef _HDWIN32_H
#define _HDWIN32_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(__CYGWIN__) || defined(__MINGW32__)
void file_win32_disk_get_model(HANDLE handle, disk_t *dev, const int verbose);
#endif
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/hfs.h b/src/hfs.h
index c5d68dd..d542b55 100644
--- a/src/hfs.h
+++ b/src/hfs.h
@@ -20,6 +20,10 @@
*/
#ifndef _HFS_H
#define _HFS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* HFS superblock size is 162 */
#define HFS_SUPERBLOCK_SIZE 512
#define HFS_SUPER_MAGIC 0x4244 /* "BD": HFS MDB (super block) */
@@ -75,4 +79,7 @@ int check_HFS(disk_t *disk_car,partition_t *partition,const int verbose);
int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind);
int recover_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,const int verbose, const int dump_ind, const int backup);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif /* _HFS_H */
diff --git a/src/hpa_dco.h b/src/hpa_dco.h
index 407c75a..47f91ca 100644
--- a/src/hpa_dco.h
+++ b/src/hpa_dco.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void disk_get_hpa_dco(const int hd_h, disk_t *disk_car, const int verbose);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/io_redir.h b/src/io_redir.h
index 99f16d1..2d93bd3 100644
--- a/src/io_redir.h
+++ b/src/io_redir.h
@@ -19,6 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int io_redir_add_redir(disk_t *disk_car, const uint64_t org_offset, const unsigned int size, const uint64_t new_offset, const void *mem);
int io_redir_del_redir(disk_t *disk_car, uint64_t org_offset);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/jfs.h b/src/jfs.h
index 1d434fd..ddee86f 100644
--- a/src/jfs.h
+++ b/src/jfs.h
@@ -19,9 +19,16 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
/* real size is 184 */
#define JFS_SUPERBLOCK_SIZE 512
#define L2BPERDMAP 13 /* l2 num of blks per dmap */
int check_JFS(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_JFS(disk_t *disk_car, const struct jfs_superblock *sb,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/lang.h b/src/lang.h
index 9409641..ef53acf 100644
--- a/src/lang.h
+++ b/src/lang.h
@@ -65,5 +65,13 @@
#define msg_MBR_ORDER_BAD "Partitions order: Bad"
#define msg_NO_EXT_PART "No extended partition\n"
#define msg_ROOT_CLUSTER_RERR "\nroot_cluster: read error"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const unsigned char *partition_type(const unsigned char type, const struct systypes *parttype_name_table);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/list.h b/src/list.h
index a7747d6..c0ca51f 100644
--- a/src/list.h
+++ b/src/list.h
@@ -370,5 +370,13 @@ struct alloc_list_s
unsigned int data;
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void list_truncate(alloc_list_t *list, const uint64_t file_size);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/luks.h b/src/luks.h
index b6ba68a..fa23cb5 100644
--- a/src/luks.h
+++ b/src/luks.h
@@ -20,6 +20,10 @@
LUKS on-disk-format: http://luks.endorphin.org/spec
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define LUKS_CIPHERNAME_L 32
#define LUKS_CIPHERMODE_L 32
#define LUKS_HASHSPEC_L 32
@@ -54,3 +58,7 @@ struct luks_phdr {
int check_LUKS(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_LUKS(disk_t *disk_car, const struct luks_phdr *sb,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/lvm.h b/src/lvm.h
index 0daee80..65a92b5 100644
--- a/src/lvm.h
+++ b/src/lvm.h
@@ -21,6 +21,9 @@
#ifndef _LVM_H
#define _LVM_H
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* structs & defines gathered from LVM 0.7/0.9 lvm.h and liblvm.h
@@ -118,4 +121,7 @@ struct lvm2_pv_header {
int check_LVM2(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_LVM2(disk_t *disk_car, const unsigned char *buf,partition_t *partition,const int verbose, const int dump_ind);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif /* _LVM_H */
diff --git a/src/md.h b/src/md.h
index 92d19c0..4c24531 100644
--- a/src/md.h
+++ b/src/md.h
@@ -26,6 +26,9 @@
#ifndef _MD_P_H
#define _MD_P_H
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* RAID superblock.
@@ -251,5 +254,8 @@ static inline uint64_t md_event(mdp_super_t *sb) {
int check_MD(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_MD(disk_t *disk_car, const struct mdp_superblock_s *sb, partition_t *partition, const int verbose, const int dump_ind);
int recover_MD_from_partition(disk_t *disk_car, partition_t *partition, const int verbose);
-#endif
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
+#endif
diff --git a/src/misc.h b/src/misc.h
index 42f027f..dd71194 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -19,5 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
const char *get_os(void);
const char *get_compiler(void);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/msdos.h b/src/msdos.h
index f86df72..ba9ceb9 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct info_disk_struct
{
unsigned int disk;
@@ -30,3 +34,6 @@ struct info_disk_struct
disk_t *hd_identify(const int verbose, const unsigned int disk, const arch_fnct_t *arch, const int testdisk_mode);
const char *disk_description(disk_t *disk_car);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/netware.h b/src/netware.h
index 25df754..6dd5e6c 100644
--- a/src/netware.h
+++ b/src/netware.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct disk_netware
{
@@ -31,3 +34,7 @@ typedef struct disk_netware
int check_netware(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_netware(disk_t *disk_car, const struct disk_netware *netware_block, partition_t *partition);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/next.h b/src/next.h
index cae7baf..a31d0be 100644
--- a/src/next.h
+++ b/src/next.h
@@ -1,3 +1,10 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void search_location_init(const disk_t *disk_car, const unsigned int location_boundary, const int fast_mode, const int search_vista_part);
uint64_t search_location_update(const uint64_t location);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ntfs.h b/src/ntfs.h
index 1fcaa0e..8916595 100644
--- a/src/ntfs.h
+++ b/src/ntfs.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#define NTFS_BOOT_SECTOR_SIZE 0x200
@@ -68,3 +71,7 @@ unsigned int ntfs_sector_size(const struct ntfs_boot_sector *ntfs_header);
int rebuild_NTFS_BS(disk_t *disk_car,partition_t *partition, const int verbose, const int dump_ind,const int interface, const unsigned int expert, char**current_cmd);
int repair_MFT(disk_t *disk_car, partition_t *partition, const int verbose, const unsigned int expert, char **current_cmd);
int repair_MFT_Vol(disk_t *disk_car, partition_t *partition, const int verbose);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ntfs_dir.h b/src/ntfs_dir.h
index 6decbfb..4722724 100644
--- a/src/ntfs_dir.h
+++ b/src/ntfs_dir.h
@@ -19,7 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int dir_partition_ntfs_init(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const int verbose);
const char*td_ntfs_version(void);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ntfs_udl.h b/src/ntfs_udl.h
index a07ae22..c3df939 100644
--- a/src/ntfs_udl.h
+++ b/src/ntfs_udl.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int ntfs_undelete_part(disk_t *disk_car, const partition_t *partition, const int verbose, char **current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ntfs_utl.h b/src/ntfs_utl.h
index 01ea013..e02a00a 100644
--- a/src/ntfs_utl.h
+++ b/src/ntfs_utl.h
@@ -20,7 +20,13 @@
*/
#ifdef HAVE_LIBNTFS
+#ifdef __cplusplus
+extern "C" {
+#endif
ATTR_RECORD * find_attribute(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx);
ATTR_RECORD * find_first_attribute(const ATTR_TYPES type, MFT_RECORD *mft);
int utils_cluster_in_use(ntfs_volume *vol, long long lcn);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/ntfsp.h b/src/ntfsp.h
index 9425306..35f10fc 100644
--- a/src/ntfsp.h
+++ b/src/ntfsp.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int ntfs_remove_used_space(disk_t *disk_car,const partition_t *partition, alloc_data_t *list_search_space);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/partauto.h b/src/partauto.h
index be681aa..e5b317a 100644
--- a/src/partauto.h
+++ b/src/partauto.h
@@ -19,6 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
void autodetect_arch(disk_t *disk);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/partnone.h b/src/partnone.h
index 6ed9815..98bb303 100644
--- a/src/partnone.h
+++ b/src/partnone.h
@@ -1,2 +1,10 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int get_part_type_none(const partition_t *partition);
const char *get_partition_typename_none(const partition_t *partition);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/pblocksize.h b/src/pblocksize.h
index 711496e..a49a261 100644
--- a/src/pblocksize.h
+++ b/src/pblocksize.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int menu_choose_blocksize(unsigned int blocksize, const unsigned int sector_size, uint64_t *offset);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/pdisksel.h b/src/pdisksel.h
index f78d49f..5f8a259 100644
--- a/src/pdisksel.h
+++ b/src/pdisksel.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int do_curses_photorec(int verbose, const char *recup_dir, const list_disk_t *list_disk, file_enable_t *file_enable, char *cmd_device, char**cmd_run);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/phcfg.h b/src/phcfg.h
index 5417402..b194e10 100644
--- a/src/phcfg.h
+++ b/src/phcfg.h
@@ -1,3 +1,11 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void reset_list_file_enable(file_enable_t *files_enable);
int file_options_save(const file_enable_t *files_enable);
int file_options_load(file_enable_t *files_enable);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/rfs.h b/src/rfs.h
index 09486ac..175419c 100644
--- a/src/rfs.h
+++ b/src/rfs.h
@@ -20,7 +20,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
+#ifdef __cplusplus
+extern "C" {
+#endif
#define REISERFS_SUPER_MAGIC "ReIsErFs"
#define REISERFS2_SUPER_MAGIC "ReIsEr2Fs"
@@ -107,3 +109,6 @@ struct format40_super {
int check_rfs(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_rfs(disk_t *disk_car, const struct reiserfs_super_block *sb,partition_t *partition,const int verbose, const int dump_ind);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/rfs_dir.h b/src/rfs_dir.h
index 2f1d45f..37455d4 100644
--- a/src/rfs_dir.h
+++ b/src/rfs_dir.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int dir_partition_reiser_init(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const int verbose);
const char*td_reiserfs_version(void);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/savehdr.h b/src/savehdr.h
index c69ebd3..2210a5b 100644
--- a/src/savehdr.h
+++ b/src/savehdr.h
@@ -19,6 +19,10 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "list.h"
typedef struct backup_disk backup_disk_t;
struct backup_disk
@@ -33,3 +37,6 @@ int save_header(disk_t *disk_car,partition_t *partition, const int verbose);
int partition_save(disk_t *disk_car, list_part_t *list_part, const int verbose);
backup_disk_t *partition_load(const disk_t *disk_car, const int verbose);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/sessionp.h b/src/sessionp.h
index 319db10..32b1c96 100644
--- a/src/sessionp.h
+++ b/src/sessionp.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int session_load(char **cmd_device, char **current_cmd, alloc_data_t *list_free_space);
int session_save(alloc_data_t *list_free_space, disk_t *disk_car, const partition_t *partition, const file_enable_t *files_enable, const unsigned int blocksize, const unsigned int paranoid, const unsigned int keep_corrupted_file, const unsigned int mode_ext2, const unsigned int expert, const unsigned int lowmem, const unsigned int carve_free_space_only, const int verbose);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/sudo.h b/src/sudo.h
index 58085fe..fce6f3c 100644
--- a/src/sudo.h
+++ b/src/sudo.h
@@ -20,5 +20,11 @@
*/
#ifdef SUDO_BIN
+#ifdef __cplusplus
+extern "C" {
+#endif
void run_sudo(int argc, char **argv);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/sun.h b/src/sun.h
index d3a5af6..11a2255 100644
--- a/src/sun.h
+++ b/src/sun.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct {
unsigned char info[128]; /* Informative text string */
@@ -77,3 +80,6 @@ typedef struct struct_sun_partition_i386 sun_partition_i386;
int recover_sun_i386(disk_t *disk_car, const sun_partition_i386 *sunlabel, partition_t *partition,const int verbose, const int dump_ind);
int check_sun_i386(disk_t *disk_car,partition_t *partition,const int verbose);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/swap.h b/src/swap.h
index efb5a90..c802eda 100644
--- a/src/swap.h
+++ b/src/swap.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#define PAGE_SIZE 0x1000 /* PAGE de 4K pour P_LINSWAP */
#define SWAP_SIZE PAGE_SIZE
@@ -43,3 +46,7 @@ union swap_header {
int check_Linux_SWAP(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_Linux_SWAP(disk_t *disk_car, const union swap_header *swap_header,partition_t *partition,const int verbose, const int dump_ind);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/sysv.h b/src/sysv.h
index 69590b4..ac2690f 100644
--- a/src/sysv.h
+++ b/src/sysv.h
@@ -19,6 +19,9 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#define SYSV4_SUPERBLOCK_SIZE 512
@@ -200,3 +203,6 @@ struct coh_super_block {
int check_sysv(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_sysv(disk_t *disk_car, const struct sysv4_super_block *sbd, partition_t *partition,const int verbose, const int dump_ind);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tanalyse.h b/src/tanalyse.h
index 128c2fb..583376c 100644
--- a/src/tanalyse.h
+++ b/src/tanalyse.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
list_part_t *interface_analyse(disk_t *disk_car, const int verbose, const int saveheader, char**current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tdelete.h b/src/tdelete.h
index 98f8e1b..2c6f3ef 100644
--- a/src/tdelete.h
+++ b/src/tdelete.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int write_clean_table(disk_t *disk_car);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tdiskop.h b/src/tdiskop.h
index 2d005a5..a627690 100644
--- a/src/tdiskop.h
+++ b/src/tdiskop.h
@@ -19,5 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int menu_disk(disk_t *disk_car, const int verbose,int dump_ind, const int saveheader, char **current_cmd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tdisksel.h b/src/tdisksel.h
index aae6f6f..15205ad 100644
--- a/src/tdisksel.h
+++ b/src/tdisksel.h
@@ -19,6 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int do_curses_testdisk(int verbose, int dump_ind, const list_disk_t *list_disk, const int saveheader, const char *cmd_device, char **current_cmd);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/testdisk.h b/src/testdisk.h
index c92b6f2..c710acf 100644
--- a/src/testdisk.h
+++ b/src/testdisk.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int test_MBR(disk_t *disk_car,int verbose);
int analyse_file(char *);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/thfs.h b/src/thfs.h
index 18d42f1..693bfa0 100644
--- a/src/thfs.h
+++ b/src/thfs.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int HFS_HFSP_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind, const unsigned int expert, char **current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tload.h b/src/tload.h
index 4d2d796..e6a8757 100644
--- a/src/tload.h
+++ b/src/tload.h
@@ -20,5 +20,13 @@
*/
#ifdef HAVE_NCURSES
+#ifdef __cplusplus
+extern "C" {
+#endif
+
list_part_t *interface_load(disk_t *disk_car,list_part_t *list_part, const int verbose);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/tlog.h b/src/tlog.h
index 3b01904..6a6849b 100644
--- a/src/tlog.h
+++ b/src/tlog.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int ask_testdisk_log_creation(void);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tmbrcode.h b/src/tmbrcode.h
index 21af6ba..bed35ae 100644
--- a/src/tmbrcode.h
+++ b/src/tmbrcode.h
@@ -1,2 +1,9 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int write_MBR_code(disk_t *disk_car);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tntfs.h b/src/tntfs.h
index 1151bab..f03d2d4 100644
--- a/src/tntfs.h
+++ b/src/tntfs.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose, const int dump_ind, const unsigned int expert, char **current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/toptions.h b/src/toptions.h
index 96dd2aa..b043b44 100644
--- a/src/toptions.h
+++ b/src/toptions.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void interface_options(int *dump_ind, int *align, int *allow_partial_last_cylinder, unsigned int *expert, char**current_cmd);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/tpartwr.h b/src/tpartwr.h
index 459b25f..4d92d12 100644
--- a/src/tpartwr.h
+++ b/src/tpartwr.h
@@ -19,4 +19,12 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int interface_write(disk_t *disk_car,list_part_t *list_part,const int can_search_deeper, const int can_ask_minmax_ext, int *no_confirm, char **current_cmd, unsigned int *menu);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/ufs.h b/src/ufs.h
index 2e4453f..284b820 100644
--- a/src/ufs.h
+++ b/src/ufs.h
@@ -21,6 +21,9 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
/* ufs superblock size is 1377 but there is room for 8192 */
#define UFS_SUPERBLOCK_SIZE 2048
@@ -468,3 +471,6 @@ struct ufs_super_block {
int check_ufs(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_ufs(disk_t *disk_car, const struct ufs_super_block *sb, partition_t *partition,const int verbose, const int dump_ind);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/unicode.h b/src/unicode.h
index 42c212f..863f8d1 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -19,6 +19,13 @@
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
int UCSle2str(char *to, const uint16_t *from, const unsigned int len);
int str2UCSle(uint16_t *to, const char *from, const unsigned int len);
+
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
diff --git a/src/win32.h b/src/win32.h
index 09e4922..eca36f4 100644
--- a/src/win32.h
+++ b/src/win32.h
@@ -21,10 +21,16 @@
*/
#ifndef _WIN32_H
#define _WIN32_H
+#ifdef __cplusplus
+extern "C" {
+#endif
#if defined(__CYGWIN__) || defined(__MINGW32__)
disk_t *file_test_availability_win32(const char *device, const int verbose, const arch_fnct_t *arch, const int testdisk_mode);
unsigned int disk_get_sector_size_win32(HANDLE handle, const char *device, const int verbose);
uint64_t disk_get_size_win32(HANDLE handle, const char *device, const int verbose);
void disk_get_geometry_win32(CHSgeometry_t *geom, HANDLE handle, const char *device, const int verbose);
#endif
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif
#endif
diff --git a/src/xfs.h b/src/xfs.h
index 7277d97..ed9094f 100644
--- a/src/xfs.h
+++ b/src/xfs.h
@@ -27,6 +27,9 @@
* Fits into a sector-sized buffer at address 0 of each allocation group.
* Only the first of these is ever updated except during growfs.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
#define XFS_SUPERBLOCK_SIZE 512
@@ -106,3 +109,6 @@ struct xfs_sb
int check_xfs(disk_t *disk_car,partition_t *partition,const int verbose);
int recover_xfs(disk_t *disk_car, const struct xfs_sb *sb,partition_t *partition,const int verbose, const int dump_ind);
+#ifdef __cplusplus
+} /* closing brace for extern "C" */
+#endif