本文为个人读书笔记,仅供记录学习过程中遇到的日后需要留意的问题,如有相关版权问题请及时通知作者。
文件内容的一般规则
1、每个头文件和源文件的头部必须包含文件头部说明和修改记录。
2、各个源文件必须有一个头文件说明,头文件各部分书写顺序如下
No. | Item |
1 | Header File Header Section |
2 | Multi-Include_Prevent Section |
3 | Debug Switch Section |
4 | Include File Section |
5 | Macro Define |
6 | Structure Define Section |
7 | Prototype Declare Section |
Multi-Include-Prevent Section用来防止头文件被重复包含
源文件各部分的书写顺序如下
No | Item |
1 | Source File Header Section |
2 | Debug Switch Section |
3 | Include File Section |
4 | Macro Define Section |
5 | Structure Define Section |
6 | Prototype Declare Section |
7 | Global Variable Declare Section |
8 | File Static Variable Define Section |
9 | Function Define Section |
文件名命名的规则
5、文件标识符分为两部分,即文件名前缀和后缀。文件名前缀的最前面要使用范文限定符——模块名(文件名)的缩写;
6、采用小写字母命名文件,避免使用一些比较通俗的文件名。