2017-11-15 11:32 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/hbjson.h
  * src/rtl/hbjson.c
    * changed 3-rd parameter 'HB_BOOL fHuman' in hb_jsonEncode() and
      hb_jsonEncodeCP() C functions to 'int iIndent'
         char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen,
                               int iIndent );
         char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen,
                                 int iIndent, PHB_CODEPAGE cdp );
      Positive iIndent value defines number of spaces used for indenting,
      0 disables indenting and  -1 means TAB ( ASCII:9 ) indenting.
      This modification is binary compatible though in C code using HB_TRUE
      as 3-rd parameter it changes indenting from 2 spaces to 1 so please
      update the code if it's significant.

    + added optional support for numeric value in 2-nd parameter of
      hb_jsonEncode() PRG function. Current syntax is:
         hb_jsonEncode( <xValue>, [ <lHuman> | <nIndent> ], [ <cDestCP> ] )
               -> <cJSONString>

  * contrib/rddads/ads1.c
    * minor simplification

  * include/hbapigt.h
    * formatting
This commit is contained in:
Przemysław Czerpak
2017-11-15 11:32:19 +01:00
parent e7b53af398
commit bf91e4c243
5 changed files with 63 additions and 37 deletions

View File

@@ -337,7 +337,7 @@ extern HB_EXPORT int hb_inkeyKeyVal( int iKey ); /* extract key/chara
#define HB_INKEY_NEW_MPOS( x, y ) ( ( ( ( y ) & HB_INKEY_EXT_POSMASK ) << HB_INKEY_EXT_POSBITS ) | \
( ( x ) & HB_INKEY_EXT_POSMASK ) | \
( HB_INKEY_EXT_BIT | HB_INKEY_EXT_MOUSEPOS ) )
#define HB_INKEY_NEW_EVENT( e ) ( ( e ) | ( HB_INKEY_EXT_BIT | HB_INKEY_EXT_EVENT ) )
#define HB_INKEY_NEW_EVENT( e ) ( ( e ) | ( HB_INKEY_EXT_BIT | HB_INKEY_EXT_EVENT ) )
#define HB_INKEY_MOUSEPOSX( n ) ( ( n ) & HB_INKEY_EXT_POSMASK )
#define HB_INKEY_MOUSEPOSY( n ) ( ( ( n ) >> HB_INKEY_EXT_POSBITS ) & HB_INKEY_EXT_POSMASK )

View File

@@ -52,8 +52,8 @@
HB_EXTERN_BEGIN
extern HB_EXPORT char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen, HB_BOOL fHuman );
extern HB_EXPORT char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen, HB_BOOL fHuman, PHB_CODEPAGE cdp );
extern HB_EXPORT char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen, int iIndent );
extern HB_EXPORT char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen, int iIndent, PHB_CODEPAGE cdp );
extern HB_EXPORT HB_SIZE hb_jsonDecode( const char * szSource, PHB_ITEM pValue );
extern HB_EXPORT HB_SIZE hb_jsonDecodeCP( const char * szSource, PHB_ITEM pValue, PHB_CODEPAGE cdp );