Tips for reading open-source project code

Source: Internet
Author: User


The question is very big and the content is very small. Because the younger brother has limited ability, he cannot think of any suitable questions.


When I recently read the code of an open-source project, I always find that the relevant functions are not found.

It is inconvenient to mark the quoted italics. Recall that this problem was also encountered when I used the pjsip open-source project before,

At that time, the Code was so crazy that it could only be fooled ..


It seems I have to think about some moves .. First, find the reason why "reference link cannot be found. The result is that some macro definitions are used at the beginning of the function,

Such as methoddef and extern. As a result, the code editor such as source insight cannot find function references.


What should we do ?? I copied a copy of the project code, re-built a project, and then started the keywords of those functions.

(Methoddef, etc.) Replacement (you can use the replace files in source insight or the SED and TR commands of shell terminals ),

Finally, you can see the complete call (this project is only for ease of reading and cannot be compiled ).


However, there are still some problems, that is, the function pointers in the struct are also encapsulated with macros, which is not easy to replace. At this time, only

This is the case.


I have used the above tips only when viewing C/C ++ projects. I don't know if you are reading the project code.

How can this problem be solved?



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.