#ifndef __MY_PUBLIC__
#define __MY_PUBLIC__

typedef unsigned char BYTE;
typedef char CHAR;
typedef unsigned short USHORT;
typedef short SHORT;
typedef unsigned int UWORD;
typedef int WORD;
typedef long long DWORD;
typedef unsigned long long UDWORD;


#define GET_JSON_VALUE_INT_LOG(a, b, c)             \
    do {                                            \
        GET_JSON_VALUE_INT(a, b, c);                \
        dbg_syslog(LOG_DEBUG, "key:%s :%d", b, c);  \
    } while (0)

#define GET_JSON_VALUE_DOUBLE_LOG(a, b, c)          \
    do {                                            \
        GET_JSON_VALUE_DOUBLE(a, b, c);             \
        dbg_syslog(LOG_DEBUG, "key:%s :%f", b, c);  \
    } while (0)


#define GET_JSON_VALUE_DY_STRING_LOG(a, b, c)       \
    do {                                            \
        GET_JSON_VALUE_DY_STRING(a, b, c);          \
        dbg_syslog(LOG_DEBUG, "key:%s :%s", b, c);  \
    } while (0)

#define GET_JSON_VALUE_STRING_LOG(a, b, c)          \
    do {                                            \
        GET_JSON_VALUE_STRING(a, b, c);             \
        dbg_syslog(LOG_DEBUG, "key:%s :%s", b, c);  \
    } while (0)

#define GET_JSON_VALUE_STRING_LOG_WITH_DEFAULT(a, b, c, d)      \
    do {                                                        \
        cJSON *item = cJSON_GetObjectItemCaseSensitive(a, b);   \
        if (item != NULL && cJSON_IsString(item))               \
        {                                                       \
            strncpy(c, item->valuestring, sizeof(c) - 1);       \
            dbg_syslog(LOG_DEBUG, "key:%s :%s", b, c);          \
        }                                                       \
        else                                                    \
        {                                                       \
            strncpy(c, d, sizeof(c) - 1);                       \
            dbg_syslog(LOG_DEBUG, "key:%s not found, using default value: %s", b, d); \
        }                                                       \
    } while (0)


#endif