C language learning method, learning platform and project recommendation

1 The Algorithms - C

C language implements various algorithms, and you can also learn algorithms at the same time!

Project address: https://github.com/TheAlgorithms/C#the-algorithms---c--mainpage

2 libhv

libhv is a cross-platform networking library similar to libevent, libev, and libuv, providing simpler interfaces and richer protocols. See the project README for details

Subtle, compact, cross-platform, simple, practical and easy to use

  • Base encapsulates a lot of cross-platform code, such as hatomic atomic operations, hthread threads, hmutex thread synchronization, of course, these are based on the platform macros and compilers provided in the hconfig.h and hplatform.h header files automatically generated by configure/cmake implemented by macros, etc.;

  • The event module implements the event loop (including IO, timer, and idle). Different platforms have different implementations. For example, Linux uses epoll, Windows uses IOCP, Mac uses kqueue, and Solaris uses evport. If you are interested, you can read event. 's source code;

  • The http module implements the most common application layer protocol http protocol in this century based on the event module, including http server and client, httpd provided under examples in libhv, the performance is comparable to nginx service;

  • libhv is the simplest library for writing HTTP API server/client in c++, and there is no one

Project address: https://github.com/ithewei/libhv.git

3 C language entry project

Including C language maze, 24 o'clock game, running stickman, supermarket management system, typing letters, electronic clock, pairing, Tetris, reversi, Huarong Road, train ticket booking management source code, Lianliankan, commodity sales system , chess, super mario, library management system, student achievement management system......

Project address: https://mp.weixin.qq.com/s/ZUHtQxaahrGjvAZVu5jKKg

4 C language super comprehensive learning platform

Learn C language/C++ github, share C language/C introduction, learning route, e-book recommendation and download, video recommendation, small projects, dry goods articles, written test interviews, C language/C++ specifications, open source projects, etc.

Project address: https://github.com/tangtangcoding/C-CppLearning

5 C language PAT exercises

PAT exercises in C language. All written in C language, the pursuit of efficient and concise code.

Project address: GitHub - OliverLew/PAT

6 Learn-Algorithms

The project is mainly about learning notes related to algorithms implemented in C language, including various knowledge points, linked lists, queues, hash tables, etc.

Project address: https://github.com/nonstriater/Learn-Algorithms

7 Sqlite

SQLite is an open source embedded relational database that implements a self-contained, zero-configuration, transaction-enabled SQL database engine.

  • Does not require a separate server process or operating system (serverless).

  • SQLite requires no configuration, which means no installation or administration.

  • A complete SQLite database is stored in a single cross-platform disk file.

  • SQLite is very small and lightweight, less than 400KiB when fully configured and less than 250KiB when optional features are omitted.

  • SQLite is self-sufficient, which means it doesn't require any external dependencies.

  • SQLite transactions are fully ACID compliant, allowing safe access from multiple processes or threads.

  • SQLite supports most of the query language features of the SQL92 (SQL2) standard.

  • SQLite is written in ANSI-C and provides a simple and easy-to-use API.

  • SQLite runs on UNIX (Linux, Mac OS-X, Android, iOS) and Windows (Win32, WinCE, WinRT).

Project address: SQLite Home Page

8 EasyLogger

A lightweight and high-performance logging library, author armink, EasyLogger is an ultra-lightweight, high-performance C/C++ logging library, which is very suitable for resource-sensitive software projects. In contrast, the functions of EasyLogger Simpler, less interfaces are provided to users, faster to get started, and more practical functions support dynamic expansion in the form of plug-ins.

Currently EasyLogger supports the following functions:

  • The log output mode supports serial port, Flash, file, etc.;

  • The log content can include level, timestamp, thread information, process information, etc.;

  • Support a variety of operating systems, support bare metal;

  • Each level of log supports different color display;

Project address: https://gitee.com/Armink/EasyLogger

9 struct2json

struct2json is an open source C structure and JSON fast interconversion library, which can quickly realize the serialization and deserialization requirements between structure objects and JSON objects. The fast and concise API design greatly reduces the code complexity of directly using the JSON parsing library to implement such functions.

origin

Applying object-oriented design to C language is a very popular design idea at the moment. Since there is no class in the C language, the structure struct is generally used as a class, and the structure variable is an object. After you have an object, you often need to consider the serialization and deserialization of objects. Unlike many high-level languages, C language has mechanisms such as reflection, so that object serialization and deserialization are natively supported.

For the C language, serializing to JSON string is a good choice, so you have to use a JSON parsing library such as cJSON, but the code after use is redundant and has poor logic, so it was born to encapsulate the cJSON library twice to achieve A library for fast conversion between struct and JSON. struct2json was born here. The following are the main usage scenarios of struct2json:

  • Persistence: After a structure object is serialized into a JSON object, it can be directly saved to a file or Flash to realize power-down storage of the structure object;

  • Communication: High-level languages ​​are very friendly to JSON, for example: Javascript, Groovy have native support for JSON, so JSON can also be used as a communication protocol format and object transfer format between C language and other language software;

  • Visualization: Objects serialized into JSON can be displayed on the console or UI more intuitively, and can be used for product debugging, product secondary development and other scenarios;

