' PBXB64 streaming JSON writer declarations for optional PBXJSON64 runtime/helper DLL.
#IF NOT %DEF(PBX_JSON_WRITER_PBI)
#DEFINE PBX_JSON_WRITER_PBI
#include once "json_core.inc"

CONST PBX_JSON_WRITER_TARGET_MEMORY = 1
CONST PBX_JSON_WRITER_TARGET_FILE = 2
CONST PBX_JSON_WRITER_STATE_ROOT = 0
CONST PBX_JSON_WRITER_STATE_OBJECT = 1
CONST PBX_JSON_WRITER_STATE_ARRAY = 2

DECLARE FUNCTION PBXJsonWriter_CreateMemory LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_CreateMemory" (BYVAL flags AS DWORD, BYVAL phWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_CreateFileUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_CreateFileUtf8" (BYVAL pFileName AS ASCIIZ PTR, BYVAL flags AS DWORD, BYVAL phWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_Free LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Free" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_Reset LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Reset" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_BeginObject LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_BeginObject" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_EndObject LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_EndObject" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_BeginArray LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_BeginArray" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_EndArray LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_EndArray" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_NameUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_NameUtf8" (BYVAL hWriter AS QUAD, BYVAL pName AS QUAD, BYVAL cbName AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_StringUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_StringUtf8" (BYVAL hWriter AS QUAD, BYVAL pText AS QUAD, BYVAL cbText AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_Int64 LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Int64" (BYVAL hWriter AS QUAD, BYVAL value AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_Double LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Double" (BYVAL hWriter AS QUAD, BYVAL value AS DOUBLE) AS LONG
DECLARE FUNCTION PBXJsonWriter_Bool LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Bool" (BYVAL hWriter AS QUAD, BYVAL value AS LONG) AS LONG
DECLARE FUNCTION PBXJsonWriter_Null LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_Null" (BYVAL hWriter AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_RawUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_RawUtf8" (BYVAL hWriter AS QUAD, BYVAL pRaw AS QUAD, BYVAL cbRaw AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonWriter_GetBuffer LIB "pbxjson64.dll" ALIAS "PBXJsonWriter_GetBuffer" (BYVAL hWriter AS QUAD, BYVAL ppBuffer AS QUAD, BYVAL pcbBuffer AS QUAD) AS LONG
DECLARE FUNCTION PBXJson_ToUtf8 LIB "pbxjson64.dll" ALIAS "PBXJson_ToUtf8" (BYVAL hDoc AS QUAD, BYVAL flags AS DWORD, BYVAL ppBuffer AS QUAD, BYVAL pcbBuffer AS QUAD) AS LONG
DECLARE FUNCTION PBXJson_FreeBuffer LIB "pbxjson64.dll" ALIAS "PBXJson_FreeBuffer" (BYVAL pBuffer AS QUAD) AS LONG

#ENDIF
