c json解析示例

json-c是最主流的json c库。[root@hs-10-20-30-193 build]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..

-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Wrote /home/zjh/json-c-json-c-0.16-20220414/build/apps_config.h
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for syslog.h
-- Looking for syslog.h - found
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for endian.h
-- Looking for endian.h - found
-- Looking for limits.h
-- Looking for limits.h - found
-- Looking for locale.h
-- Looking for locale.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for sys/cdefs.h
-- Looking for sys/cdefs.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/random.h
-- Looking for sys/random.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for xlocale.h
-- Looking for xlocale.h - found
-- Looking for _isnan
-- Looking for _isnan - not found
-- Looking for _finite
-- Looking for _finite - not found
-- Looking for INFINITY
-- Looking for INFINITY - found
-- Looking for isinf
-- Looking for isinf - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for nan
-- Looking for nan - found
-- Looking for _doprnt
-- Looking for _doprnt - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for vprintf
-- Looking for vprintf - found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for bsd/stdlib.h
-- Looking for bsd/stdlib.h - not found
-- Looking for open
-- Looking for open - found
-- Looking for realloc
-- Looking for realloc - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for uselocale
-- Looking for uselocale - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for vsyslog
-- Looking for vsyslog - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Performing Test HAS_GNU_WARNING_LONG
-- Performing Test HAS_GNU_WARNING_LONG - Failed
-- Performing Test HAVE_ATOMIC_BUILTINS
-- Performing Test HAVE_ATOMIC_BUILTINS - Success
-- Performing Test HAVE___THREAD
-- Performing Test HAVE___THREAD - Success
-- Wrote /home/zjh/json-c-json-c-0.16-20220414/build/config.h
-- Wrote /home/zjh/json-c-json-c-0.16-20220414/build/json_config.h
-- Performing Test REENTRANT_WORKS
-- Performing Test REENTRANT_WORKS - Success
-- Performing Test BSYMBOLIC_WORKS
-- Performing Test BSYMBOLIC_WORKS - Success
-- Performing Test VERSION_SCRIPT_WORKS
-- Performing Test VERSION_SCRIPT_WORKS - Success
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Warning: doxygen not found, the 'doc' target will not be included
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zjh/json-c-json-c-0.16-20220414/build
[root@hs-10-20-30-193 build]# make all install
Scanning dependencies of target json-c
[  1%] Building C object CMakeFiles/json-c.dir/arraylist.c.o
[  2%] Building C object CMakeFiles/json-c.dir/debug.c.o
[  3%] Building C object CMakeFiles/json-c.dir/json_c_version.c.o
[  4%] Building C object CMakeFiles/json-c.dir/json_object.c.o
[  5%] Building C object CMakeFiles/json-c.dir/json_object_iterator.c.o
[  7%] Building C object CMakeFiles/json-c.dir/json_tokener.c.o
[  8%] Building C object CMakeFiles/json-c.dir/json_util.c.o
[  9%] Building C object CMakeFiles/json-c.dir/json_visit.c.o
[ 10%] Building C object CMakeFiles/json-c.dir/linkhash.c.o
[ 11%] Building C object CMakeFiles/json-c.dir/printbuf.c.o
[ 13%] Building C object CMakeFiles/json-c.dir/random_seed.c.o
[ 14%] Building C object CMakeFiles/json-c.dir/strerror_override.c.o
[ 15%] Building C object CMakeFiles/json-c.dir/json_pointer.c.o
[ 16%] Linking C shared library libjson-c.so
[ 16%] Built target json-c
Scanning dependencies of target json-c-static
[ 17%] Building C object CMakeFiles/json-c-static.dir/arraylist.c.o
[ 19%] Building C object CMakeFiles/json-c-static.dir/debug.c.o
[ 20%] Building C object CMakeFiles/json-c-static.dir/json_c_version.c.o
[ 21%] Building C object CMakeFiles/json-c-static.dir/json_object.c.o
[ 22%] Building C object CMakeFiles/json-c-static.dir/json_object_iterator.c.o
[ 23%] Building C object CMakeFiles/json-c-static.dir/json_tokener.c.o
[ 25%] Building C object CMakeFiles/json-c-static.dir/json_util.c.o
[ 26%] Building C object CMakeFiles/json-c-static.dir/json_visit.c.o
[ 27%] Building C object CMakeFiles/json-c-static.dir/linkhash.c.o
[ 28%] Building C object CMakeFiles/json-c-static.dir/printbuf.c.o
[ 29%] Building C object CMakeFiles/json-c-static.dir/random_seed.c.o
[ 30%] Building C object CMakeFiles/json-c-static.dir/strerror_override.c.o
[ 32%] Building C object CMakeFiles/json-c-static.dir/json_pointer.c.o
[ 33%] Linking C static library libjson-c.a
[ 33%] Built target json-c-static
Scanning dependencies of target test_json_pointer
[ 34%] Building C object tests/CMakeFiles/test_json_pointer.dir/test_json_pointer.c.o
[ 35%] Linking C executable test_json_pointer
[ 35%] Built target test_json_pointer
Scanning dependencies of target test_visit
[ 36%] Building C object tests/CMakeFiles/test_visit.dir/test_visit.c.o
[ 38%] Linking C executable test_visit
[ 38%] Built target test_visit
Scanning dependencies of target test_cast
[ 39%] Building C object tests/CMakeFiles/test_cast.dir/test_cast.c.o
[ 40%] Linking C executable test_cast
[ 40%] Built target test_cast
Scanning dependencies of target testReplaceExisting
[ 41%] Building C object tests/CMakeFiles/testReplaceExisting.dir/testReplaceExisting.c.o
[ 42%] Linking C executable testReplaceExisting
[ 42%] Built target testReplaceExisting
Scanning dependencies of target test4
[ 44%] Building C object tests/CMakeFiles/test4.dir/test4.c.o
[ 45%] Linking C executable test4
[ 45%] Built target test4
Scanning dependencies of target test_int_add
[ 46%] Building C object tests/CMakeFiles/test_int_add.dir/test_int_add.c.o
[ 47%] Linking C executable test_int_add
[ 47%] Built target test_int_add
Scanning dependencies of target test_compare
[ 48%] Building C object tests/CMakeFiles/test_compare.dir/test_compare.c.o
[ 50%] Linking C executable test_compare
[ 50%] Built target test_compare
Scanning dependencies of target test1
[ 51%] Building C object tests/CMakeFiles/test1.dir/test1.c.o
[ 52%] Linking C executable test1
[ 52%] Built target test1
Scanning dependencies of target test_deep_copy
[ 53%] Building C object tests/CMakeFiles/test_deep_copy.dir/test_deep_copy.c.o
[ 54%] Linking C executable test_deep_copy
[ 54%] Built target test_deep_copy
Scanning dependencies of target test_parse_int64
[ 55%] Building C object tests/CMakeFiles/test_parse_int64.dir/test_parse_int64.c.o
[ 57%] Linking C executable test_parse_int64
[ 57%] Built target test_parse_int64
Scanning dependencies of target test2Formatted
[ 58%] Building C object tests/CMakeFiles/test2Formatted.dir/test2.c.o
[ 59%] Building C object tests/CMakeFiles/test2Formatted.dir/parse_flags.c.o
[ 60%] Linking C executable test2Formatted
[ 60%] Built target test2Formatted
Scanning dependencies of target test_util_file
[ 61%] Building C object tests/CMakeFiles/test_util_file.dir/test_util_file.c.o
[ 63%] Building C object tests/CMakeFiles/test_util_file.dir/__/strerror_override.c.o
[ 64%] Linking C executable test_util_file
[ 64%] Built target test_util_file
Scanning dependencies of target test2
[ 65%] Building C object tests/CMakeFiles/test2.dir/test2.c.o
[ 66%] Linking C executable test2
[ 66%] Built target test2
Scanning dependencies of target test_locale
[ 67%] Building C object tests/CMakeFiles/test_locale.dir/test_locale.c.o
[ 69%] Linking C executable test_locale
[ 69%] Built target test_locale
Scanning dependencies of target test_printbuf
[ 70%] Building C object tests/CMakeFiles/test_printbuf.dir/test_printbuf.c.o
[ 71%] Linking C executable test_printbuf
[ 71%] Built target test_printbuf
Scanning dependencies of target test1Formatted
[ 72%] Building C object tests/CMakeFiles/test1Formatted.dir/test1.c.o
[ 73%] Building C object tests/CMakeFiles/test1Formatted.dir/parse_flags.c.o
[ 75%] Linking C executable test1Formatted
[ 75%] Built target test1Formatted
Scanning dependencies of target test_float
[ 76%] Building C object tests/CMakeFiles/test_float.dir/test_float.c.o
[ 77%] Linking C executable test_float
[ 77%] Built target test_float
Scanning dependencies of target test_object_iterator
[ 78%] Building C object tests/CMakeFiles/test_object_iterator.dir/test_object_iterator.c.o
[ 79%] Linking C executable test_object_iterator
[ 79%] Built target test_object_iterator
Scanning dependencies of target test_null
[ 80%] Building C object tests/CMakeFiles/test_null.dir/test_null.c.o
[ 82%] Linking C executable test_null
[ 82%] Built target test_null
Scanning dependencies of target test_double_serializer
[ 83%] Building C object tests/CMakeFiles/test_double_serializer.dir/test_double_serializer.c.o
[ 84%] Linking C executable test_double_serializer
[ 84%] Built target test_double_serializer
Scanning dependencies of target test_parse
[ 85%] Building C object tests/CMakeFiles/test_parse.dir/test_parse.c.o
[ 86%] Linking C executable test_parse
[ 86%] Built target test_parse
Scanning dependencies of target test_set_serializer
[ 88%] Building C object tests/CMakeFiles/test_set_serializer.dir/test_set_serializer.c.o
[ 89%] Linking C executable test_set_serializer
[ 89%] Built target test_set_serializer
Scanning dependencies of target test_set_value
[ 90%] Building C object tests/CMakeFiles/test_set_value.dir/test_set_value.c.o
[ 91%] Linking C executable test_set_value
[ 91%] Built target test_set_value
Scanning dependencies of target test_charcase
[ 92%] Building C object tests/CMakeFiles/test_charcase.dir/test_charcase.c.o
[ 94%] Linking C executable test_charcase
[ 94%] Built target test_charcase
Scanning dependencies of target test_strerror
[ 95%] Building C object tests/CMakeFiles/test_strerror.dir/test_strerror.c.o
[ 96%] Building C object tests/CMakeFiles/test_strerror.dir/__/strerror_override.c.o
[ 97%] Linking C executable test_strerror
[ 97%] Built target test_strerror
Scanning dependencies of target json_parse
[ 98%] Building C object apps/CMakeFiles/json_parse.dir/json_parse.c.o
[100%] Linking C executable json_parse
[100%] Built target json_parse
Install the project...

