Skip to content

Commit

Permalink
[include] Use QPL_API macro for each public API (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhukova authored Jan 7, 2025
1 parent e222aac commit 2464086
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
39 changes: 23 additions & 16 deletions include/qpl/c_api/huffman_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <stdint.h>

#include "qpl/c_api/defs.h"
#include "qpl/c_api/serialization.h"
#include "qpl/c_api/statistics.h"
#include "qpl/c_api/status.h"
Expand Down Expand Up @@ -88,8 +89,9 @@ typedef enum {
*
* @return status from @ref qpl_status
*/
qpl_status qpl_deflate_huffman_table_create(const qpl_huffman_table_type_e type, const qpl_path_t path,
const allocator_t allocator, qpl_huffman_table_t* table_ptr);
QPL_API(qpl_status, qpl_deflate_huffman_table_create,
(const qpl_huffman_table_type_e type, const qpl_path_t path, const allocator_t allocator,
qpl_huffman_table_t* table_ptr));

/**
* @brief Creates a @ref qpl_huffman_table_t object for Huffman Only. Allocate and markup of internal structures
Expand All @@ -101,8 +103,9 @@ qpl_status qpl_deflate_huffman_table_create(const qpl_huffman_table_type_e type,
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_only_table_create(const qpl_huffman_table_type_e type, const qpl_path_t path,
const allocator_t allocator, qpl_huffman_table_t* table_ptr);
QPL_API(qpl_status, qpl_huffman_only_table_create,
(const qpl_huffman_table_type_e type, const qpl_path_t path, const allocator_t allocator,
qpl_huffman_table_t* table_ptr));

/**
* @brief Destroy an @ref qpl_huffman_table_t object. Deallocates internal structures
Expand All @@ -111,7 +114,7 @@ qpl_status qpl_huffman_only_table_create(const qpl_huffman_table_type_e type, co
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_destroy(qpl_huffman_table_t table);
QPL_API(qpl_status, qpl_huffman_table_destroy, (qpl_huffman_table_t table));

/** @} */

Expand All @@ -130,7 +133,8 @@ qpl_status qpl_huffman_table_destroy(qpl_huffman_table_t table);
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_init_with_histogram(qpl_huffman_table_t table, const qpl_histogram* const histogram_ptr);
QPL_API(qpl_status, qpl_huffman_table_init_with_histogram,
(qpl_huffman_table_t table, const qpl_histogram* const histogram_ptr));

/**
* @brief Initializes huffman table with provided triplets
Expand All @@ -141,8 +145,8 @@ qpl_status qpl_huffman_table_init_with_histogram(qpl_huffman_table_t table, cons
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_init_with_triplets(qpl_huffman_table_t table, const qpl_huffman_triplet* const triplet_ptr,
const uint32_t triplet_count);
QPL_API(qpl_status, qpl_huffman_table_init_with_triplets,
(qpl_huffman_table_t table, const qpl_huffman_triplet* const triplet_ptr, const uint32_t triplet_count));

/**
* @brief Initializes huffman table with information from another table
Expand All @@ -152,7 +156,7 @@ qpl_status qpl_huffman_table_init_with_triplets(qpl_huffman_table_t table, const
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_init_with_other(qpl_huffman_table_t table, const qpl_huffman_table_t other);
QPL_API(qpl_status, qpl_huffman_table_init_with_other, (qpl_huffman_table_t table, const qpl_huffman_table_t other));

/** @} */

Expand All @@ -171,7 +175,8 @@ qpl_status qpl_huffman_table_init_with_other(qpl_huffman_table_t table, const qp
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_get_type(const qpl_huffman_table_t table, qpl_huffman_table_type_e* const type_ptr);
QPL_API(qpl_status, qpl_huffman_table_get_type,
(const qpl_huffman_table_t table, qpl_huffman_table_type_e* const type_ptr));

/** @} */

Expand All @@ -194,8 +199,8 @@ qpl_status qpl_huffman_table_get_type(const qpl_huffman_table_t table, qpl_huffm
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_get_serialized_size(const qpl_huffman_table_t table, const serialization_options_t options,
size_t* const size_ptr);
QPL_API(qpl_status, qpl_huffman_table_get_serialized_size,
(const qpl_huffman_table_t table, const serialization_options_t options, size_t* const size_ptr));

/**
* @brief Serializes qpl_huffman_table_t object.
Expand All @@ -208,8 +213,9 @@ qpl_status qpl_huffman_table_get_serialized_size(const qpl_huffman_table_t table
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_serialize(const qpl_huffman_table_t table, uint8_t* const dump_buffer_ptr,
const size_t dump_buffer_size, const serialization_options_t options);
QPL_API(qpl_status, qpl_huffman_table_serialize,
(const qpl_huffman_table_t table, uint8_t* const dump_buffer_ptr, const size_t dump_buffer_size,
const serialization_options_t options));

/**
* @brief Deserializes previously serialized huffman table
Expand All @@ -221,8 +227,9 @@ qpl_status qpl_huffman_table_serialize(const qpl_huffman_table_t table, uint8_t*
*
* @return status from @ref qpl_status
*/
qpl_status qpl_huffman_table_deserialize(const uint8_t* const dump_buffer_ptr, const size_t dump_buffer_size,
allocator_t allocator, qpl_huffman_table_t* table_ptr);
QPL_API(qpl_status, qpl_huffman_table_deserialize,
(const uint8_t* const dump_buffer_ptr, const size_t dump_buffer_size, allocator_t allocator,
qpl_huffman_table_t* table_ptr));

/** @} */

Expand Down
4 changes: 3 additions & 1 deletion include/qpl/c_api/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
#pragma GCC visibility push(default)
#endif

#include "qpl/c_api/defs.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Returns a string with a version of the library
*/
const char* qpl_get_library_version();
QPL_API(const char*, qpl_get_library_version, (void));

#ifdef __cplusplus
}
Expand Down

0 comments on commit 2464086

Please sign in to comment.