aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-01 17:08:40 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-01 17:08:40 +0200
commit2e28c45601a57b1d23e9cad33d2bdcc59e8a3f4f (patch)
tree346da06f09e147197a805fa2494ca1633531d8c9
parent4ee671b63b18701a29cf9f119e2dc26a055c69c5 (diff)
Add C++ gurads to publicly exported functions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--include/sqfs/block_processor.h8
-rw-r--r--include/sqfs/compress.h8
-rw-r--r--include/sqfs/dir.h8
-rw-r--r--include/sqfs/id_table.h8
-rw-r--r--include/sqfs/inode.h7
-rw-r--r--include/sqfs/meta_reader.h8
-rw-r--r--include/sqfs/meta_writer.h8
-rw-r--r--include/sqfs/super.h8
-rw-r--r--include/sqfs/table.h8
-rw-r--r--include/sqfs/xattr.h8
10 files changed, 79 insertions, 0 deletions
diff --git a/include/sqfs/block_processor.h b/include/sqfs/block_processor.h
index 18d8c4a..b7550aa 100644
--- a/include/sqfs/block_processor.h
+++ b/include/sqfs/block_processor.h
@@ -63,6 +63,10 @@ typedef struct block_processor_t block_processor_t;
*/
typedef int (*block_cb)(void *user, block_t *blk);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
block_processor_t *block_processor_create(size_t max_block_size,
compressor_t *cmp,
unsigned int num_workers,
@@ -108,4 +112,8 @@ block_t *create_block(const char *filename, int fd, size_t size,
int process_block(block_t *block, compressor_t *cmp,
uint8_t *scratch, size_t scratch_size);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* BLOCK_PROCESSOR_H */
diff --git a/include/sqfs/compress.h b/include/sqfs/compress.h
index c6de185..3860353 100644
--- a/include/sqfs/compress.h
+++ b/include/sqfs/compress.h
@@ -51,6 +51,10 @@ struct compressor_t {
void (*destroy)(compressor_t *stream);
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool compressor_exists(E_SQFS_COMPRESSOR id);
/* block_size is the configured block size for the SquashFS image. Needed
@@ -68,4 +72,8 @@ const char *compressor_name_from_id(E_SQFS_COMPRESSOR id);
int compressor_id_from_name(const char *name, E_SQFS_COMPRESSOR *out);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* COMPRESS_H */
diff --git a/include/sqfs/dir.h b/include/sqfs/dir.h
index 6e47fef..5c822f1 100644
--- a/include/sqfs/dir.h
+++ b/include/sqfs/dir.h
@@ -36,6 +36,10 @@ typedef struct {
uint8_t name[];
} sqfs_dir_index_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns 0 on success. Internally prints to stderr on failure */
int meta_reader_read_dir_header(meta_reader_t *m, sqfs_dir_header_t *hdr);
@@ -43,4 +47,8 @@ int meta_reader_read_dir_header(meta_reader_t *m, sqfs_dir_header_t *hdr);
The function internally prints to stderr on failure */
sqfs_dir_entry_t *meta_reader_read_dir_ent(meta_reader_t *m);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SQFS_DIR_H */
diff --git a/include/sqfs/id_table.h b/include/sqfs/id_table.h
index dcc8a18..b209785 100644
--- a/include/sqfs/id_table.h
+++ b/include/sqfs/id_table.h
@@ -26,6 +26,10 @@ typedef struct {
size_t max_ids;
} id_table_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns 0 on success. Prints error message to stderr on failure. */
int id_table_init(id_table_t *tbl);
@@ -45,4 +49,8 @@ int id_table_write(id_table_t *tbl, int outfd, sqfs_super_t *super,
int id_table_read(id_table_t *tbl, int fd, sqfs_super_t *super,
compressor_t *cmp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ID_TABLE_H */
diff --git a/include/sqfs/inode.h b/include/sqfs/inode.h
index 24889b8..6fb56b6 100644
--- a/include/sqfs/inode.h
+++ b/include/sqfs/inode.h
@@ -130,6 +130,9 @@ typedef struct {
uint8_t extra[];
} sqfs_inode_generic_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Inode can be freed with a single free() call.
The function internally prints error message to stderr on failure. */
@@ -138,4 +141,8 @@ sqfs_inode_generic_t *meta_reader_read_inode(meta_reader_t *ir,
uint64_t block_start,
size_t offset);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SQFS_INODE_H */
diff --git a/include/sqfs/meta_reader.h b/include/sqfs/meta_reader.h
index 75071e7..ab9f46d 100644
--- a/include/sqfs/meta_reader.h
+++ b/include/sqfs/meta_reader.h
@@ -14,6 +14,10 @@
typedef struct meta_reader_t meta_reader_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Create a meta data reader using a given compressor to extract data.
Internally prints error message to stderr on failure.
@@ -35,4 +39,8 @@ void meta_reader_get_position(meta_reader_t *m, uint64_t *block_start,
/* Returns 0 on success. Internally prints to stderr on failure */
int meta_reader_read(meta_reader_t *m, void *data, size_t size);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* META_READER_H */
diff --git a/include/sqfs/meta_writer.h b/include/sqfs/meta_writer.h
index aeee924..e91c1e9 100644
--- a/include/sqfs/meta_writer.h
+++ b/include/sqfs/meta_writer.h
@@ -15,6 +15,10 @@
typedef struct meta_writer_t meta_writer_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Create a meta data reader using a given compressor to compress data.
Internally prints error message to stderr on failure.
If keep_in_mem is true, the blocks are collected in memory and must
@@ -43,4 +47,8 @@ void meta_writer_reset(meta_writer_t *m);
returns non-zero on failure. */
int meta_write_write_to_file(meta_writer_t *m);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* META_WRITER_H */
diff --git a/include/sqfs/super.h b/include/sqfs/super.h
index 51a3a9e..0df1691 100644
--- a/include/sqfs/super.h
+++ b/include/sqfs/super.h
@@ -66,6 +66,10 @@ typedef enum {
SQFS_FLAG_UNCOMPRESSED_IDS = 0x0800,
} E_SQFS_SUPER_FLAGS;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns 0 on success. Prints error messages to stderr on failure. */
int sqfs_super_init(sqfs_super_t *super, size_t block_size, uint32_t mtime,
E_SQFS_COMPRESSOR compressor);
@@ -76,4 +80,8 @@ int sqfs_super_write(sqfs_super_t *super, int fd);
/* Returns 0 on success. Prints error messages to stderr on failure. */
int sqfs_super_read(sqfs_super_t *super, int fd);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SQFS_SUPER_H */
diff --git a/include/sqfs/table.h b/include/sqfs/table.h
index b1b0c2d..bc4c7e8 100644
--- a/include/sqfs/table.h
+++ b/include/sqfs/table.h
@@ -13,6 +13,10 @@
#include <stdint.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
Convenience function for writing meta data to a SquashFS image
@@ -31,4 +35,8 @@ void *sqfs_read_table(int fd, compressor_t *cmp, size_t table_size,
uint64_t location, uint64_t lower_limit,
uint64_t upper_limit);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SQFS_TABLE_H */
diff --git a/include/sqfs/xattr.h b/include/sqfs/xattr.h
index 3d5da39..2e48a4e 100644
--- a/include/sqfs/xattr.h
+++ b/include/sqfs/xattr.h
@@ -45,6 +45,10 @@ typedef struct {
uint32_t unused;
} sqfs_xattr_id_table_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Get a prefix string from the ID or NULL if unknown */
const char *sqfs_get_xattr_prefix(E_SQFS_XATTR_TYPE id);
@@ -54,4 +58,8 @@ int sqfs_get_xattr_prefix_id(const char *key);
/* Check if a given xattr key can be encoded in squashfs at all. */
bool sqfs_has_xattr(const char *key);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SQFS_XATTR_H */