Add #ifdef __cplusplus to all header files
authorgkostka <kostka.grzegorz@gmail.com>
Thu, 19 Nov 2015 22:27:44 +0000 (23:27 +0100)
committergkostka <kostka.grzegorz@gmail.com>
Thu, 19 Nov 2015 22:27:44 +0000 (23:27 +0100)
22 files changed:
lwext4/ext4.h
lwext4/ext4_balloc.h
lwext4/ext4_bcache.h
lwext4/ext4_bitmap.h
lwext4/ext4_block_group.h
lwext4/ext4_blockdev.h
lwext4/ext4_config.h
lwext4/ext4_crc32c.h
lwext4/ext4_debug.h
lwext4/ext4_dir.h
lwext4/ext4_dir_idx.h
lwext4/ext4_errno.h
lwext4/ext4_extent.h
lwext4/ext4_fs.h
lwext4/ext4_hash.h
lwext4/ext4_ialloc.h
lwext4/ext4_inode.h
lwext4/ext4_mkfs.h
lwext4/ext4_super.h
lwext4/ext4_types.h
lwext4/ext4_xattr.h
lwext4/tree.h

index 5ac3eb1c2805d64f010da968a21716a5328504ee..40f0f30e8f5e9b7823f541eabea6a8248958b45e 100644 (file)
 #ifndef EXT4_H_
 #define EXT4_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <stddef.h>
 
