compile insert rti_CJSON_Equates
/*
   ** Copyright (C) 1992-2023 Revelation Software Inc. All Rights Reserved **
   
   This  program  is  proprietary and is not  to be used  by or  disclosed
   to others, nor is it to be copied without written permission from
   Revelation Technologies, Inc.
   
   Author   : RJC/Captain C
   Date     : September 2016
   Purpose  : Constants for use with the RevJSON DLL functions

   
   Comments
   ========
   
   The "safe" way of using RevJSON is to use the rti_CJSON function
   with the methods detailed below.
   
   There is a "raw" API however that exposes the internal cJSON functions that
   have not, by default, been prototyped - only prototype what you need to 
   avoid DLL stub proliferation.
   
   The prototypes are defined below if you wish to add them to the DLLPROTOTYPE
   entity at some point in the future (DLL_RTI_REVJSON)
   
   
   Amended  Date        Reason
   =======  ====        ======
   Mr C     09 Mar 23   Added RJSON Error codes
   Mr C     20 Apr 17   Added REVJSON_GETITEMVALUE$ method
*/
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifndef _RTI_CJSON_EQUATES_
#define _RTI_CJSON_EQUATES_
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   declare function rti_CJSON
   
   // rti_CJSON method constants
   
   equ REVJSON_PARSE$                     to 1;  // cJSON_Parse
   equ REVJSON_PRINT$                     to 2;  // cJSON_Print
   equ REVJSON_PRINTUNFORMATTED$          to 3;  // cJSON_PrintUnformatted
   equ REVJSON_PRINTBUFFERED$             to 4;  // cJSON_PrintBuffered
   equ REVJSON_DELETE$                    to 5;  // cJSON_Delete
   equ REVJSON_GETARRAYSIZE$              to 6;  // cJSON_GetArraySize
   equ REVJSON_GETARRAYITEM$              to 7;  // cJSON_GetArrayItem
   equ REVJSON_GETOBJECTITEM$             to 8;  // cJSON_GetObjectItem
   equ REVJSON_HASOBJECTITEM$             to 9;  // cJSON_HasObjectItem
   equ REVJSON_GETERRORPTR$               to 10; // cJSON_GetErrorPtr
   equ REVJSON_CREATENULL$                to 11; // cJSON_CreateNull
   equ REVJSON_CREATETRUE$                to 12; // cJSON_CreateTrue
   equ REVJSON_CREATEFALSE$               to 13; // cJSON_CreateFalse
   equ REVJSON_CREATEBOOL$                to 14; // cJSON_CreateBool
   equ REVJSON_CREATENUMBER$              to 15; // cJSON_CreateNumber
   equ REVJSON_CREATESTRING$              to 16; // cJSON_CreateString
   equ REVJSON_CREATEARRAY$               to 17; // cJSON_CreateArray
   equ REVJSON_CREATEOBJECT$              to 18; // cJSON_CreateObject
   equ REVJSON_CREATEINTARRAY$            to 19; // cJSON_CreateIntArray
   equ REVJSON_CREATEFLOATARRAY$          to 20; // cJSON_CreateFloatArray
   equ REVJSON_CREATEDOUBLEARRAY$         to 21; // cJSON_CreateDoubleArray
   equ REVJSON_CREATESTRINGARRAY$         to 22; // cJSON_CreateStringArray
   equ REVJSON_ADDITEMTOARRAY$            to 23; // cJSON_AddItemToArray
   equ REVJSON_ADDITEMTOOBJECT$           to 24; // cJSON_AddItemToObject
   equ REVJSON_ADDITEMTOOBJECTS$          to 25; // cJSON_AddItemToObjects
   equ REVJSON_ADDITEMREFERENCETOARRAY$   to 26; // cJSON_AddItemReferenceToArray
   equ REVJSON_ADDITEMREFERENCETOOBJECT$  to 27; // cJSON_AddItemReferenceToObject
   equ REVJSON_DETACHITEMFROMARRAY$       to 28; // cJSON_DetachItemFromArray
   equ REVJSON_DELETEITEMFROMARRAY$       to 29; // cJSON_DeleteItemFromArray
   equ REVJSON_DETACHITEMFROMOBJECT$      to 30; // cJSON_DetachItemFromObject
   equ REVJSON_DELETEITEMFROMOBJECT$      to 31; // cJSON_DeleteItemFromObject
   equ REVJSON_INSERTITEMINARRAY$         to 32; // cJSON_InsertItemInArray
   equ REVJSON_REPLACEITEMINARRAY$        to 33; // cJSON_ReplaceItemInArray
   equ REVJSON_REPLACEITEMINOBJECT$       to 34; // cJSON_ReplaceItemInObject
   equ REVJSON_DUPLICATE$                 to 35; // cJSON_Duplicate
   equ REVJSON_PARSEWITHOPTS$             to 36; // cJSON_ParseWithOpts *** NOT IMPLEMENTED ***
   equ REVJSON_MINIFY$                    to 37; // cJSON_Minify
   equ REVJSON_FREE$                      to 38; // cJSON_Free
   equ REVJSON_GETITEMNEXT$               to 39;
   equ REVJSON_GETITEMCHILD$              to 40;
   equ REVJSON_GETITEMTYPE$               to 41;
   equ REVJSON_GETITEMNAME$               to 42;
   equ REVJSON_GETITEMVALUE$              to 43; // cJSON_GetObjectItem or cJSON_GetArrayItem + cJSON_Print
   
   equ REVJSON_GETVALUE$                  to REVJSON_GETITEMVALUE$ ; // synonym
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
   
   // RevJSON type IDs
   
   equ REVJSON_T_FALSE$                    to 0
   equ REVJSON_T_TRUE$                     to 1
   equ REVJSON_T_NULL$                     to 2
   equ REVJSON_T_NUMBER$                   to 8
   equ REVJSON_T_STRING$                   to 16
   equ REVJSON_T_ARRAY$                    to 32
   equ REVJSON_T_OBJECT$                   to 64
      
   equ REVJSON_T_ISREFERENCE$              to 256
   equ REVJSON_T_STRINGISCONST$            to 512
   
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

   equ REVJSON_SUCCESS$                       to 0;
   equ REVJSON_ERR_NULL_JSON$                 to -1;
   equ REVJSON_ERR_NULL_RETBUFFER$            to -2;
   equ REVJSON_ERR_NULL_VALUE$                to -3;
   equ REVJSON_ERR_NULL_RETJSON$              to -4;
   equ REVJSON_ERR_PARSE$                     to -5;
   equ REVJSON_ERR_NULL_RETINT$               to -6;
   equ REVJSON_ERR_NULL_NAME$                 to -7;
   equ REVJSON_ERR_NULL_PARSEEND$             to -8;
   
   equ REVJSON_ERR_CREATE_DOC$                to -9;
   equ REVJSON_ERR_INVALID_TYPE$              to -10;
   equ REVJSON_ERR_BAD_MEMBER_NAME$           to -11; // Bad element name
   equ REVJSON_ERR_BAD_ARRAY_SYNTAX$          to -12; // Invalid path - array syntax
   equ REVJSON_ERR_BAD_ARRAY_INDEX$           to -13; // Invalid path - array out of bounds
   equ REVJSON_ERR_NO_ARRAY_INDEX$            to -14; // Invalid path - No index
   equ REVJSON_ERR_INVALID_JSON$              to -15; // Invalid handle
   equ REVJSON_ERR_USE_RETBUFFER$             to -16;
   equ REVJSON_ERR_BUFFER_TOO_SMALL$          to -17;
   equ REVJSON_ERR_BAD_BUFFER_SIZE$           to -18;
   
   equ REVJSON_ERR_STDEXCEPTION$              to -99;

   equ REVJSON_MAX_ERROR_LEN$                 to 2048; // LPSTR pErrorText length
                                                       // including null terminator
                                                       
