.c .h 文件代码组织结构

个人的代码组织风格如下所示:

.c                                    .h
+-------------------------+           +-------------------------+
|[File Header]            |           |[File Header]            |
+-------------------------+           +-------------------------+
|[Include]                |           |[Include]                |
| #include System         |           | #include System         |
| #include SDK            |           | #include SDK            |
| #include Local          |           | #include Local          |
+-------------------------+           +-------------------------+
|[Declaration]            |           |[Declaration]            |
| #define                 |           | #define                 |
|                         |           |                         |
| data declarations       |           | data declarations       |
|   Private               |           |   Public                |
|                         |           |                         |
| function declaration    |           | function declaration    |
|   Private               |           |   Public                |
+-------------------------+           +-------------------------+
|[Implementations]        |                                      
|  common/util/helper     |                                      
|                         |                                      
|  Usecase/Handler        |                                      
|    case1                |                                      
|      step1              |                                      
|      step2              |                                      
|      ...                |                                      
|    ...                  |                                      
|                         |                                      
|  callback/statemachine  |                                      
+-------------------------+

发表评论

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据