26 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) 68 memcpy(temp, str->
data, str->
len);
112 else if (props->
array == NULL)
214 if (properties == NULL)
223 for (i = 0; i < properties->
count; ++i)
285 unsigned int remlength = 0;
289 if (enddata - (*pptr) > 0)
292 properties->
length = remlength;
293 while (remlength > 0)
303 if (properties->
array == NULL)
315 if (rc != 1 && properties->
array != NULL)
318 properties->
array = NULL;
364 const char*
result = NULL;
385 for (i = 0; i < props->
count; ++i)
415 for (i = 0; i < props->
count; ++i)
420 Log(
LOG_ERROR, -1,
"Error from MQTTProperties add %d", rc);
433 for (i = 0; i < props->
count; ++i)
450 for (i = 0; i < props->
count; ++i)
465 for (i = 0; i < props->
count; ++i)
471 if (cur_index < index)
511 for (i = 0; i < props->
count; ++i)
517 if (cur_index == index)
519 result = &props->
array[i];
int MQTTProperties_read(MQTTProperties *properties, char **pptr, char *enddata)
enum MQTTPropertyCodes value
int MQTTProperties_len(MQTTProperties *props)
int MQTTProperty_read(MQTTProperty *prop, char **pptr, char *enddata)
int MQTTPacket_VBIlen(int rem_len)
int MQTTProperties_write(char **pptr, const MQTTProperties *properties)
void MQTTProperties_free(MQTTProperties *props)
unsigned char readChar(char **pptr)
static char * datadup(const MQTTLenString *str)
#define PAHO_MEMORY_ERROR
int MQTTProperties_add(MQTTProperties *props, const MQTTProperty *prop)
int MQTTProperty_getType(enum MQTTPropertyCodes value)
void writeInt(char **pptr, int anInt)
void writeMQTTLenString(char **pptr, MQTTLenString lenstring)
MQTTProperty * MQTTProperties_getProperty(MQTTProperties *props, enum MQTTPropertyCodes propid)
int MQTTProperties_getNumericValue(MQTTProperties *props, enum MQTTPropertyCodes propid)
void writeChar(char **pptr, char c)
static struct nameToType namesToTypes[]
MQTTProperties MQTTProperties_copy(const MQTTProperties *props)
int MQTTPacket_decodeBuf(char *buf, unsigned int *value)
int MQTTPacket_encode(char *buf, size_t length)
int readInt4(char **pptr)
const char * MQTTPropertyName(enum MQTTPropertyCodes value)
enum MQTTPropertyCodes name
int MQTTLenStringRead(MQTTLenString *lenstring, char **pptr, char *enddata)
enum MQTTPropertyCodes identifier
void Log(enum LOG_LEVELS log_level, int msgno, const char *format,...)
int MQTTProperty_write(char **pptr, MQTTProperty *prop)
int MQTTProperties_propertyCount(MQTTProperties *props, enum MQTTPropertyCodes propid)
void writeInt4(char **pptr, int anInt)
int MQTTProperties_hasProperty(MQTTProperties *props, enum MQTTPropertyCodes propid)
struct @64 nameToString[]
#define MQTT_INVALID_PROPERTY_ID
MQTTProperty * MQTTProperties_getPropertyAt(MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
int MQTTProperties_getNumericValueAt(MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
enum MQTTPropertyTypes type
#define MQTTProperties_initializer