-- Install configuration: "debug"
-- Installing: /usr/local/lib64/libjson-c.so.5.2.0
-- Up-to-date: /usr/local/lib64/libjson-c.so.5
-- Up-to-date: /usr/local/lib64/libjson-c.so
-- Installing: /usr/local/lib64/libjson-c.a
-- Installing: /usr/local/lib64/cmake/json-c/json-c-targets.cmake
-- Installing: /usr/local/lib64/cmake/json-c/json-c-targets-debug.cmake
-- Installing: /usr/local/lib64/cmake/json-c/json-c-config.cmake
-- Installing: /usr/local/lib64/pkgconfig/json-c.pc
-- Installing: /usr/local/include/json-c/json_config.h
-- Installing: /usr/local/include/json-c/json.h
-- Installing: /usr/local/include/json-c/arraylist.h
-- Installing: /usr/local/include/json-c/debug.h
-- Installing: /usr/local/include/json-c/json_c_version.h
-- Installing: /usr/local/include/json-c/json_inttypes.h
-- Installing: /usr/local/include/json-c/json_object.h
-- Installing: /usr/local/include/json-c/json_object_iterator.h
-- Installing: /usr/local/include/json-c/json_tokener.h
-- Installing: /usr/local/include/json-c/json_types.h
-- Installing: /usr/local/include/json-c/json_util.h
-- Installing: /usr/local/include/json-c/json_visit.h
-- Installing: /usr/local/include/json-c/linkhash.h
-- Installing: /usr/local/include/json-c/printbuf.h
-- Installing: /usr/local/include/json-c/json_pointer.h

