Changeset 4643 for pjproject


Ignore:
Timestamp:
Nov 6, 2013 7:46:15 AM (10 years ago)
Author:
bennylp
Message:

Re #1519: Added support for JSON (JavaScript? Object Notation, RFC 4627) format in PJLIB-UTIL.

Location:
pjproject/branches/projects/pjsua2/pjlib-util
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjlib-util/build/Makefile

    r4440 r4643  
    3131                base64.o cli.o cli_console.o cli_telnet.o crc32.o errno.o dns.o \ 
    3232                dns_dump.o dns_server.o getopt.o hmac_md5.o hmac_sha1.o \ 
    33                 http_client.o md5.o pcap.o resolver.o scanner.o sha1.o \ 
     33                http_client.o json.o md5.o pcap.o resolver.o scanner.o sha1.o \ 
    3434                srv_resolver.o string.o stun_simple.o \ 
    3535                stun_simple_client.o xml.o 
     
    4141export UTIL_TEST_SRCDIR = ../src/pjlib-util-test 
    4242export UTIL_TEST_OBJS += xml.o encryption.o stun.o resolver_test.o test.o \ 
    43                 http_client.o 
     43                json_test.o http_client.o 
    4444export UTIL_TEST_CFLAGS += $(_CFLAGS) 
    4545export UTIL_TEST_LDFLAGS += $(_LDFLAGS) 
  • pjproject/branches/projects/pjsua2/pjlib-util/include/pjlib-util.h

    r4476 r4643  
    5555#include <pjlib-util/xml.h> 
    5656 
     57/* JSON */ 
     58#include <pjlib-util/json.h> 
     59 
    5760/* Old STUN */ 
    5861#include <pjlib-util/stun_simple.h> 
  • pjproject/branches/projects/pjsua2/pjlib-util/include/pjlib-util/errno.h

    r4440 r4643  
    118118 
    119119 
     120/************************************************************ 
     121 * JSON ERROR 
     122 ***********************************************************/ 
     123/** 
     124 * @hideinitializer 
     125 * General invalid JSON message. 
     126 */ 
     127#define PJLIB_UTIL_EINJSON          (PJLIB_UTIL_ERRNO_START+30) /* 320030 */ 
     128 
    120129 
    121130/************************************************************ 
  • pjproject/branches/projects/pjsua2/pjlib-util/src/pjlib-util-test/test.c

    r3553 r4643  
    7373#endif 
    7474 
     75#if INCLUDE_JSON_TEST 
     76    DO_TEST(json_test()); 
     77#endif 
     78 
    7579#if INCLUDE_ENCRYPTION_TEST 
    7680    DO_TEST(encryption_test()); 
  • pjproject/branches/projects/pjsua2/pjlib-util/src/pjlib-util-test/test.h

    r3553 r4643  
    2121 
    2222#define INCLUDE_XML_TEST            1 
     23#define INCLUDE_JSON_TEST           1 
    2324#define INCLUDE_ENCRYPTION_TEST     1 
    2425#define INCLUDE_STUN_TEST           1 
     
    2728 
    2829extern int xml_test(void); 
     30extern int json_test(void); 
    2931extern int encryption_test(); 
    3032extern int encryption_benchmark(); 
  • pjproject/branches/projects/pjsua2/pjlib-util/src/pjlib-util/errno.c

    r4440 r4643  
    5151    /* XML errors */ 
    5252    PJ_BUILD_ERR( PJLIB_UTIL_EINXML,            "Invalid XML message" ), 
     53 
     54    /* JSON errors */ 
     55    PJ_BUILD_ERR( PJLIB_UTIL_EINJSON,           "Invalid JSON document" ), 
    5356 
    5457    /* DNS errors */ 
Note: See TracChangeset for help on using the changeset viewer.