Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the directory structure of libevent

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the directory structure of libevent". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the directory structure of libevent"?

1.libevent source code

The compilation method is described in great detail on the github introduction page, so I won't say any more here.

Directory structure of 2.libevent source code

After we downloaded the source code, we saw that there were a lot of files and directories, and we often didn't know where to start. I was the same at first, and then I took the time to figure out the contents of each directory and some major files. It's easier to read the source code and learn.

The directory structure is as follows:

Directory name directory contents plo suffix file, do not understand what is, may be compiled generated some files. Libs stores compiled generated .o files and so files autom4te.cache is also some files needed for compilation or installation, temporarily do not understand the specific function cmake stores cmake files, configure cmake compilation required header files and source file paths compat only queue.h defines a lot of macro definitions It is mainly used for structures such as singly-linked list,list,simple queue,tail queue,circle queue. The current directory header files in inlcude are all previous versions, and the latest version uses the header files in include/event2. Note that the header files with compat suffix in include/event2 exist for backward compatibility after the version is updated. We only study the latest version here, so we will ignore the storage of M4 files in M4 files with compat suffix. M4 is a programming language under unix. M4 files are written in M4 language, usually because configure will rely on it to sample this needless to say, the stored demo code using libevent test stores the code for unit tests win32_code, which is currently unknown, and the 3.libevent header file will be updated later.

The contents of the header file are as follows:

The header file declares that the content buffer.h is mainly to operate on evbuffer, to perform various operations around struct evbuffer, bufferevent.h to perform various operations on struct bufferevent, bufferevent_ssl.h to obtain openssl, struct buffereventdns.h to perform various operations on struct evdns_base structure, event-config.h to store a lot of macro definitions, which are generated according to the configuration at compile time. The next article will focus on the core header file of event.hlibevent. Operate on struct event_base structure http.h perform various operations on struct evhttp listener.h operate on struct evconnlistener, bind and listen on socket, operate on socket here rpc.h operates on struct evrpc_base, can generate rpc server and client tag.h temporarily, it is used to convert evbuffer to specific types Thread.hlibevent such as shaping or string or time structure supports multithreading using util.h to prevent not supporting c99. Many system functions are encapsulated to support c99visibility.h to define some macro definitions, which should be parameters for dynamic library calls.

Note: header files with struct suffixes are all structures, so we won't introduce them separately here.

In addition, the libevent implementation files. C files are all under the first-level directory of the downloaded source code, which is at the same level as the directory mentioned above.

At this point, I believe you have a deeper understanding of "what is the directory structure of libevent". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report