///////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// 
/*
   "Raw" API prototypes - only add these to DLL_RTI_REVJSON if you really need 
   them and you know what you're doing. 
   
   LPVOID  STDCALL JSON_Parse( LPSTR )                                     as rti_RevJSON_Parse
   LPVOID  STDCALL JSON_Print( LPVOID )                                    as rti_RevJSON_Print
   LPVOID  STDCALL JSON_PrintUnformatted( LPVOID )                         as rti_RevJSON_PrintUnformatted
   LPVOID  STDCALL JSON_PrintBuffered( LPVOID, INT, INT )                  as rti_RevJSON_PrintBuffered
   VOID    STDCALL JSON_Delete( LPVOID )                                   as rti_RevJSON_Delete
   INT     STDCALL JSON_GetArraySize( LPVOID )                             as rti_RevJSON_GetArraySize
   LPVOID  STDCALL JSON_GetArrayItem( LPVOID, INT )                        as rti_RevJSON_GetArrayItem
   LPVOID  STDCALL JSON_GetObjectItem( LPVOID, LPSTR )                     as rti_RevJSON_GetObjectItem
   INT     STDCALL JSON_HasObjectItem( LPVOID, LPSTR )                     as rti_RevJSON_HasObjectItem
   LPSTR   STDCALL JSON_GetErrorPtr( VOID )                                as rti_RevJSON_GetErrorPtr
   LPVOID  STDCALL JSON_CreateNull( VOID )                                 as rti_RevJSON_CreateNull
   LPVOID  STDCALL JSON_CreateTrue( VOID )                                 as rti_RevJSON_CreateTrue
   LPVOID  STDCALL JSON_CreateFalse( VOID )                                as rti_RevJSON_CreateFalse
   LPVOID  STDCALL JSON_CreateBool( INT )                                  as rti_RevJSON_CreateBool
   LPVOID  STDCALL JSON_CreateNumber( DOUBLE )                             as rti_RevJSON_CreateNumber
   LPVOID  STDCALL JSON_CreateString( LPSTR )                              as rti_RevJSON_CreateString
   LPVOID  STDCALL JSON_CreateArray( VOID )                                as rti_RevJSON_CreateArray
   LPVOID  STDCALL JSON_CreateObject( VOID )                               as rti_RevJSON_CreateObject
   LPVOID  STDCALL JSON_CreateIntArray( LPVOID, INT )                      as rti_RevJSON_CreateIntArray
   LPVOID  STDCALL JSON_CreateFloatArray( LPVOID, INT )                    as rti_RevJSON_CreateFloatArray
   LPVOID  STDCALL JSON_CreateDoubleArray( LPVOID, INT )                   as rti_RevJSON_CreateDoubleArray
   LPVOID  STDCALL JSON_CreateStringArray( LPVOID, INT )                   as rti_RevJSON_CreateStringArray
   VOID    STDCALL JSON_AddItemToArray( LPVOID, LPVOID )                   as rti_RevJSON_AddItemToArray
   VOID    STDCALL JSON_AddItemToObject( LPVOID, LPSTR, LPVOID )           as rti_RevJSON_AddItemToObject
   VOID    STDCALL JSON_AddItemToObjectCS( LPVOID, LPSTR, LPVOID )         as rti_RevJSON_AddItemToObjectCS
   VOID    STDCALL JSON_AddItemReferenceToArray( LPVOID, LPVOID )          as rti_RevJSON_AddItemReferenceToArray
   VOID    STDCALL JSON_AddItemReferenceToObject( LPVOID, LPSTR, LPVOID )  as rti_RevJSON_AddItemReferenceToObject
   LPVOID  STDCALL JSON_DetachItemFromArray( LPVOID, INT )                 as rti_RevJSON_DetachItemFromArray
   VOID    STDCALL JSON_DeleteItemFromArray( LPVOID, INT )                 as rti_RevJSON_DeleteItemFromArray
   LPVOID  STDCALL JSON_DetachItemFromObject( LPVOID, LPSTR )              as rti_RevJSON_DetachItemFromObject
   VOID    STDCALL JSON_DeleteItemFromObject( LPVOID, LPSTR )              as rti_RevJSON_DeleteItemFromObject
   VOID    STDCALL JSON_InsertItemInArray( LPVOID, INT, LPVOID )           as rti_RevJSON_InsertItemInArray
   VOID    STDCALL JSON_ReplaceItemInArray( LPVOID, INT, LPVOID )          as rti_RevJSON_ReplaceItemInArray
   VOID    STDCALL JSON_ReplaceItemInObject( LPVOID, LPSTR, LPVOID )       as rti_RevJSON_ReplaceItemInObject
   LPVOID  STDCALL JSON_Duplicate( LPVOID, INT )                           as rti_RevJSON_Duplicate
   LPVOID  STDCALL JSON_ParseWithOpts( LPSTR, LPVOID, INT )                as rti_RevJSON_ParseWithOpts
   VOID    STDCALL JSON_Minify( LPSTR )                                    as rti_RevJSON_Minify
   VOID    STDCALL JSON_Free( LPVOID )                                     as rti_RevJSON_Free
   LPVOID  STDCALL JSON_GetNextItem( LPVOID )                              as rti_RevJSON_GetNextItem
   LPVOID  STDCALL JSON_GetChildItem( LPVOID )                             as rti_RevJSON_GetChildItem
   int     STDCALL JSON_GetItemType( LPVOID )                              as rti_RevJSON_GetItemType
   LPSTR   STDCALL JSON_GetItemName( LPVOID )                              as rti_RevJSON_GetItemName
*/                                                     
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////                                                      
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////                                                      

