If you are working with some API or with an IoT device that pushes some data to an API, there is a possibility you might be using JSON for the exchange of request.
Json isn't a huge language to start with, so libraries for it are likely to be small(er than Xml libraries, at least).There are a whole ton of C libraries linked at Json.org. Maybe one of them will work well for you.
26 Ocak 2021
89 kişi değerlendirdi
6 yorum
{"2_bx90":{"state":{"logo":{"href":"//yandex.com.tr","isForeign":true},"form":{"action":"/search","searchLabel":"Bul","hiddenInputs":[{"name":"lr","value":20815}]},"actions":{"advancedSearch":{"checked":false,"ariaLabel":"Gelişmiş arama"},"moreButtonProps":{"ariaLabel":"Daha fazla"},"cbir":{"name":"cbir","label":"Поиск по картинке","infoUrl":"//yandex.ru/promo/photosearch/index?source=landingdesk","isMacOS":false}},"userSection":{"loggedIn":false,"loginProps":{"loginUrl":"https://passport.yandex.com.tr/auth?retpath=%2F&origin=serp_desktop_auth_new","loginText":"Giriş yap","burgerAriaLabel":"Menü"}},"navigation":{"tabs":[{"id":"www","label":"Arama","url":"//yandex.com.tr","params":{"source":"tabbar"},"target":""},{"id":"images","label":"Görsel","url":"//yandex.com.tr/gorsel/search","params":{"text":"[$query]","noreask":"[$noreask]","nomisspell":"[$nomisspell]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"video","label":"Video","url":"//yandex.com.tr/video/search","params":{"text":"[$query]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"maps","label":"Haritalar","url":"//yandex.com.tr/harita","params":{"text":"[$query]","source":"serp_navig"}},{"id":"translate","label":"Çeviri","url":"//ceviri.yandex.com.tr","params":{"text":"[$query]","from":"tabbar"}}],"selectedTabId":"www","fixedTabsCount":1},"context":{"query":"c json","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","noreask":"1","lr":"20815","counters":{"type":"b","data":{"$header":"0_j7stz000","logo":"0_j7stz001","login":"0_j7stz003","usermenu":"0_j7stz004","market-cart":"0_j7stz006","more-button":"0_j7stz007","cbir":"0_j7stz008","$navigation":"0_j7stz009","item":"0_j7stz00i","tab-www":"0_j7stz00b","tab-images":"0_j7stz00d","tab-video":"0_j7stz00f","tab-maps":"0_j7stz00h","tab-translate":"0_j7stz00j"}}},"loggedIn":false,"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"0_j7stw01-0-1"},"ui":"desktop","service":"web","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","fast":{"name":"header-desktop"}}}}},"type":"header-desktop"},"2_j7st0":{"state":{"thumbWidth":198,"thumbHeight":113,"videoPreviewHref":"http://www.youtube.com/watch?v=N6JBjzPssQI","internalLinksTarget":"_blank","posterSrc":"//avatars.mds.yandex.net/get-vthumb/1571374/100bc94691211324c0c678a93a87904f/564x318","duration":"24:10","isAdultContent":false,"isVertical":false,"logNode":{"name":"video","attrs":{"externalId":{"entity":"video","id":"3175802620962696511"},"hasVideoViewerLink":false,"hasFilmId":true}},"organicVideoMeta":{"created":"16 Tem 2021","views":"38 bin görüntüleme"},"i18nTexts":{"durationAriaLabel":"Süre","freshAriaLabel":"Yayınlandı"},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_j7stw09-0-1"},"ui":"desktop","service":"web","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","organic":1}}}},"type":"organic"},"2_j7st1":{"state":{"answersUrl":"https://stackoverflow.com/questions/6673936/parsing-json-using-c#answers","type":"fact","tabsOptions":[{"id":"question","text":"Soru"},{"id":"bestAnswer","text":"En iyi yanıt"},{"id":"moreAnswers","text":"6 yanıt daha","shortText":"Daha fazla"}],"tabContents":{"question":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"I'm trying to find a good way to parse JSON in C. I really don't need a huge library or anything, I would rather have something small and lightweight with a bare minimum of features, but good documentation. "}]},{"type":"paragraph","content":[{"type":"text","content":"Does anyone have anything they can point me to?"}]}],"footerProps":{"date":1429523227,"numLiked":106,"numCommented":7}},"bestAnswer":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"Json isn't a huge language to start with, so libraries for it are likely to be small(er than Xml libraries, at least)."}]},{"type":"paragraph","content":[{"type":"text","content":"There are a whole ton of "},{"type":"text","content":"C libraries linked at Json.org"},{"type":"text","content":". Maybe one of them will work well for you."}]}],"footerProps":{"date":1611658273,"numLiked":89,"numCommented":6}},"moreAnswers":[{"construct":[{"type":"paragraph","content":[{"type":"text","content":"cJSON"},{"type":"text","content":" has a decent API and is small (2 files, ~700 lines). Many of the other JSON parsers I looked at first were huge... I just want to parse some JSON."}]},{"type":"paragraph","content":[{"type":"text","content":"Edit: We've made "},{"type":"text","content":"some improvements"},{"type":"text","content":" to cJSON over the years."}]}],"footerProps":{"date":1504113954,"numLiked":45,"numCommented":2}},{"construct":[{"type":"paragraph","content":[{"type":"text","content":"NXJSON"},{"type":"text","content":" is full-featured yet very small (~400 lines of code) JSON parser, which has easy to use API:"}]},{"type":"code","content":[{"type":"text","content":[{"type":"text","color":"keyword","content":"const"},{"type":"text","content":" nx_json* json=nx_json_parse_utf8(code);"}]},{"type":"text","content":[{"type":"text","content":"printf("},{"type":"text","color":"string","content":"\"hello=%s\\n\""},{"type":"text","content":", nx_json_get(json, "},{"type":"text","color":"string","content":"\"hello\""},{"type":"text","content":")->text_value);"}]},{"type":"text","content":[{"type":"text","color":"keyword","content":"const"},{"type":"text","content":" nx_json* arr=nx_json_get(json, "},{"type":"text","color":"string","content":"\"my-array\""},{"type":"text","content":");"}]},{"type":"text","content":[{"type":"text","color":"name","content":"int"},{"type":"text","content":" i;"}]},{"type":"text","content":[{"type":"text","color":"keyword","content":"for"},{"type":"text","content":" (i="},{"type":"text","color":"name","content":"0"},{"type":"text","content":"; i\u003carr->length; i++) {"}]},{"type":"text","content":[{"type":"text","content":" "},{"type":"text","color":"keyword","content":"const"},{"type":"text","content":" nx_json* item=nx_json_item(arr, i);"}]},{"type":"text","content":[{"type":"text","content":" printf("},{"type":"text","color":"string","content":"\"arr[%d]=(%d) %ld\\n\""},{"type":"text","content":", i, ("},{"type":"text","color":"name","content":"int"},{"type":"text","content":")item->type, item->int_value);"}]},{"type":"text","content":[{"type":"text","content":"}"}]},{"type":"text","content":[{"type":"text","content":"nx_json_free(json);"}]}]}],"footerProps":{"date":1612659969,"numLiked":13,"numCommented":2}}]},"organic":{"faviconProps":{"src":"https://favicon.yandex.net/favicon/v2/https://stackoverflow.com","size":"m","pageNumber":0,"index":0},"title":"Parsing \u0007[JSON\u0007] using \u0007[C\u0007] [closed]","pathProps":{"items":[{"url":"https://stackoverflow.com/questions/6673936/parsing-json-using-c","text":"stackoverflow.com"},{"url":"https://stackoverflow.com/questions/6673936/parsing-json-using-c","text":"parsing-json-using-c"}]},"faviconPosition":0,"subtitlePosition":1,"linkProps":{"url":"https://stackoverflow.com/questions/6673936/parsing-json-using-c"},"hostTitle":"stackoverflow.com","description":""},"extralinksProps":{"hidden":true,"directions":["bottom-end"],"items":[{"variant":"reportFeedback","reportFeedback":{"feature":"Блок ответов для разработчиков","title":"Bu yanıtta yanlış olan nedir?","checkBoxLabels":[{"value":"Yanıt sorguya uygun değil"},{"value":"Yanıt hatalı"},{"value":"Yanıttaki bilgiler eksik"},{"value":"Diğer"}]}}]},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_j7stw0c-0-1"},"ui":"desktop","service":"web","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","fast":{"name":"article"}}}}},"type":"article"},"2_j7st2":{"state":{"linksGroups":[{"type":"geo","links":[{"label":"Columbus","title":"Columbus","url":"//yandex.com.tr/tune/geo","logNode":{"name":"region"},"target":"_self","a11yLabel":"Bölgeniz Columbus","needRetpath":true}]},{"type":"feedback","links":[{"label":"Hata bildir","logNode":{"name":"feedback","attrs":{"behaviour":{"type":"dynamic"}}}}]},{"type":"settings","links":[{"label":"Ayarlar","url":"//yandex.com.tr/tune/search","logNode":{"name":"settings"},"target":"_self","needRetpath":true}]},{"type":"company","links":[{"label":"Hakkımızda","url":"https://company.yandex.com.tr","logNode":{"name":"about"},"target":"_blank"},{"label":"Ticari teklifler","url":"/search/direct?text=c%20json&filters_docs=direct_cm","logNode":{"name":"commercial"},"target":"_blank"},{"label":"Kariyer","url":"//yandex.com.tr/jobs/?utm_source=serp_turkie&utm_medium=footerlink&utm_content=career","logNode":{"name":"vacancy"},"target":"_blank"},{"label":"Kullanım lisansı","url":"//yandex.com.tr/legal/termsofuse/","logNode":{"name":"license"},"target":"_blank"},{"label":"Gizlilik Politikası","url":"//yandex.com.tr/legal/confidential/","logNode":{"name":"confidential"},"target":"_blank"}],"a11yHidden":true}],"reportFeedbackProps":{"feature":"Подвал","title":"Hata bildir","checkBoxLabels":[]},"isSearchApp":false,"hasExtralinks":true,"limitingSelector":".AliceFabButton","baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_j7stw0d-0-1"},"ui":"desktop","service":"web","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL"}}}},"type":"serp-footer"},"2_j7st3":{"state":{"conditionLoadList":{"marketCart":false,"highchartsHighstock":false,"advProductGallery":false,"musicPlayer":false,"ecomRates":false,"photoViewer":false,"darkmodeChangeDrawer":true},"reportFeedbackBaseProps":{"initEmail":"","metaFields":{"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","userTestids":"186144,1053271,1041069,1020665,1053475,1052826,1040007,1042317,1048790,1048639,1054633,1056273,1052647,1055463,844914,1058434,1031194,1055126,936723,1049213,1053713,1056985,123851,1050880,1056566,1046931,1047761,1058494,1036351,1049027,1051714,1037753,1053335,891392,952764,1054074,1056359,1058152,1053535,1025009,1047659,1053974,1051607,263461,255406,40254,1037487,461652,1047744,1056022,1045240,1056044,151171,128379,126308,126312,126350,13963,287509,338390,1006737,1057712,1055735,1043983,1056619,1055380,1047580,912286","yandexuid":"3631094971720168895","uid":"0","queryText":"c json","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","searchSlices":["drawer_search_slice_english","drawer_search_slice_cs"],"userRegionName":"Columbus","userRegionId":"20815"}},"extralinksPopupProps":{"abuseLink":"https://twitter.yandex.com.tr/search/abuse?sign=2d910b002e0e0b7c8d125d17b05793ca&keyno=0"},"isLoggedIn":false,"userMenuDialogProps":{"flag":"skin,feedback","host":"yandex.com.tr","lang":"tr","project":"serp","queryParams":{"utm_source":"search"},"retpath":"https%3A%2F%2Ftwitter.yandex.com.tr%2Fsearch%3Flr%3D20815%26noreask%3D1%26rq%3D1%26serp-reload-from%3Drec_bottom%26source%3Dtabbar%26text%3Dc%2Bjson%26ncrnd%3D74887","tld":"com.tr"},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_j7stw0e-0-1"},"ui":"desktop","service":"web","reqid":"1720168957535995-1406885453042278291-balancer-l7leveler-kubr-yp-sas-80-BAL","fast":{"name":"lazy-load"}}}}},"type":"lazy-load"}}