version 1.1.1.1.2.2, 2011/11/07 13:58:27
|
version 1.1.1.1.2.4, 2011/11/18 10:11:37
|
Line 1
|
Line 1
|
#include "global.h" |
#include "global.h" |
|
|
|
|
static int mqtt_Errno; | #pragma GCC visibility push(hidden) |
static char mqtt_Error[STRSIZ]; | |
|
|
|
int mqtt_Errno; |
|
char mqtt_Error[STRSIZ]; |
|
|
|
#pragma GCC visibility pop |
|
|
// |
// |
// Error maintenance functions ... |
// Error maintenance functions ... |
// |
// |
Line 112 mqtt_sizeLen(u_int len)
|
Line 115 mqtt_sizeLen(u_int len)
|
break; |
break; |
|
|
return ++i; |
return ++i; |
|
} |
|
|
|
/* |
|
* mqtt_str2var Create MQTT variable from string |
|
* @csStr = string |
|
* @strLen = string length |
|
* return: NULL error or != ok variable, must be free after use! |
|
*/ |
|
inline mqtthdr_var_t * |
|
mqtt_str2var(const u_char *csStr, u_short strLen) |
|
{ |
|
mqtthdr_var_t *v; |
|
|
|
if (!csStr) |
|
return NULL; |
|
if (!(v = malloc(strLen + sizeof(mqtthdr_var_t)))) { |
|
LOGERR; |
|
return NULL; |
|
} else |
|
memset(v, 0, strLen + sizeof(mqtthdr_var_t)); |
|
|
|
memcpy(v->var_data, csStr, strLen); |
|
v->var_sb.val = htons(strLen); |
|
|
|
return v; |
} |
} |