Make libmosquitto_common shared on Windows.

This commit is contained in:
Roger A. Light
2024-03-27 08:38:13 +00:00
committed by Roger Light
parent df7fe15f75
commit 79022d6b4d
14 changed files with 99 additions and 107 deletions
+10
View File
@@ -26,6 +26,16 @@ Contributors:
extern "C" {
#endif
#ifdef WIN32
# ifdef libmosquitto_common_EXPORTS
# define libmosqcommon_EXPORT __declspec(dllexport)
# else
# define libmosqcommon_EXPORT __declspec(dllimport)
# endif
#else
# define libmosqcommon_EXPORT
#endif
#include <mosquitto/libcommon_base64.h>
#include <mosquitto/libcommon_file.h>
#include <mosquitto/libcommon_memory.h>
+2 -2
View File
@@ -28,8 +28,8 @@ Contributors:
extern "C" {
#endif
int mosquitto_base64_encode(const unsigned char *in, size_t in_len, char **encoded);
int mosquitto_base64_decode(const char *in, unsigned char **decoded, unsigned int *decoded_len);
libmosqcommon_EXPORT int mosquitto_base64_encode(const unsigned char *in, size_t in_len, char **encoded);
libmosqcommon_EXPORT int mosquitto_base64_decode(const char *in, unsigned char **decoded, unsigned int *decoded_len);
#ifdef __cplusplus
}
+4 -4
View File
@@ -34,25 +34,25 @@ extern "C" {
/*
* Function: mosquitto_fopen
*/
FILE *mosquitto_fopen(const char *path, const char *mode, bool restrict_read);
libmosqcommon_EXPORT FILE *mosquitto_fopen(const char *path, const char *mode, bool restrict_read);
/*
* Function: mosquitto_fgets
*/
char *mosquitto_fgets(char **buf, int *buflen, FILE *stream);
libmosqcommon_EXPORT char *mosquitto_fgets(char **buf, int *buflen, FILE *stream);
/*
* Function: mosquitto_write_file
*/
int mosquitto_write_file(const char* target_path, bool restrict_read, int (*write_fn)(FILE* fptr, void* user_data), void* user_data, void (*log_fn)(const char* msg));
libmosqcommon_EXPORT int mosquitto_write_file(const char* target_path, bool restrict_read, int (*write_fn)(FILE* fptr, void* user_data), void* user_data, void (*log_fn)(const char* msg));
/*
* Function: mosquitto_trimblanks
*
* Removes blanks from the end of a string.
*/
char *mosquitto_trimblanks(char *str);
libmosqcommon_EXPORT char *mosquitto_trimblanks(char *str);
#ifdef __cplusplus
}
+7 -13
View File
@@ -29,12 +29,6 @@ Contributors:
extern "C" {
#endif
#if defined(WIN32) && defined(mosquitto_EXPORTS)
# define mosq_EXPORT __declspec(dllexport)
#else
# define mosq_EXPORT
#endif
/* =========================================================================
*
* Section: Memory allocation.
@@ -47,34 +41,34 @@ extern "C" {
/*
* Function: mosquitto_calloc
*/
mosq_EXPORT void *mosquitto_calloc(size_t nmemb, size_t size);
libmosqcommon_EXPORT void *mosquitto_calloc(size_t nmemb, size_t size);
/*
* Function: mosquitto_free
*/
mosq_EXPORT void mosquitto_free(void *mem);
libmosqcommon_EXPORT void mosquitto_free(void *mem);
/*
* Function: mosquitto_malloc
*/
mosq_EXPORT void *mosquitto_malloc(size_t size);
libmosqcommon_EXPORT void *mosquitto_malloc(size_t size);
/*
* Function: mosquitto_realloc
*/
mosq_EXPORT void *mosquitto_realloc(void *ptr, size_t size);
libmosqcommon_EXPORT void *mosquitto_realloc(void *ptr, size_t size);
/*
* Function: mosquitto_strdup
*/
mosq_EXPORT char *mosquitto_strdup(const char *s);
libmosqcommon_EXPORT char *mosquitto_strdup(const char *s);
/*
* Function: mosquitto_strndup
*/
mosq_EXPORT char *mosquitto_strndup(const char *s, size_t n);
libmosqcommon_EXPORT char *mosquitto_strndup(const char *s, size_t n);
void mosquitto_memory_set_limit(size_t lim);
libmosqcommon_EXPORT void mosquitto_memory_set_limit(size_t lim);
#define mosquitto_FREE(A) do { mosquitto_free(A); (A) = NULL;} while(0)
+38 -38
View File
@@ -53,7 +53,7 @@ extern "C" {
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_byte(&proplist, MQTT_PROP_PAYLOAD_FORMAT_IDENTIFIER, 1);
*/
libmosq_EXPORT int mosquitto_property_add_byte(mosquitto_property **proplist, int identifier, uint8_t value);
libmosqcommon_EXPORT int mosquitto_property_add_byte(mosquitto_property **proplist, int identifier, uint8_t value);
/*
* Function: mosquitto_property_add_int16
@@ -77,7 +77,7 @@ libmosq_EXPORT int mosquitto_property_add_byte(mosquitto_property **proplist, in
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_int16(&proplist, MQTT_PROP_RECEIVE_MAXIMUM, 1000);
*/
libmosq_EXPORT int mosquitto_property_add_int16(mosquitto_property **proplist, int identifier, uint16_t value);
libmosqcommon_EXPORT int mosquitto_property_add_int16(mosquitto_property **proplist, int identifier, uint16_t value);
/*
* Function: mosquitto_property_add_int32
@@ -101,7 +101,7 @@ libmosq_EXPORT int mosquitto_property_add_int16(mosquitto_property **proplist, i
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_int32(&proplist, MQTT_PROP_MESSAGE_EXPIRY_INTERVAL, 86400);
*/
libmosq_EXPORT int mosquitto_property_add_int32(mosquitto_property **proplist, int identifier, uint32_t value);
libmosqcommon_EXPORT int mosquitto_property_add_int32(mosquitto_property **proplist, int identifier, uint32_t value);
/*
* Function: mosquitto_property_add_varint
@@ -125,7 +125,7 @@ libmosq_EXPORT int mosquitto_property_add_int32(mosquitto_property **proplist, i
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_varint(&proplist, MQTT_PROP_SUBSCRIPTION_IDENTIFIER, 1);
*/
libmosq_EXPORT int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value);
libmosqcommon_EXPORT int mosquitto_property_add_varint(mosquitto_property **proplist, int identifier, uint32_t value);
/*
* Function: mosquitto_property_add_binary
@@ -150,7 +150,7 @@ libmosq_EXPORT int mosquitto_property_add_varint(mosquitto_property **proplist,
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_binary(&proplist, MQTT_PROP_AUTHENTICATION_DATA, auth_data, auth_data_len);
*/
libmosq_EXPORT int mosquitto_property_add_binary(mosquitto_property **proplist, int identifier, const void *value, uint16_t len);
libmosqcommon_EXPORT int mosquitto_property_add_binary(mosquitto_property **proplist, int identifier, const void *value, uint16_t len);
/*
* Function: mosquitto_property_add_string
@@ -175,7 +175,7 @@ libmosq_EXPORT int mosquitto_property_add_binary(mosquitto_property **proplist,
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_string(&proplist, MQTT_PROP_CONTENT_TYPE, "application/json");
*/
libmosq_EXPORT int mosquitto_property_add_string(mosquitto_property **proplist, int identifier, const char *value);
libmosqcommon_EXPORT int mosquitto_property_add_string(mosquitto_property **proplist, int identifier, const char *value);
/*
* Function: mosquitto_property_add_string_pair
@@ -201,7 +201,7 @@ libmosq_EXPORT int mosquitto_property_add_string(mosquitto_property **proplist,
* > mosquitto_property *proplist = NULL;
* > mosquitto_property_add_string_pair(&proplist, MQTT_PROP_USER_PROPERTY, "client", "mosquitto_pub");
*/
libmosq_EXPORT int mosquitto_property_add_string_pair(mosquitto_property **proplist, int identifier, const char *name, const char *value);
libmosqcommon_EXPORT int mosquitto_property_add_string_pair(mosquitto_property **proplist, int identifier, const char *name, const char *value);
/*
@@ -218,7 +218,7 @@ libmosq_EXPORT int mosquitto_property_add_string_pair(mosquitto_property **propl
* MOSQ_ERR_INVAL - if proplist is NULL or property is NULL
* MOSQ_ERR_NOT_FOUND - if the property was not found
*/
libmosq_EXPORT int mosquitto_property_remove(mosquitto_property **proplist, const mosquitto_property *property);
libmosqcommon_EXPORT int mosquitto_property_remove(mosquitto_property **proplist, const mosquitto_property *property);
/*
@@ -233,7 +233,7 @@ libmosq_EXPORT int mosquitto_property_remove(mosquitto_property **proplist, cons
* A valid property identifier on success
* 0 - on error
*/
libmosq_EXPORT int mosquitto_property_identifier(const mosquitto_property *property);
libmosqcommon_EXPORT int mosquitto_property_identifier(const mosquitto_property *property);
/*
@@ -257,7 +257,7 @@ libmosq_EXPORT int mosquitto_property_identifier(const mosquitto_property *prope
* Pointer to the next item in the list
* NULL, if proplist is NULL, or if there are no more items in the list.
*/
libmosq_EXPORT mosquitto_property *mosquitto_property_next(const mosquitto_property *proplist);
libmosqcommon_EXPORT mosquitto_property *mosquitto_property_next(const mosquitto_property *proplist);
/*
@@ -299,7 +299,7 @@ libmosq_EXPORT mosquitto_property *mosquitto_property_next(const mosquitto_prope
* }
* (end)
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_byte(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_byte(
const mosquitto_property *proplist,
int identifier,
uint8_t *value,
@@ -324,7 +324,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_byte(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int16(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_int16(
const mosquitto_property *proplist,
int identifier,
uint16_t *value,
@@ -349,7 +349,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int16(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int32(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_int32(
const mosquitto_property *proplist,
int identifier,
uint32_t *value,
@@ -374,7 +374,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_int32(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_varint(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_varint(
const mosquitto_property *proplist,
int identifier,
uint32_t *value,
@@ -402,7 +402,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_varint(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_binary(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_binary(
const mosquitto_property *proplist,
int identifier,
void **value,
@@ -432,7 +432,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_binary(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_string(
const mosquitto_property *proplist,
int identifier,
char **value,
@@ -464,7 +464,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string(
* Example:
* See <mosquitto_property_read_byte>
*/
libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string_pair(
libmosqcommon_EXPORT const mosquitto_property *mosquitto_property_read_string_pair(
const mosquitto_property *proplist,
int identifier,
char **name,
@@ -483,7 +483,7 @@ libmosq_EXPORT const mosquitto_property *mosquitto_property_read_string_pair(
* A valid property type on success
* 0 - on error
*/
libmosq_EXPORT int mosquitto_property_type(const mosquitto_property *property);
libmosqcommon_EXPORT int mosquitto_property_type(const mosquitto_property *property);
/*
@@ -498,7 +498,7 @@ libmosq_EXPORT int mosquitto_property_type(const mosquitto_property *property);
* Byte value on success
* 0 - on error (property is NULL, or not a byte)
*/
libmosq_EXPORT uint8_t mosquitto_property_byte_value(const mosquitto_property *property);
libmosqcommon_EXPORT uint8_t mosquitto_property_byte_value(const mosquitto_property *property);
/*
@@ -513,7 +513,7 @@ libmosq_EXPORT uint8_t mosquitto_property_byte_value(const mosquitto_property *p
* Int16 value on success
* 0 - on error (property is NULL, or not a int16)
*/
libmosq_EXPORT uint16_t mosquitto_property_int16_value(const mosquitto_property *property);
libmosqcommon_EXPORT uint16_t mosquitto_property_int16_value(const mosquitto_property *property);
/*
@@ -528,7 +528,7 @@ libmosq_EXPORT uint16_t mosquitto_property_int16_value(const mosquitto_property
* Int32 value on success
* 0 - on error (property is NULL, or not a int32)
*/
libmosq_EXPORT uint32_t mosquitto_property_int32_value(const mosquitto_property *property);
libmosqcommon_EXPORT uint32_t mosquitto_property_int32_value(const mosquitto_property *property);
/*
@@ -543,7 +543,7 @@ libmosq_EXPORT uint32_t mosquitto_property_int32_value(const mosquitto_property
* Varint value on success
* 0 - on error (property is NULL, or not a varint)
*/
libmosq_EXPORT uint32_t mosquitto_property_varint_value(const mosquitto_property *property);
libmosqcommon_EXPORT uint32_t mosquitto_property_varint_value(const mosquitto_property *property);
/*
@@ -558,7 +558,7 @@ libmosq_EXPORT uint32_t mosquitto_property_varint_value(const mosquitto_property
* Binary value on success
* NULL - on error (property is NULL, or not a binary)
*/
libmosq_EXPORT const void *mosquitto_property_binary_value(const mosquitto_property *property);
libmosqcommon_EXPORT const void *mosquitto_property_binary_value(const mosquitto_property *property);
/*
@@ -573,7 +573,7 @@ libmosq_EXPORT const void *mosquitto_property_binary_value(const mosquitto_prope
* Binary value length on success
* 0 - on error (property is NULL, or not a binary)
*/
libmosq_EXPORT uint16_t mosquitto_property_binary_value_length(const mosquitto_property *property);
libmosqcommon_EXPORT uint16_t mosquitto_property_binary_value_length(const mosquitto_property *property);
/*
@@ -588,7 +588,7 @@ libmosq_EXPORT uint16_t mosquitto_property_binary_value_length(const mosquitto_p
* String value on success
* NULL - on error (property is NULL, or not a string or string pair)
*/
libmosq_EXPORT const char *mosquitto_property_string_value(const mosquitto_property *property);
libmosqcommon_EXPORT const char *mosquitto_property_string_value(const mosquitto_property *property);
/*
@@ -603,7 +603,7 @@ libmosq_EXPORT const char *mosquitto_property_string_value(const mosquitto_prope
* Value length on success
* 0 - on error (property is NULL, or not a string or string pair)
*/
libmosq_EXPORT uint16_t mosquitto_property_string_value_length(const mosquitto_property *property);
libmosqcommon_EXPORT uint16_t mosquitto_property_string_value_length(const mosquitto_property *property);
/*
@@ -618,7 +618,7 @@ libmosq_EXPORT uint16_t mosquitto_property_string_value_length(const mosquitto_p
* String name on success
* NULL - on error (property is NULL, or not a string pair)
*/
libmosq_EXPORT const char *mosquitto_property_string_name(const mosquitto_property *property);
libmosqcommon_EXPORT const char *mosquitto_property_string_name(const mosquitto_property *property);
/*
@@ -633,7 +633,7 @@ libmosq_EXPORT const char *mosquitto_property_string_name(const mosquitto_proper
* Name length on success
* 0 - on error (property is NULL, or not a string pair)
*/
libmosq_EXPORT uint16_t mosquitto_property_string_name_length(const mosquitto_property *property);
libmosqcommon_EXPORT uint16_t mosquitto_property_string_name_length(const mosquitto_property *property);
/*
@@ -649,7 +649,7 @@ libmosq_EXPORT uint16_t mosquitto_property_string_name_length(const mosquitto_pr
* > // Add properties
* > mosquitto_property_free_all(&properties);
*/
libmosq_EXPORT void mosquitto_property_free_all(mosquitto_property **properties);
libmosqcommon_EXPORT void mosquitto_property_free_all(mosquitto_property **properties);
/*
* Function: mosquitto_property_copy_all
@@ -663,7 +663,7 @@ libmosq_EXPORT void mosquitto_property_free_all(mosquitto_property **properties)
* MOSQ_ERR_INVAL - if dest is NULL
* MOSQ_ERR_NOMEM - on out of memory (dest will be set to NULL)
*/
libmosq_EXPORT int mosquitto_property_copy_all(mosquitto_property **dest, const mosquitto_property *src);
libmosqcommon_EXPORT int mosquitto_property_copy_all(mosquitto_property **dest, const mosquitto_property *src);
/*
* Function: mosquitto_property_check_command
@@ -678,7 +678,7 @@ libmosq_EXPORT int mosquitto_property_copy_all(mosquitto_property **dest, const
* MOSQ_ERR_SUCCESS - if the identifier is valid for command
* MOSQ_ERR_PROTOCOL - if the identifier is not valid for use with command.
*/
libmosq_EXPORT int mosquitto_property_check_command(int command, int identifier);
libmosqcommon_EXPORT int mosquitto_property_check_command(int command, int identifier);
/*
@@ -701,7 +701,7 @@ libmosq_EXPORT int mosquitto_property_check_command(int command, int identifier)
* MOSQ_ERR_DUPLICATE_PROPERTY - if a property is duplicated where it is forbidden.
* MOSQ_ERR_PROTOCOL - if any property is invalid
*/
libmosq_EXPORT int mosquitto_property_check_all(int command, const mosquitto_property *properties);
libmosqcommon_EXPORT int mosquitto_property_check_all(int command, const mosquitto_property *properties);
/*
* Function: mosquitto_property_identifier_to_string
@@ -717,7 +717,7 @@ libmosq_EXPORT int mosquitto_property_check_all(int command, const mosquitto_pro
* A const string to the property name on success
* NULL on failure
*/
libmosq_EXPORT const char *mosquitto_property_identifier_to_string(int identifier);
libmosqcommon_EXPORT const char *mosquitto_property_identifier_to_string(int identifier);
/* Function: mosquitto_string_to_property_info
@@ -742,13 +742,13 @@ libmosq_EXPORT const char *mosquitto_property_identifier_to_string(int identifie
* // type == MQTT_PROP_TYPE_STRING
* (end)
*/
libmosq_EXPORT int mosquitto_string_to_property_info(const char *propname, int *identifier, int *type);
libmosqcommon_EXPORT int mosquitto_string_to_property_info(const char *propname, int *identifier, int *type);
void mosquitto_property_free(mosquitto_property **property);
unsigned int mosquitto_property_get_length(const mosquitto_property *property);
unsigned int mosquitto_property_get_length_all(const mosquitto_property *property);
unsigned int mosquitto_property_get_remaining_length(const mosquitto_property *props);
libmosqcommon_EXPORT void mosquitto_property_free(mosquitto_property **property);
libmosqcommon_EXPORT unsigned int mosquitto_property_get_length(const mosquitto_property *property);
libmosqcommon_EXPORT unsigned int mosquitto_property_get_length_all(const mosquitto_property *property);
libmosqcommon_EXPORT unsigned int mosquitto_property_get_remaining_length(const mosquitto_property *props);
#ifdef __cplusplus
}
+1 -1
View File
@@ -41,7 +41,7 @@ extern "C" {
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_UNKNOWN - if an error occurred
*/
int mosquitto_getrandom(void *bytes, int count);
libmosqcommon_EXPORT int mosquitto_getrandom(void *bytes, int count);
#ifdef __cplusplus
}
+4 -4
View File
@@ -41,7 +41,7 @@ extern "C" {
* Returns:
* A constant string describing the error.
*/
libmosq_EXPORT const char *mosquitto_strerror(int mosq_errno);
libmosqcommon_EXPORT const char *mosquitto_strerror(int mosq_errno);
/*
* Function: mosquitto_connack_string
@@ -54,7 +54,7 @@ libmosq_EXPORT const char *mosquitto_strerror(int mosq_errno);
* Returns:
* A constant string describing the result.
*/
libmosq_EXPORT const char *mosquitto_connack_string(int connack_code);
libmosqcommon_EXPORT const char *mosquitto_connack_string(int connack_code);
/*
* Function: mosquitto_reason_string
@@ -67,7 +67,7 @@ libmosq_EXPORT const char *mosquitto_connack_string(int connack_code);
* Returns:
* A constant string describing the reason.
*/
libmosq_EXPORT const char *mosquitto_reason_string(int reason_code);
libmosqcommon_EXPORT const char *mosquitto_reason_string(int reason_code);
/* Function: mosquitto_string_to_command
*
@@ -88,7 +88,7 @@ libmosq_EXPORT const char *mosquitto_reason_string(int reason_code);
* // cmd == CMD_CONNECT
* (end)
*/
libmosq_EXPORT int mosquitto_string_to_command(const char *str, int *cmd);
libmosqcommon_EXPORT int mosquitto_string_to_command(const char *str, int *cmd);
#ifdef __cplusplus
}
-18
View File
@@ -5,24 +5,6 @@
extern "C" {
#endif
#ifdef WIN32
# ifdef libmosquitto_common_EXPORTS
# define libmosqcommon_EXPORT __declspec(dllexport)
# else
# ifndef LIBMOSQUITTO_STATIC
# ifdef libmosquittocommon_EXPORTS
# define libmosqcommon_EXPORT __declspec(dllexport)
# else
# define libmosqcommon_EXPORT __declspec(dllimport)
# endif
# else
# define libmosqcommon_EXPORT
# endif
# endif
#else
# define libmosqcommon_EXPORT
#endif
#include <time.h>
/* Function: mosquitto_time
+11 -11
View File
@@ -82,7 +82,7 @@ extern "C" {
* See Also:
* <mosquitto_sub_topic_tokens_free>
*/
libmosq_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count);
libmosqcommon_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic, char ***topics, int *count);
/*
* Function: mosquitto_sub_topic_tokens_free
@@ -100,7 +100,7 @@ libmosq_EXPORT int mosquitto_sub_topic_tokenise(const char *subtopic, char ***to
* See Also:
* <mosquitto_sub_topic_tokenise>
*/
libmosq_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics, int count);
libmosqcommon_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics, int count);
/*
* Function: mosquitto_topic_matches_sub
@@ -122,7 +122,7 @@ libmosq_EXPORT int mosquitto_sub_topic_tokens_free(char ***topics, int count);
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if the input parameters were invalid.
*/
libmosq_EXPORT int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result);
libmosqcommon_EXPORT int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result);
/*
* Function: mosquitto_topic_matches_sub2
@@ -130,7 +130,7 @@ libmosq_EXPORT int mosquitto_topic_matches_sub(const char *sub, const char *topi
* Identical to <mosquitto_topic_matches_sub>. The sublen and topiclen
* parameters are *IGNORED*.
*/
libmosq_EXPORT int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result);
libmosqcommon_EXPORT int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result);
/*
@@ -168,7 +168,7 @@ libmosq_EXPORT int mosquitto_topic_matches_sub2(const char *sub, size_t sublen,
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if the input parameters were invalid.
*/
libmosq_EXPORT int mosquitto_topic_matches_sub_with_pattern(const char *sub, const char *topic, const char *clientid, const char *username, bool *result);
libmosqcommon_EXPORT int mosquitto_topic_matches_sub_with_pattern(const char *sub, const char *topic, const char *clientid, const char *username, bool *result);
/*
@@ -191,7 +191,7 @@ libmosq_EXPORT int mosquitto_topic_matches_sub_with_pattern(const char *sub, con
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if the input parameters were invalid.
*/
libmosq_EXPORT int mosquitto_sub_matches_acl(const char *acl, const char *sub, bool *result);
libmosqcommon_EXPORT int mosquitto_sub_matches_acl(const char *acl, const char *sub, bool *result);
/*
@@ -230,7 +230,7 @@ libmosq_EXPORT int mosquitto_sub_matches_acl(const char *acl, const char *sub, b
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if the input parameters were invalid.
*/
libmosq_EXPORT int mosquitto_sub_matches_acl_with_pattern(const char *acl, const char *sub, const char *clientid, const char *username, bool *result);
libmosqcommon_EXPORT int mosquitto_sub_matches_acl_with_pattern(const char *acl, const char *sub, const char *clientid, const char *username, bool *result);
/*
@@ -256,7 +256,7 @@ libmosq_EXPORT int mosquitto_sub_matches_acl_with_pattern(const char *acl, const
* See Also:
* <mosquitto_sub_topic_check>
*/
libmosq_EXPORT int mosquitto_pub_topic_check(const char *topic);
libmosqcommon_EXPORT int mosquitto_pub_topic_check(const char *topic);
/*
* Function: mosquitto_pub_topic_check2
@@ -282,7 +282,7 @@ libmosq_EXPORT int mosquitto_pub_topic_check(const char *topic);
* See Also:
* <mosquitto_sub_topic_check>
*/
libmosq_EXPORT int mosquitto_pub_topic_check2(const char *topic, size_t topiclen);
libmosqcommon_EXPORT int mosquitto_pub_topic_check2(const char *topic, size_t topiclen);
/*
* Function: mosquitto_sub_topic_check
@@ -310,7 +310,7 @@ libmosq_EXPORT int mosquitto_pub_topic_check2(const char *topic, size_t topiclen
* See Also:
* <mosquitto_sub_topic_check>
*/
libmosq_EXPORT int mosquitto_sub_topic_check(const char *topic);
libmosqcommon_EXPORT int mosquitto_sub_topic_check(const char *topic);
/*
* Function: mosquitto_sub_topic_check2
@@ -339,7 +339,7 @@ libmosq_EXPORT int mosquitto_sub_topic_check(const char *topic);
* See Also:
* <mosquitto_sub_topic_check>
*/
libmosq_EXPORT int mosquitto_sub_topic_check2(const char *topic, size_t topiclen);
libmosqcommon_EXPORT int mosquitto_sub_topic_check2(const char *topic, size_t topiclen);
#ifdef __cplusplus
}
+1 -1
View File
@@ -41,7 +41,7 @@ extern "C" {
* MOSQ_ERR_INVAL - if str is NULL or len<0 or len>65536
* MOSQ_ERR_MALFORMED_UTF8 - if str is not valid UTF-8
*/
libmosq_EXPORT int mosquitto_validate_utf8(const char *str, int len);
libmosqcommon_EXPORT int mosquitto_validate_utf8(const char *str, int len);
#ifdef __cplusplus
}
+6 -10
View File
@@ -30,18 +30,14 @@ extern "C" {
#ifdef WIN32
# ifdef mosquitto_EXPORTS
# define libmosq_EXPORT __declspec(dllexport)
# else
# ifndef LIBMOSQUITTO_STATIC
# ifdef libmosquitto_EXPORTS
# define libmosq_EXPORT __declspec(dllexport)
# else
# define libmosq_EXPORT __declspec(dllimport)
# endif
# ifndef LIBMOSQUITTO_STATIC
# ifdef libmosquitto_EXPORTS
# define libmosq_EXPORT __declspec(dllexport)
# else
# define libmosq_EXPORT
# define libmosq_EXPORT __declspec(dllimport)
# endif
# else
# define libmosq_EXPORT
# endif
#else
# define libmosq_EXPORT
+2
View File
@@ -49,6 +49,7 @@ Section "Files" SecInstall
File "..\build\client\Release\mosquitto_pub.exe"
File "..\build\client\Release\mosquitto_sub.exe"
File "..\build\client\Release\mosquitto_rr.exe"
File "..\build\libcommon\Release\mosquitto_common.dll"
File "..\build\lib\Release\mosquitto.dll"
File "..\build\lib\cpp\Release\mosquittopp.dll"
File "..\build\plugins\dynamic-security\Release\mosquitto_dynamic_security.dll"
@@ -132,6 +133,7 @@ SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
Delete "$INSTDIR\mosquitto.exe"
Delete "$INSTDIR\mosquitto_common.dll"
Delete "$INSTDIR\mosquitto_ctrl.exe"
Delete "$INSTDIR\mosquitto_passwd.exe"
Delete "$INSTDIR\mosquitto_pub.exe"
+4 -2
View File
@@ -50,6 +50,7 @@ Section "Files" SecInstall
File "..\build64\client\Release\mosquitto_pub.exe"
File "..\build64\client\Release\mosquitto_sub.exe"
File "..\build64\client\Release\mosquitto_rr.exe"
File "..\build64\libcommon\Release\mosquitto_common.dll"
File "..\build64\lib\Release\mosquitto.dll"
File "..\build64\lib\cpp\Release\mosquittopp.dll"
File "..\build64\plugins\dynamic-security\Release\mosquitto_dynamic_security.dll"
@@ -133,13 +134,14 @@ SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
Delete "$INSTDIR\mosquitto.dll"
Delete "$INSTDIR\mosquitto.exe"
Delete "$INSTDIR\mosquitto_common.dll"
Delete "$INSTDIR\mosquitto_ctrl.exe"
Delete "$INSTDIR\mosquitto_passwd.exe"
Delete "$INSTDIR\mosquitto_pub.exe"
Delete "$INSTDIR\mosquitto_sub.exe"
Delete "$INSTDIR\mosquitto_rr.exe"
Delete "$INSTDIR\mosquitto.dll"
Delete "$INSTDIR\mosquitto_sub.exe"
Delete "$INSTDIR\mosquittopp.dll"
Delete "$INSTDIR\mosquitto_dynamic_security.dll"
Delete "$INSTDIR\mosquitto_persist_sqlite.dll"
+9 -3
View File
@@ -11,9 +11,15 @@ set(C_SRC
utf8_common.c
)
add_library(libmosquitto_common OBJECT
${C_SRC}
)
if(WIN32)
add_library(libmosquitto_common SHARED
${C_SRC}
)
else()
add_library(libmosquitto_common OBJECT
${C_SRC}
)
endif()
target_include_directories(libmosquitto_common
PUBLIC