@@ -16,15 +16,15 @@ char *j0g(const char *json, unsigned short *index, int ilen)
1616}
1717
1818// return the null-terminated string value matching the given key
19- char * j0g_str (char * key , char * json , unsigned short * index )
19+ char * j0g_str (const char * key , char * json , const unsigned short * index )
2020{
2121 int val = j0g_val (key , json , index );
2222 if (!val ) return NULL ;
2323 return j0g_safe (val , json , index );
2424}
2525
2626// null terminate and unescape any string at this value
27- char * j0g_safe (int val , char * json , unsigned short * index )
27+ char * j0g_safe (int val , char * json , const unsigned short * index )
2828{
2929 char * str , * cursor ;
3030 * (json + (index [val ]+ index [val + 1 ])) = 0 ; // null terminate
@@ -47,7 +47,7 @@ char *j0g_safe(int val, char *json, unsigned short *index)
4747}
4848
4949// return 1 if the value is the bool value true, number 1, or even the string "true", false otherwise
50- int j0g_test (char * key , char * json , unsigned short * index )
50+ int j0g_test (const char * key , char * json , const unsigned short * index )
5151{
5252 char * val = j0g_str (key , json , index );
5353 if (!val ) return 0 ;
@@ -57,7 +57,7 @@ int j0g_test(char *key, char *json, unsigned short *index)
5757}
5858
5959// return the index offset of the value matching the given key
60- int j0g_val (char * key , char * json , unsigned short * index )
60+ int j0g_val (const char * key , char * json , const unsigned short * index )
6161{
6262 if (!key || !json ) return 0 ;
6363 int i , klen = strlen (key );
0 commit comments