Original: https://www.cnblogs.com/zhjh256/p/16282760.html
Author: zhjh256
Title: c json解析示例

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/554496/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • python中的*和**

    简介:Python中的与*操作符使用最多的就是两种用法。 1.用做运算符,即表示乘号,*表示次方。 用于指定函数传入参数的类型的。*用于参数前面,表示传入的多个参数将按照元组的形式…

    技术杂谈 2023年7月25日
    078
  • 配置耗时太长

    配置耗时太长 配置耗时太长 配置耗时太长 配置耗时太长 配置耗时太长 Original: https://www.cnblogs.com/hshy/p/16539479.htmlA…

    技术杂谈 2023年5月31日
    068
  • ncurses库的一些函数

    为了实现一个简单的聊天程序,如果使用普通的输入输出函数,会很凌乱。so,便想着能不能用下ncurses这个字符图形库 总结一下,就是这样。 使用ncurses时,先需要初始化窗口,…

    技术杂谈 2023年6月21日
    0124
  • 周鸿祎自述-我的互联网方法论

    这本书是我的互联网思维入门书籍。 自己接触网络比较早,最早家里2000年就买了电脑了,经历了互联网蓬勃发展的时期。 老周讲的许多案例我都清楚,比如我就是那个买了瑞星杀毒正版的人。 …

    技术杂谈 2023年5月31日
    098
  • 一些代码规则

    一些关于底层的代码问题 进制换算的代码 进制(在数字前加对应字母):二进制0b十进制无八进制0十六进制0x 调试 可以进行对单一代码进行运算确认是否有bug 最好完全避免使用浮点数…

    技术杂谈 2023年6月21日
    096
  • H3C 无线交换机和FIT AP的典型连接

    posted @2019-09-23 20:56 樊伟胜 阅读(1010 ) 评论() 编辑 Original: https://www.cnblogs.com/fanweishe…

    技术杂谈 2023年5月30日
    0104
  • 面试中常见智力题

    确实,这种题旧根脑筋急转弯一样,你见过,才能立马想到,没见过,那确实有点难在现场回答出来。 桶装水 只有两个无刻度的水桶,一个可以装6L水,一个可以装5L水,如何在桶里装入3L的水…

    技术杂谈 2023年6月21日
    090
  • sqlx操作MySQL实战及其ORM原理

    sqlx是Golang中的一个知名三方库,其为Go标准库database/sql提供了一组扩展支持。使用它可以方便的在数据行与Golang的结构体、映射和切片之间进行转换,从这个角…

    技术杂谈 2023年7月11日
    082
  • Go基础2:数据结构(一)

    这是我参与「第三届青训营 -后端场」笔记创作活动的的第3篇笔记。 1.数组 数组是一段固定长度的连续内存区域。在Go语言中,数组从声明时就确定,使用时可以修改数组成员,但是数组大小…

    技术杂谈 2023年7月24日
    077
  • 20212218林思凡《Python程序设计》实验四Python综合实验实验报告

    课程:《Python程序设计》班级: 2122姓名: 林思凡学号:20212218实验教师:王志强实验日期:2022年5月27日必修/选修: 公选课 一、实验要求 Python综合…

    技术杂谈 2023年7月24日
    0101
  • 关于Chrome跨域The request client is not a secure xxx相关提示的解决

    近期Chrome浏览器 不知哪个版本升级后 原来跨域功能好用突然报been blocked by CORS policy: The request client is not a …

    技术杂谈 2023年5月31日
    081
  • 预处理

    在前面的学习中经常遇到用 #define命令定义符号常量的情况,其实使用 #define命令就是要定义一个可替换的宏。 宏定义是预处理命令的一种,它提供了一种可以替换源代码中字符串…

    技术杂谈 2023年7月11日
    058
  • 基本电路学习-1 12v转5V 电路

    本博客是个人工作中记录,遇到问题可以互相探讨,没有遇到的问题可能没有时间去特意研究,勿扰。另外建了几个QQ技术群:2、全栈技术群:616945527,加群口令abc1232、硬件嵌…

    技术杂谈 2023年6月1日
    0160
  • 关于sparksql调优的一些操作

    1、查看执行计划1、直接sql查看: explain select … from … 2、ds.explain()2、执行计划的处理流程sql代码 -&gt…

    技术杂谈 2023年7月25日
    087
  • Linux如何查看JDK的安装路径

    如何在一台Linux服务器上查找JDK的安装路径呢? 有那些方法可以查找定位JDK的安装路径?是否有一些局限性呢? 下面总结了一下如何查找JDK安装路径的方法. 1:echo $J…

    技术杂谈 2023年7月11日
    086
  • 笔记本电池保养

    *误区二:第一次充电必须充够12小时。 这对于早期那些没有电池控制电路的镍氢电池机型是适用的,但对于如今具有智能充放电控制电路的笔记本电池来说却是个笑话,当笔记本电脑电池充满之后,…

    技术杂谈 2023年5月31日
    064
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球