@@ -404,6 +408,10 @@ const ext4_direntry *ext4_dir_entry_next(ext4_dir *d);
  * @param   d directory handle*/
 void ext4_dir_entry_rewind(ext4_dir *d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_H_ */
 
 /**
index 48542dafb77b0d1549fe56b176bee62640217766..c25b2598346fdb37b818a700ab943eace084bc98 100644 (file)
 #ifndef EXT4_BALLOC_H_
 #define EXT4_BALLOC_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -103,6 +107,10 @@ int ext4_balloc_alloc_block(struct ext4_inode_ref *inode_ref,
 int ext4_balloc_try_alloc_block(struct ext4_inode_ref *inode_ref,
                                ext4_fsblk_t baddr, bool *free);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_BALLOC_H_ */
 
 /**
index 679cd69fb8f705ba9f0950d8833270cf5a41a797..3fc722a1bccb76c6f2610df83c2d58d0f46ce5ca 100644 (file)
 #ifndef EXT4_BCACHE_H_
 #define EXT4_BCACHE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #include <stdint.h>
@@ -160,6 +164,10 @@ int ext4_bcache_free(struct ext4_bcache *bc, struct ext4_block *b,
  * @return  full status*/
 bool ext4_bcache_is_full(struct ext4_bcache *bc);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_BCACHE_H_ */
 
 /**
index 1299b70ca2e4f1c3b929abe94035881634961393..cb73b76a557a82cc1e27732ded2c537e4c7f41b9 100644 (file)
 #ifndef EXT4_BITMAP_H_
 #define EXT4_BITMAP_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #include <stdint.h>
@@ -88,6 +92,10 @@ void ext4_bmap_bits_free(uint8_t *bmap, uint32_t sbit, uint32_t bcnt);
 int ext4_bmap_bit_find_clr(uint8_t *bmap, uint32_t sbit, uint32_t ebit,
                           uint32_t *bit_id);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_BITMAP_H_ */
 
 /**
index e96989b3e0e42a793e865a497e2cc1b57d0dd4f2..92d57dfb97314c6128412d616d1632594f55051e 100644 (file)
 #ifndef EXT4_BLOCK_GROUP_H_
 #define EXT4_BLOCK_GROUP_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 #include "ext4_super.h"
index 39514a4f278545c3601b00a1df6c6e2de604b739..0b220523f06e012ce04064efe1cc4f4273308524 100644 (file)
@@ -25,9 +25,6 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef EXT4_BLOCKDEV_H_
-#define EXT4_BLOCKDEV_H_
-
 /** @addtogroup lwext4
  * @{
  */
  * @brief Block device module.
  */
 
+#ifndef EXT4_BLOCKDEV_H_
+#define EXT4_BLOCKDEV_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_bcache.h"
 #include "ext4_debug.h"
@@ -205,6 +209,10 @@ int ext4_block_readbytes(struct ext4_blockdev *bdev, uint64_t off, void *buf,
  * @return  standard error code*/
 int ext4_block_cache_write_back(struct ext4_blockdev *bdev, uint8_t on_off);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_BLOCKDEV_H_ */
 
 /**
index 72100ddadda3146191735b6d9e0bf28404484530..bbf4f5e36e1afeffe1c3e1dfa219b0b1557ccccf 100644 (file)
 #ifndef EXT4_CONFIG_H_
 #define EXT4_CONFIG_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef CONFIG_HAVE_OWN_CFG
 #include <config.h>
 #endif
 #define CONFIG_EXTENT_FULL 1
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_CONFIG_H_ */
 
 /**
index 659699ebdbd4e103cd8fe8925b3d570f271d96e3..24d7a411f53da93dbc62b6c340bb3101aa0d1669 100644 (file)
 #ifndef LWEXT4_EXT4_CRC32C_H_
 #define LWEXT4_EXT4_CRC32C_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #include <stdint.h>
  * @return     updated crc32c value*/
 uint32_t ext4_crc32c(uint32_t crc, const void *buffer, uint32_t length);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LWEXT4_EXT4_CRC32C_H_ */
 
 /**
index a923b474b3f732b6bcf79b31d658fa488c6d98d1..c02a2aa5491c6a79062ca3551f03bed2befa9e6a 100644 (file)
 #ifndef EXT4_DEBUG_H_
 #define EXT4_DEBUG_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_errno.h"
 
@@ -167,6 +171,10 @@ uint32_t ext4_dmask_get(void);
 #define ext4_assert(_v)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_DEBUG_H_ */
 
 /**
index bb1ffe0e428abb7d5686420b732b6d3f6e2d95f3..5bdbef32208c02e7e4e1c6cf8ac7c19a9deb9785 100644 (file)
 #ifndef EXT4_DIR_H_
 #define EXT4_DIR_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 #include "ext4_blockdev.h"
@@ -278,6 +282,10 @@ void ext4_dir_set_checksum(struct ext4_inode_ref *inode_ref,
 /* checksumming functions */
 void initialize_dir_tail(struct ext4_dir_entry_tail *t);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_DIR_H_ */
 
 /**
index 5a864cc38b8f116ec1a82d8b2cc5813a0a2c0a98..f47caec0a1738d0742d4c61258e88d476bf57f5d 100644 (file)
 #ifndef EXT4_DIR_IDX_H_
 #define EXT4_DIR_IDX_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -85,6 +89,10 @@ int ext4_dir_dx_add_entry(struct ext4_inode_ref *parent,
 int ext4_dir_dx_reset_parent_inode(struct ext4_inode_ref *dir,
                                    uint32_t parent_inode);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_DIR_IDX_H_ */
 
 /**
index bf3852a4f9b66eb9c8098475e2e12927e2d24eab..ce5784c6a9f1b0ba39afdaaa3e0490cabb157168 100644 (file)
 #ifndef EXT4_ERRNO_H_
 #define EXT4_ERRNO_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #if !CONFIG_HAVE_OWN_ERRNO
 #define EOK 0
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_ERRNO_H_ */
 
 /**
index 2684e3b95debb4bd5260c2208a0ad271fdb3eec2..2577b24a2c59d6b9bdec5946eef6fe00e787c61f 100644 (file)
 #ifndef EXT4_EXTENT_H_
 #define EXT4_EXTENT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 #include "ext4_inode.h"
@@ -274,6 +278,10 @@ int ext4_extent_remove_space(struct ext4_inode_ref *inode_ref, ext4_lblk_t from,
                             ext4_lblk_t to);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_EXTENT_H_ */
 /**
 * @}
index 085ff27cfe93eb87ccfae3c4fb5e4e914a5e9954..17019e5dd97054cc0d97efa3a524eea918069a08 100644 (file)
 #ifndef EXT4_FS_H_
 #define EXT4_FS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -228,6 +232,10 @@ void ext4_fs_inode_links_count_inc(struct ext4_inode_ref *inode_ref);
  */
 void ext4_fs_inode_links_count_dec(struct ext4_inode_ref *inode_ref);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_FS_H_ */
 
 /**
index 71d8940b8bf466002971ffa1b37828f142a8c7bb..b7a9ac53e47c9644aa3c2a351a671f561d73982c 100644 (file)
 #ifndef EXT4_HASH_H_
 #define EXT4_HASH_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #include <stdint.h>
@@ -53,6 +57,10 @@ int ext2_htree_hash(const char *name, int len, const uint32_t *hash_seed,
                    int hash_version, uint32_t *hash_major,
                    uint32_t *hash_minor);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_HASH_H_ */
 
 /**
index 3b518a703866b958337e312a9c7dc08d508fdf29..cea3fe6bb47f2bfdf7a9efc5860af325659fb589 100644 (file)
@@ -77,6 +77,7 @@ int ext4_ialloc_alloc_inode(struct ext4_fs *fs, uint32_t *index, bool is_dir);
 #ifdef __cplusplus
 }
 #endif
+
 #endif /* EXT4_IALLOC_H_ */
 
 /**
index 1da4b2ccf1c133396e4ef988ebc4a205d1dd3c46..cabbe946c4782b8ce8dfed841e0584a102e4ef23 100644 (file)
 #ifndef EXT4_INODE_H_
 #define EXT4_INODE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 #include <stdint.h>
@@ -321,6 +325,10 @@ bool ext4_inode_can_truncate(struct ext4_sblock *sb, struct ext4_inode *inode);
 struct ext4_extent_header *
 ext4_inode_get_extent_header(struct ext4_inode *inode);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_INODE_H_ */
 
 /**
index 3b97e9fb61c392dcf8106db934ef103f37443863..497bf3b9a29a32914e1098fd00c04a5efd047467 100644 (file)
 #ifndef EXT4_MKFS_H_
 #define EXT4_MKFS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 #include "ext4_blockdev.h"
@@ -67,6 +71,10 @@ int ext4_mkfs_read_info(struct ext4_blockdev *bd, struct ext4_mkfs_info *info);
 int ext4_mkfs(struct ext4_fs *fs, struct ext4_blockdev *bd,
              struct ext4_mkfs_info *info, int fs_type);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_MKFS_H_ */
 
 /**
index 5b7b5a09fec73eed315b67c62cd62232150bf457..2172698e5981a1ab59465e72554f3b5f86275afe 100644 (file)
 #ifndef EXT4_SUPER_H_
 #define EXT4_SUPER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -222,6 +226,10 @@ uint32_t ext4_bg_num_gdb(struct ext4_sblock *s, uint32_t group);
 uint32_t ext4_num_base_meta_clusters(struct ext4_sblock *s,
                                     uint32_t block_group);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_SUPER_H_ */
 
 /**
index a6bdcb5ac4c103f1369c0afaaa7d98eeb9276d00..dfdd19f4cbdfc5832fe61821deaf89326783da62 100644 (file)
 #ifndef EXT4_TYPES_H_
 #define EXT4_TYPES_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_blockdev.h"
 #include "tree.h"
@@ -949,6 +953,10 @@ static inline uint16_t to_le16(uint16_t n)
        ((size_t)(&(((type *)0)->field)))
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_TYPES_H_ */
 
 /**
index 46df6f56ac7db29f8f24b03771edd57cac0162f3..5b2f155504cbec28457f07798fe3b89def252265 100644 (file)
 #ifndef EXT4_XATTR_H_
 #define EXT4_XATTR_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 #include "ext4_types.h"
 
@@ -68,6 +72,10 @@ const char *ext4_extract_xattr_name(const char *full_name, size_t full_name_len,
 const char *ext4_get_xattr_name_prefix(uint8_t name_index,
                                        size_t *ret_prefix_len);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /**
  * @}
index fb8946576d694df82d194b515baea124a5f68944..abde2d38ddfe2abdd0a4b42b92129b18108f27af 100644 (file)
 #ifndef        _SYS_TREE_H_
 #define        _SYS_TREE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "ext4_config.h"
 
 /*
@@ -798,4 +802,8 @@ name##_RB_MINMAX(struct name *head, int val)                                \
            ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL);    \
             (x) = (y))
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _SYS_TREE_H_ */