diff options
-rw-r--r-- | src/adv.h | 8 | ||||
-rw-r--r-- | src/analyse.h | 7 | ||||
-rw-r--r-- | src/bfs.h | 7 | ||||
-rw-r--r-- | src/bsd.h | 7 | ||||
-rw-r--r-- | src/chgtype.h | 6 | ||||
-rw-r--r-- | src/common.h | 8 | ||||
-rw-r--r-- | src/cramfs.h | 7 | ||||
-rw-r--r-- | src/crc.h | 6 | ||||
-rw-r--r-- | src/dimage.h | 6 | ||||
-rw-r--r-- | src/dirpart.h | 6 | ||||
-rw-r--r-- | src/diskacc.h | 7 | ||||
-rw-r--r-- | src/diskcapa.h | 29 | ||||
-rw-r--r-- | src/edit.h | 7 | ||||
-rw-r--r-- | src/ewf.h | 7 | ||||
-rw-r--r-- | src/ext2.h | 8 | ||||
-rw-r--r-- | src/ext2_dir.h | 7 | ||||
-rw-r--r-- | src/ext2_sb.h | 8 | ||||
-rw-r--r-- | src/ext2grp.h | 8 | ||||
-rw-r--r-- | src/ext2p.h | 6 | ||||
-rw-r--r-- | src/fat.h | 10 | ||||
-rw-r--r-- | src/fat1x.h | 7 | ||||
-rw-r--r-- | src/fat32.h | 8 | ||||
-rw-r--r-- | src/fat_adv.h | 8 | ||||
-rw-r--r-- | src/fat_dir.h | 7 | ||||
-rw-r--r-- | src/fatp.h | 8 | ||||
-rw-r--r-- | src/fatx.h | 7 | ||||
-rw-r--r-- | src/file_tar.h | 6 | ||||
-rw-r--r-- | src/file_tiff.h | 7 | ||||
-rw-r--r-- | src/filegen.h | 11 | ||||
-rw-r--r-- | src/fnctdsk.h | 7 | ||||
-rw-r--r-- | src/godmode.h | 8 | ||||
-rw-r--r-- | src/hdaccess.h | 30 | ||||
-rw-r--r-- | src/hdcache.h | 7 | ||||
-rw-r--r-- | src/hdwin32.h | 8 | ||||
-rw-r--r-- | src/hfs.h | 7 | ||||
-rw-r--r-- | src/hpa_dco.h | 8 | ||||
-rw-r--r-- | src/io_redir.h | 6 | ||||
-rw-r--r-- | src/jfs.h | 7 | ||||
-rw-r--r-- | src/lang.h | 8 | ||||
-rw-r--r-- | src/list.h | 8 | ||||
-rw-r--r-- | src/luks.h | 8 | ||||
-rw-r--r-- | src/lvm.h | 6 | ||||
-rw-r--r-- | src/md.h | 8 | ||||
-rw-r--r-- | src/misc.h | 8 | ||||
-rw-r--r-- | src/msdos.h | 7 | ||||
-rw-r--r-- | src/netware.h | 7 | ||||
-rw-r--r-- | src/next.h | 7 | ||||
-rw-r--r-- | src/ntfs.h | 7 | ||||
-rw-r--r-- | src/ntfs_dir.h | 6 | ||||
-rw-r--r-- | src/ntfs_udl.h | 8 | ||||
-rw-r--r-- | src/ntfs_utl.h | 6 | ||||
-rw-r--r-- | src/ntfsp.h | 7 | ||||
-rw-r--r-- | src/partauto.h | 6 | ||||
-rw-r--r-- | src/partnone.h | 8 | ||||
-rw-r--r-- | src/pblocksize.h | 8 | ||||
-rw-r--r-- | src/pdisksel.h | 7 | ||||
-rw-r--r-- | src/phcfg.h | 8 | ||||
-rw-r--r-- | src/rfs.h | 7 | ||||
-rw-r--r-- | src/rfs_dir.h | 7 | ||||
-rw-r--r-- | src/savehdr.h | 7 | ||||
-rw-r--r-- | src/sessionp.h | 7 | ||||
-rw-r--r-- | src/sudo.h | 6 | ||||
-rw-r--r-- | src/sun.h | 6 | ||||
-rw-r--r-- | src/swap.h | 7 | ||||
-rw-r--r-- | src/sysv.h | 6 | ||||
-rw-r--r-- | src/tanalyse.h | 7 | ||||
-rw-r--r-- | src/tdelete.h | 8 | ||||
-rw-r--r-- | src/tdiskop.h | 7 | ||||
-rw-r--r-- | src/tdisksel.h | 6 | ||||
-rw-r--r-- | src/testdisk.h | 7 | ||||
-rw-r--r-- | src/thfs.h | 8 | ||||
-rw-r--r-- | src/tload.h | 8 | ||||
-rw-r--r-- | src/tlog.h | 8 | ||||
-rw-r--r-- | src/tmbrcode.h | 7 | ||||
-rw-r--r-- | src/tntfs.h | 8 | ||||
-rw-r--r-- | src/toptions.h | 8 | ||||
-rw-r--r-- | src/tpartwr.h | 8 | ||||
-rw-r--r-- | src/ufs.h | 6 | ||||
-rw-r--r-- | src/unicode.h | 7 | ||||
-rw-r--r-- | src/win32.h | 6 | ||||
-rw-r--r-- | src/xfs.h | 6 |
81 files changed, 622 insertions, 6 deletions
@@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 */ @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 |