# Dictionary-C **Repository Path**: libang_y/Dictionary-C ## Basic Information - **Project Name**: Dictionary-C - **Description**: Everything is a key-value pair. - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: https://gitee.com/libang_y/Dictionary-C - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-12-24 - **Last Updated**: 2024-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Dictionary-C This project is an encapsulation of [cJSON](https://github.com/DaveGamble/cJSON). ## License MIT Copyright (c) [libang_y@163.com] ## Features - Simple and easy to use; - Support iterator; - Support embedded system. ## Prerequisites - A C compiler - Higher version than CMake 3.15.5 - [Cmocka](https://cmocka.org/) unit testing framework for C with support for mock objects - GNU/Linux, MSYS2, Windows, MaxOS X. ## Download ``` git clone https://gitee.com/libang_y/Dictionary-C ``` or visit my [main page](https://gitee.com/libang_y/Dictionary-C) ## Building/Testing With CMake, CMake with an equal or higher version than 3.15.5 is supported. With CMake it is recommended to do an out of tree build, meaning the compiled files are put in a directory separate from the source files. ``` mkdir UnitTest cd UnitTest cmake .. ``` This will create a Makefile and a bunch of other files. You can then compile it: ``` make ./dictionary ``` ## Code Example ### Add/Get Integer to/from Dictionary ``` #define TEST_INTEGER_KEY "integer" dict_t dict = dictionary_create() bool status = dictionary_integer_add(dict, TEST_INTEGER_KEY, 1234); int value = dictionary_integer_get(dict, TEST_INTEGER_KEY); ```