Excellent open source c project

There are many excellent open source projects in the open source world, and we select ten of the best and most lightweight C language projects, hoping to provide reference for C language developers.

  1. Webbench

  Webbench is a very simple website stress testing tool used under linux. It uses fork() to simulate multiple clients accessing the URL we set at the same time to test the performance of the website under pressure. It can simulate up to 30,000 concurrent connections to test the load capacity of the website. Webbench is written in C language, the code is too concise, and the source code adds up to less than 600 lines.

  Download link: http://home.tiscali.cz/~cz210552/webbench.html

  2. Tinyhttpd

  tinyhttpd is an ultra-lightweight Http Server, developed in C language, with only 502 lines of code (including comments), with a simple Client, you can understand the essence of an Http Server by reading this code.

  Download link: http://sourceforge.net/projects/tinyhttpd/

  3. 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 is 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 Homepage:   http://sourceforge.net/projects/cjson/

  4. 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 line of cmockery is less than 3K, you can see it at a glance by reading the source code of will_return and mock.

  Main features:

  Free and open source, Google provides technical support;

  Lightweight framework to make testing faster and easier;

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

  Not mandatory The test code must rely on the C99 standard, which is useful for the development of many embedded systems.

  Download link: http://code.google.com/p/cmockery/downloads/list

  5. Libev

  libev is an open source event-driven library , based on the infrastructure provided by OS such as epoll and kqueue. It is famous for its efficiency. It can unify IO events, timers, and signals, and put them in the framework of event processing. Based on the Reactor mode, it has high efficiency, and the code is simplified (more than 8000 lines in version 4.15), which is a good resource for learning event-driven programming.

  Download link: http://software.schmorp.de/pkg/libev.html

  6. Memcached

  Memcached is a high-performance distributed memory object caching system for dynamic web applications to reduce database load. It provides the speed of a dynamic database-driven website by caching data and objects in memory to reduce the number of database reads. Memcached is based on a hashmap that stores key/value pairs. The code size of Memcached-1.4.7 is still acceptable, only about 10K lines.

  Download link: http://memcached.org/

  7. Lua

  Lua is great, Lua was invented by Brazilians, which 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. It can be easily compiled 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 by removing blank lines and comments.

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

  8. SQLite

  SQLite is an open source embedded relational database that implements a self-contained, zero-configuration, transaction-supporting SQL database engine. It is characterized by being highly portable, easy to use, compact, efficient and reliable. Small enough, roughly 30k lines of C code, 250K.

  Download address: http://www.sqlite.org/  .

  9. UNIX v6

  UNIX V6's kernel source code, including device drivers, has about 10,000 lines. This amount of source code can be fully understood by beginners. There is a saying that the upper limit of the amount of code a person can understand is 10,000 lines, and the kernel source code of UNIX V6 is just within this range in terms of quantity. Seeing this, do you also have the idea of ​​"if there are only 10,000 lines, maybe I can learn it"?

  On the other hand, the kernel source code for recent operating systems, such as Linux, is said to exceed 10 million lines. Even if you are not a beginner, it is basically impossible to fully understand the entire code.

  Download address: http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6

  10. NETBSD

  NetBSD is a free, highly portable UNIX-like operating system that is currently the most portable operating system and can be executed on many platforms, from 64bit alpha servers to handheld and embedded devices. The slogan of the NetBSD project is: "Of course it runs NetBSD". Its concise design, standardized code, and many advanced features make it widely acclaimed in the industry and academia. Because of the concise design and advanced features, it has excellent performance in production and research, and it also has complete source code supported by users. Many programs are readily available through the NetBSD Packages Collection.
There are many excellent open source projects in the open source world, and we select ten of the best and most lightweight C language projects, hoping to provide reference for C language developers.

  1. Webbench

  Webbench is a very simple website stress testing tool used under linux. It uses fork() to simulate multiple clients accessing the URL we set at the same time to test the performance of the website under pressure. It can simulate up to 30,000 concurrent connections to test the load capacity of the website. Webbench is written in C language, the code is too concise, and the source code adds up to less than 600 lines.

  Download link: http://home.tiscali.cz/~cz210552/webbench.html

  2. Tinyhttpd

  tinyhttpd is an ultra-lightweight Http Server, developed in C language, with only 502 lines of code (including comments), with a simple Client, you can understand the essence of an Http Server by reading this code.

  Download link: http://sourceforge.net/projects/tinyhttpd/

  3. 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 is 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 Homepage:   http://sourceforge.net/projects/cjson/

  4. 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 line of cmockery is less than 3K, you can see it at a glance by reading the source code of will_return and mock.

  Main features:

  Free and open source, Google provides technical support;

  Lightweight framework to make testing faster and easier;

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

  Not mandatory The test code must rely on the C99 standard, which is useful for the development of many embedded systems.

  Download link: http://code.google.com/p/cmockery/downloads/list

  5. Libev

  libev is an open source event-driven library , based on the infrastructure provided by OS such as epoll and kqueue. It is famous for its efficiency. It can unify IO events, timers, and signals, and put them in the framework of event processing. Based on the Reactor mode, it has high efficiency, and the code is simplified (more than 8000 lines in version 4.15), which is a good resource for learning event-driven programming.

  Download link: http://software.schmorp.de/pkg/libev.html

  6. Memcached

  Memcached is a high-performance distributed memory object caching system for dynamic web applications to reduce database load. It provides the speed of a dynamic database-driven website by caching data and objects in memory to reduce the number of database reads. Memcached is based on a hashmap that stores key/value pairs. The code size of Memcached-1.4.7 is still acceptable, only about 10K lines.

  Download link: http://memcached.org/

  7. Lua

  Lua is great, Lua was invented by Brazilians, which 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. It can be easily compiled 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 by removing blank lines and comments.

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

  8. SQLite

  SQLite is an open source embedded relational database that implements a self-contained, zero-configuration, transaction-supporting SQL database engine. It is characterized by being highly portable, easy to use, compact, efficient and reliable. Small enough, roughly 30k lines of C code, 250K.

  Download address: http://www.sqlite.org/  .

  9. UNIX v6

  UNIX V6's kernel source code, including device drivers, has about 10,000 lines. This amount of source code can be fully understood by beginners. There is a saying that the upper limit of the amount of code a person can understand is 10,000 lines, and the kernel source code of UNIX V6 is just within this range in terms of quantity. Seeing this, do you also have the idea of ​​"if there are only 10,000 lines, maybe I can learn it"?

  On the other hand, the kernel source code for recent operating systems, such as Linux, is said to exceed 10 million lines. Even if you are not a beginner, it is basically impossible to fully understand the entire code.

  Download address: http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6

  10. NETBSD

  NetBSD is a free, highly portable UNIX-like operating system that is currently the most portable operating system and can be executed on many platforms, from 64bit alpha servers to handheld and embedded devices. The slogan of the NetBSD project is: "Of course it runs NetBSD". Its concise design, standardized code, and many advanced features make it widely acclaimed in the industry and academia. Because of the concise design and advanced features, it has excellent performance in production and research, and it also has complete source code supported by users. Many programs are readily available through the NetBSD Packages Collection.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325837527&siteId=291194637