' PBXA64/PBXB64 JSONPath-style constants and optional runtime declarations.
#IF NOT %DEF(PBX_JSON_PATH_PBI)
#DEFINE PBX_JSON_PATH_PBI
#INCLUDE ONCE "Legacy/System/json_core.inc"

%EQUATE `PBX_JSONPATH_DIALECT_SIMPLE = 0
%EQUATE `PBX_JSONPATH_DIALECT_RFC9535 = 1
%EQUATE `PBX_JSONPATH_FLAG_CREATE_MISSING = &H00000001
%EQUATE `PBX_JSONPATH_FLAG_CASE_INSENSITIVE = &H00000002
%EQUATE `PBX_JSONPATH_FLAG_RETURN_FIRST = &H00000004
%EQUATE `PBX_JSONPATH_FLAG_REQUIRE_SINGLE = &H00000008
%EQUATE `PBX_JSONPATH_TOKEN_ROOT = 1
%EQUATE `PBX_JSONPATH_TOKEN_DOT_NAME = 2
%EQUATE `PBX_JSONPATH_TOKEN_BRACKET_NAME = 3
%EQUATE `PBX_JSONPATH_TOKEN_INDEX = 4
%EQUATE `PBX_JSONPATH_TOKEN_WILDCARD = 5
%EQUATE `PBX_JSONPATH_TOKEN_RECURSIVE = 6
%EQUATE `PBX_JSONPATH_TOKEN_FILTER = 7

DECLARE FUNCTION PBXJsonPath_CompileUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonPath_CompileUtf8" (BYVAL pPath AS QUAD, BYVAL cbPath AS QUAD, BYVAL flags AS DWORD, BYVAL phPath AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonPath_Free LIB "pbxjson64.dll" ALIAS "PBXJsonPath_Free" (BYVAL hPath AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonPath_Eval LIB "pbxjson64.dll" ALIAS "PBXJsonPath_Eval" (BYVAL hDoc AS QUAD, BYVAL hPath AS QUAD, BYVAL flags AS DWORD, BYVAL phResult AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonPath_EvalUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonPath_EvalUtf8" (BYVAL hDoc AS QUAD, BYVAL pPath AS QUAD, BYVAL cbPath AS QUAD, BYVAL flags AS DWORD, BYVAL phResult AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonPath_ResultCount LIB "pbxjson64.dll" ALIAS "PBXJsonPath_ResultCount" (BYVAL hResult AS QUAD) AS QUAD
DECLARE FUNCTION PBXJsonPath_ResultNode LIB "pbxjson64.dll" ALIAS "PBXJsonPath_ResultNode" (BYVAL hResult AS QUAD, BYVAL index AS QUAD) AS QUAD
DECLARE FUNCTION PBXJsonPath_ResultFree LIB "pbxjson64.dll" ALIAS "PBXJsonPath_ResultFree" (BYVAL hResult AS QUAD) AS LONG
DECLARE FUNCTION PBXJsonPath_SetUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonPath_SetUtf8" (BYVAL hDoc AS QUAD, BYVAL pPath AS QUAD, BYVAL cbPath AS QUAD, BYVAL hValue AS QUAD, BYVAL flags AS DWORD) AS LONG
DECLARE FUNCTION PBXJsonPath_DeleteUtf8 LIB "pbxjson64.dll" ALIAS "PBXJsonPath_DeleteUtf8" (BYVAL hDoc AS QUAD, BYVAL pPath AS QUAD, BYVAL cbPath AS QUAD, BYVAL flags AS DWORD) AS LONG

#ENDIF