Project address: https://gitee.com/Armink/struct2json

10 TencentOS-tiny

The kernel of encentOS tiny is indeed very, very small, with a minimum resource footprint of 0.6KB RAM and 1.8 KB ROM. This is an RTOS independently developed by their team. The source code is very simple and easy to understand. The source code author implements the entire kernel with very clear logic.

TencentOS tiny is mainly composed of a lightweight RTOS kernel + multiple IoT components. From bottom to top, it mainly includes:

CPU library: The CPU IP core architecture supported by TencentOS tiny, currently mainly supports ARM Cortex M0/3/4/7, and the now very popular RISC-V, of course, Tencent IoT team will definitely support more IP core and development board.

Driver management layer: including BSP board-level support package, these things are mainly developed and maintained by MCU chip manufacturers, HAL hardware abstraction, Drivers device driver, this part is still very important for pure embedded developers, and will definitely become more and more The more perfect!

Kernel: The TencentOS tiny real-time kernel includes task management, real-time scheduling, time management, interrupt management, memory management, exception handling, software timers, linked lists, message queues, semaphores, mutex locks, event flags and other modules. Next, I will also I will write a series of articles on TencentOS tiny kernel source code analysis, so stay tuned!

IoT protocol stack: TencentOS tiny provides lwip, AT Adapter, and SAL layers to support different network hardware, such as Ethernet, serial WIFI, GPRS, NB-IoT, 4G and other communication modules. Provide common IoT protocol stack application layers on the TCP/IP network protocol stack, such as COAP and MQTT, to support terminal services to quickly access Tencent Cloud;

Security framework: TencentOS tiny provides a relatively complete security solution in order to ensure the security of IoT terminal data transmission and device authentication security. The DTLS and TLS security protocols provided by the security framework strengthen the transport layer of COAP and MQTT, which can ensure that IoT terminals can achieve security authentication and data encryption when connecting to Tencent Cloud; in addition, for low-resource terminal hardware, the security framework also provides a connection with Tencent Cloud. The key authentication scheme supporting IoTHub ensures that resource-constrained devices can also achieve device security authentication to a certain extent; IoT security is very important, and these frameworks must exist.

Component framework: TencentOS tiny provides a series of components such as file system, KV storage, ad hoc network, JS engine, low-power framework, device framework, OTA, debugging tool chain, etc. I think this part is still very good, looking forward to ing;

Open API (planning and development): TencentOS tiny will provide open API functions on the protocol middleware and framework layers, so that the functions of the middle components can be easily used. I like this kind of development the most. Use directly. In a nutshell, this API can quickly connect to Tencent Cloud, meet the cloud requirements for terminal services, minimize the development cycle of terminal IoT products, and save development costs;

Sample application: TencentOS tiny provides sample code, module test code, etc. for users' reference and use.

Tencent Cloud IoT platform (the top part in the figure): Strictly speaking, this part is not the framework content of TencentOS tiny, it is the access platform layer. Tencent Cloud IoT platform provides SDK packages in multiple languages , of course, the C SDK must be used on embedded devices, but in general, it is very good.

In general, TencentOS tiny is still very good. It has all the functions it should have. You can consider using this operating system~

Project address: https://github.com/Tencent/TencentOS-tiny

11 ffmpeg

FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams. Licensed under LGPL or GPL. It provides a complete solution for recording, converting and streaming audio and video.

Project address: GitHub - FFmpeg/FFmpeg: Mirror of https://git.ffmpeg.org/ffmpeg.git

12 Lua

Lua is great, Lua was invented by the Brazilians, and that makes me uncomfortable, but it doesn't make me blush, at most.

What makes me blush is the Lua source code, 100% ANSI C, not adulterated at all. Compiles easily on any platform that supports an ANSI C compiler. I've tried it, and it's no bullshit at all. The amount of code in Lua is small enough, 5.1.4 is only 1.5W lines, and it is estimated that it can reach 1W lines after removing blank lines and comments.

Project address: http://www.lua.org/

13 cJSON

cJSON is a JSON codec in C language. It is very lightweight. The C file has only more than 500 lines, and the speed is also very ideal.

cJSON also has several weaknesses, although not very powerful, but cJSON's small size and speed are most appreciated. The code is very well maintained and the structure is simple and easy to understand, making it a very good C language project to learn.

Project address: http://sourceforge.net/projects/cjson/

14 CMockery

cmockery is a lightweight framework for C unit testing released by google. It is very small, has no dependencies on other open source packages, and is less intrusive to the code under test. The source code of cmockery is less than 3K lines, you can read the source code of will_return and mock at a glance.

main feature:

  • Free and open source, Google provides technical support;

  • Lightweight framework to make testing faster and easier;

  • Avoid using complex compiler features, for older versions of the compiler, good compatibility;

  • It is not mandatory that the code under test must rely on the C99 standard, which is useful for the development of many embedded systems

Project address: http://code.google.com/p/cmockery/downloads/list

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324090613&siteId=291194637