DBG: updated jansson headers

This commit is contained in:
Mr. eXoDia 2014-06-19 00:44:24 +02:00
parent b4df671222
commit 289f11db05
3 changed files with 39 additions and 0 deletions

View File

@ -54,6 +54,8 @@ typedef struct json_t
size_t refcount;
} json_t;
typedef json_t* JSON;
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
#if JSON_INTEGER_IS_LONG_LONG
#ifdef _WIN32
@ -90,6 +92,17 @@ __declspec(dllimport) json_t* json_stringn(const char *value, size_t len);
__declspec(dllimport) json_t* json_string_nocheck(const char *value);
__declspec(dllimport) json_t* json_stringn_nocheck(const char *value, size_t len);
__declspec(dllimport) json_t* json_integer(json_int_t value);
static JSON_INLINE
json_t *json_hex(json_int_t value)
{
char hexvalue[20];
#ifdef _WIN64
sprintf(hexvalue, "0x%llX", value);
#else //x64
sprintf(hexvalue, "0x%X", value);
#endif //_WIN64
return json_string(hexvalue);
}
__declspec(dllimport) json_t* json_real(double value);
__declspec(dllimport) json_t* json_true(void);
__declspec(dllimport) json_t* json_false(void);
@ -208,6 +221,21 @@ int json_array_insert(json_t *array, size_t ind, json_t *value)
__declspec(dllimport) const char* json_string_value(const json_t *string);
__declspec(dllimport) size_t json_string_length(const json_t *string);
__declspec(dllimport) json_int_t json_integer_value(const json_t *integer);
static JSON_INLINE
json_int_t json_hex_value(const json_t* hex)
{
json_int_t ret;
const char* hexvalue;
hexvalue=json_string_value(hex);
if(!hexvalue)
return 0;
#ifdef _WIN64
sscanf(hexvalue, "0x%llX", &ret);
#else //x64
sscanf(hexvalue, "0x%X", &ret);
#endif //_WIN64
return ret;
}
__declspec(dllimport) double json_real_value(const json_t *real);
__declspec(dllimport) double json_number_value(const json_t *json);

View File

@ -57,6 +57,8 @@
<ClInclude Include="disasm_fast.h" />
<ClInclude Include="disasm_helper.h" />
<ClInclude Include="instruction.h" />
<ClInclude Include="jansson\jansson.h" />
<ClInclude Include="jansson\jansson_config.h" />
<ClInclude Include="math.h" />
<ClInclude Include="memory.h" />
<ClInclude Include="msgqueue.h" />

View File

@ -28,6 +28,9 @@
<Filter Include="Header Files\DeviceNameResolver">
<UniqueIdentifier>{f4eb1487-15d6-4836-9d20-339d0f18c31f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\jansson">
<UniqueIdentifier>{b63305e2-2b10-46eb-839f-5e9080fa8ad8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="_exports.cpp">
@ -224,5 +227,11 @@
<ClInclude Include="DeviceNameResolver\DeviceNameResolver.h">
<Filter>Header Files\DeviceNameResolver</Filter>
</ClInclude>
<ClInclude Include="jansson\jansson.h">
<Filter>Header Files\jansson</Filter>
</ClInclude>
<ClInclude Include="jansson\jansson_config.h">
<Filter>Header Files\jansson</Filter>
</ClInclude>
</ItemGroup>
</Project>