summaryrefslogtreecommitdiff
path: root/include/sqfs/block_processor.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 19:08:10 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-05 19:08:10 +0200
commitf8a92529ec04b560b5b9e647b976892412f78134 (patch)
tree5308d7f500df46ef64423708ed40a37675f4020c /include/sqfs/block_processor.h
parent320ae4f8e752f6652c7b5c8201d7267cd4de17c1 (diff)
Fix API visibility for libsquashfs.so
This commit adds a "predef.h" header to libsquashfs that exposes two macros, SQFS_API and SQFS_INTERNAL that are used to explicilty set the visibiliy of stuff that ends up in libsquashfs to default or hidden. For compatibillity with Windows which may at some point eventually be considered, the SQFS_API define is set to dllexport IF the cpp symbol SQFS_BUILDING_DLL is defined and set to import otherwise. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs/block_processor.h')
-rw-r--r--include/sqfs/block_processor.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/sqfs/block_processor.h b/include/sqfs/block_processor.h
index bde0a2e..97bfd34 100644
--- a/include/sqfs/block_processor.h
+++ b/include/sqfs/block_processor.h
@@ -8,6 +8,7 @@
#define SFQS_BLOCK_PROCESSOR_H
#include "config.h"
+#include "sqfs/predef.h"
#include "sqfs/compress.h"
enum {
@@ -67,13 +68,14 @@ typedef int (*sqfs_block_cb)(void *user, sqfs_block_t *blk);
extern "C" {
#endif
+SQFS_API
sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size,
sqfs_compressor_t *cmp,
unsigned int num_workers,
void *user,
sqfs_block_cb callback);
-void sqfs_block_processor_destroy(sqfs_block_processor_t *proc);
+SQFS_API void sqfs_block_processor_destroy(sqfs_block_processor_t *proc);
/*
Add a block to be processed. Returns non-zero on error and prints a message
@@ -85,22 +87,22 @@ void sqfs_block_processor_destroy(sqfs_block_processor_t *proc);
Even on failure, the workers may still be running and
sqfs_block_processor_finish must be called before cleaning up.
*/
-int sqfs_block_processor_enqueue(sqfs_block_processor_t *proc,
- sqfs_block_t *block);
+SQFS_API int sqfs_block_processor_enqueue(sqfs_block_processor_t *proc,
+ sqfs_block_t *block);
/*
Wait for the compressor workers to finish. Returns zero on success, non-zero
if an internal error occoured or one of the block callbacks returned a
non-zero value.
*/
-int sqfs_block_processor_finish(sqfs_block_processor_t *proc);
+SQFS_API int sqfs_block_processor_finish(sqfs_block_processor_t *proc);
/*
Convenience function to process a data block. Returns 0 on success,
prints to stderr on failure.
*/
-int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
- uint8_t *scratch, size_t scratch_size);
+SQFS_API int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
+ uint8_t *scratch, size_t scratch_size);
#ifdef __cplusplus
}