doxygen

嵌入式编码规范,收藏细读!

夙愿已清 提交于 2021-01-28 22:11:00
作为程序开发者,避免不了阅读别人代码,那么就会涉及到到一门语言的编程规范。规范虽然不是语言本身的硬性要求,但是已经是每一个语言使用者约定俗成的一个规范。 按照编程规范编写的代码,至少在代码阅读时,给人一种愉悦的心情,特别是强迫症患者。另一方面,统一的编程风格,可以减少编写错误,利于后期维护。 因为最近又开始进行纯C语言的开发,并且是基于SDK的开发,所以添加的每一行代码都应该与原来风格保持一致,不能因为一颗老鼠屎坏了一锅汤。一个良好的编程规范也可以看出编程人员的细心程度与代码质量。 之前待过的两家公司,也都有各自总结的编程规范,但都不约而同的一致,适用本公司的软件开发。这几天有幸可以参阅华为技术有限公司的C语言编程规范,相比之下,写的更加详细。 至少接触到了,在这个编程规范中体现了,并且还扩充了很多,我觉得有必要归纳总结,一遍日后查阅。先是学习规范,然后再积累规范,最后才是依规范编写。 1、清晰第一 清晰性是易于维护、易于重构的程序必需具备的特征。代码首先是给人读的,好的代码应当可以像文章一样发声朗诵出来。 2.、简洁为美 简洁就是易于理解并且易于实现。代码越长越难以看懂,也就越容易在修改时引入错误。写的代码越多,意味着出错的地方越多,也就意味着代码的可靠性越低。 因此,我们提倡大家通过编写简洁明了的代码来提升代码可靠性。废弃的代码(没有被调用的函数和全局变量)要及时清除

Truncating namespaces in a Doxygen mainpage

亡梦爱人 提交于 2021-01-28 19:36:23
问题 I am writing a C# library and would like to link to some classes' pages from my mainpage.md file. However, the only way I can get Doxygen to make the links out of the text in the mainpage is by writing the fully-qualified names of the classes (eg. com.mycompany.myproject.MyClass ) in the mainpage, which is a little hard to read and a real pain to write repeatedly. I would like to be able to just write MyClass in the mainpage and have it link to com.mycompany.myproject.MyClass . There is only

Include both #ifdef and #else code in doxygen output

…衆ロ難τιáo~ 提交于 2021-01-28 19:09:51
问题 If have code in the following format: #ifdef MY_DEFINE ///some doxy comment #else ///other doxy comment #endif MY_DEFINE is defined at compile time. My issue is that when doxy processes the code above, only "other doxy comment" is handled. Defining MY_DEFINE in the doxyfile makes it so "some doxy comment" is handled. I need both doxy comments to make it into the doxygen output. Is there a simple catch all configuration I can add to the doxyfile? The doxygen generation needs to be run on

Documenting conditional exclusive code in Doxygen

谁说我不能喝 提交于 2021-01-28 12:36:05
问题 Consider // EXTERNAL_MACRO is an external macro defined to some value by build system #if EXTERNAL_MACRO == 1 # define EXCLUSIVE_MACRO_ONE #elif EXTERNAL_MACRO == 2 # define EXCLUSIVE_MACRO_TWO #else # define EXCLUSIVE_MACRO_OTHER #endif At built time, only one of the EXCLUSIVE_MACRO_... macros is defined. How can one document all three EXCLUSIVE_MACRO_... macros in Doxygen? PREDEFINED configuration setting is not helpful for this because it allows to define EXTERNAL_MACRO to only a single

Documenting conditional exclusive code in Doxygen

你离开我真会死。 提交于 2021-01-28 12:35:37
问题 Consider // EXTERNAL_MACRO is an external macro defined to some value by build system #if EXTERNAL_MACRO == 1 # define EXCLUSIVE_MACRO_ONE #elif EXTERNAL_MACRO == 2 # define EXCLUSIVE_MACRO_TWO #else # define EXCLUSIVE_MACRO_OTHER #endif At built time, only one of the EXCLUSIVE_MACRO_... macros is defined. How can one document all three EXCLUSIVE_MACRO_... macros in Doxygen? PREDEFINED configuration setting is not helpful for this because it allows to define EXTERNAL_MACRO to only a single

Doxygen: Add input-directories using wildcards

百般思念 提交于 2021-01-28 07:45:43
问题 I am using Doxygen 1.8.6 on a Windows machine and try to add input-directories using wildcards. I have a directory with several sub-directories containing source-code but I only want to add specific directories. In the following example, I only want to let Doxygen parse the subdirectories starting with the string 'own_'. Currently I am adding each directory separately but this is very inconvenient as the version can change or even the contained modules/libraries (the directory-content is

Doxygen (1.8.8) putting C++ constructors / public member functions on group page rather than class page

安稳与你 提交于 2021-01-27 04:17:45
问题 I am trying to document some of my code with Doxygen. I have a library which I'm calling a Doxygen group, and many classes in separate header files. A number of the constructors are shown as public member functions on the class pages, but their documentation is shown on the group page rather than in the Constructors && Destructors section on the class page. Some are not; I haven't exactly figured out the pattern yet. Here is one that fails: /** * @addtogroup gr_espresso * @{ */ /** * @file

In doxygen documentation how to create a link to a specific line of a file

匆匆过客 提交于 2021-01-26 08:05:12
问题 There are several doxygen commands whose purpose is to create links in the documentation (@link, @ref). I am currently using the @ref command to create a link to a custom file, written in a language not supported by doxygen (xml). I would like to alter this link so that it points to a precise line in the file. Is there a doxygen command that allows to do that ? 回答1: I'm not sure that \ref or \link can do this. However, if they could, one problem of adopting this approach is that the links

libimobiledevice安装

ぃ、小莉子 提交于 2020-11-21 00:32:04
https://github.com/libimobiledevice/libimobiledevice libimobiledevice安装指南,你还不知道libimobiledevice为何物,赶紧看看freebuf上的文章吧http://www.freebuf.com/news/special/53260.html 实现了iPhone,iPod Touch, Ipad等苹果设备的通讯协议,可以备份apple设备文件等等 环境准备:ubuntu16.04 sudo -i apt-get install automake libtool pkg-config usbmuxd libplist3 libplist-dev libusbmuxd4 libusbmuxd-dev cython cython-dbg doxygen libplist++3v5 libplist++-dev libgnutls-openssl27 libgnutls-dev libssl-dev ./autogen.sh 检查环境 然后 make make install 看下tools目录下的工具 转载于:https://www.cnblogs.com/nightnine/p/5478142.html 来源: oschina 链接: https://my.oschina.net/u/4518192

openocd+stlink

拥有回忆 提交于 2020-11-09 14:19:41
joe @joe-PC /cygdrive/g/dapjtag/openocd-20200729/OpenOCD-20200729-0.10.0/share/openocd/scripts $ openocd -f ./board/st_nucleo_f103rb.cfg Open On-Chip Debugger 0.10.0 (2020-07-29) [https://github.com/sysprogs/openocd] Licensed under GNU GPL v2 libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : Listening on port 6666 for tcl connections Info :