├── README.md ├── template.h └── template.c /README.md: -------------------------------------------------------------------------------- 1 | # c_files_template 2 | Templates for C programming language source (.c) and header (.h) files 3 | 4 | # How to add to Eclipse-based softwares 5 | Go to "Window -> Preferences -> C/C++ -> Code Style -> Code Templates -> Files -> C Source File" and click New. Write a name for the new template. In the Pattern section copy the contents of template.c file. Click apply. 6 | For the C Header File copy the template.h file in the Pattern section. 7 | 8 | When you create a new file for a project, choose your own template. 9 | -------------------------------------------------------------------------------- /template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | * @file ${file_name} 4 | * @author ${user} 5 | * @date ${date} 6 | * @brief 7 | ******************************************************************************** 8 | */ 9 | 10 | #ifndef ${include_guard_symbol} 11 | #define ${include_guard_symbol} 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /************************************ 18 | * INCLUDES 19 | ************************************/ 20 | 21 | /************************************ 22 | * MACROS AND DEFINES 23 | ************************************/ 24 | 25 | /************************************ 26 | * TYPEDEFS 27 | ************************************/ 28 | 29 | /************************************ 30 | * EXPORTED VARIABLES 31 | ************************************/ 32 | 33 | /************************************ 34 | * GLOBAL FUNCTION PROTOTYPES 35 | ************************************/ 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /template.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | * @file ${file_name} 4 | * @author ${user} 5 | * @date ${date} 6 | * @brief 7 | ******************************************************************************** 8 | */ 9 | 10 | /************************************ 11 | * INCLUDES 12 | ************************************/ 13 | 14 | /************************************ 15 | * EXTERN VARIABLES 16 | ************************************/ 17 | 18 | /************************************ 19 | * PRIVATE MACROS AND DEFINES 20 | ************************************/ 21 | 22 | /************************************ 23 | * PRIVATE TYPEDEFS 24 | ************************************/ 25 | 26 | /************************************ 27 | * STATIC VARIABLES 28 | ************************************/ 29 | 30 | /************************************ 31 | * GLOBAL VARIABLES 32 | ************************************/ 33 | 34 | /************************************ 35 | * STATIC FUNCTION PROTOTYPES 36 | ************************************/ 37 | 38 | /************************************ 39 | * STATIC FUNCTIONS 40 | ************************************/ 41 | 42 | /************************************ 43 | * GLOBAL FUNCTIONS 44 | ************************************/ 45 | 46 | --------------------------------------------------------------------------------