In the past two days, you have to manually add the file header for each newly created file, manually add the function description for each newly created function, and manually generate a. h file. As a result, I searched the internet and found an artifact written by lushengwen: quicker. em.
. Good guy, with this stuff, you don't have to worry about tedious manual work anymore ~~~
Specific usage, everyone can refer to: http://blog.csdn.net/ghostyu/article/details/7091915
But here comes the problem. I found the following stuff:
/*************************************** * *********************************** Copyright all (C ), 2013-2014, tiger studio ************************************** **************************************** file Name: stack_heap_thread_process_2.c version No.: Draft Author: TigerXiao generation Date: June 25, 2014 last modification: Function Description: Here is the description function list for this file: CheckThreadExist CheckThreadStatus main StringToUpper thread_start modification history: 1. date: June 25, 2014 Author: TigerXiao modification content: create a file ************************************** ****************************************/
The copyright and company mentioned above must be written to death.If you change the file, you need to modify the file again. This is a bit unpleasant for me. This is not automatically added when I add a new function,
Of course, this function list function is not used.
If there is any complaint, there will be business opportunities. So I want to change the code to see if I can implement a variable or something :(Attract others)
macro ConfigureSystem(){ szLanguage = ASK("Please select language: 0 Chinese ,1 English"); if(szLanguage == "#") { SetReg ("LANGUAGE", "0") } else { SetReg ("LANGUAGE", szLanguage) } szName = ASK("Please input your name"); if(szName == "#") { SetReg ("MYNAME", "TigerXiao") } else { SetReg ("MYNAME", szName) } szCompany = ASK("Please input your company"); if(szCompany == "#") { SetReg("MYCOMPANY","TigerXiao") } else { SetReg("MYCOMPANY",szCompany) } szCopyright = ASK("Please input your Copyright "); if(szCopyright == "#") { SetReg("MYCOPYRIGHT","2001-2014") } else { SetReg("MYCOPYRIGHT",szCopyright) } }
I modified one of the most important macro definitions, added two variables, and saved them at the same time. What then? Everyone is engaged in code, so I will not say much about it. Obviously, these variables are referenced.
/* Obtain the company name */szCompany = getreg (MYCOMPANY) if (strlen (MYCOMPANY) = 0) {szCompany = Ask ("Enter your name:") setreg (MYCOMPANY, szCompany)}/* copyright */szCopyright = getreg (MYCOPYRIGHT) if (strlen (MYCOPYRIGHT) = 0) {szCopyright = Ask ("Enter your name :") setreg (MYCOPYRIGHT, szCopyright)} GetFunctionList (hbuf, hnewbuf) InsBufLine (hbuf, ln + 0, "/************************************** **************************************** ") insBufLine (hbuf, ln + 1, "") InsBufLine (hbuf, ln + 2, "Copyright (C), @ szCopyright @, @ szCompany @") InsBufLine (hbuf, ln + 3, "") InsBufLine (hbuf, ln + 4, "*************************************** ***************************************") sz = GetFileName (GetBufName (hbuf) InsBufLine (hbuf, ln + 5, "File Name: @ sz @") InsBufLine (hbuf, ln + 6, "version No: draft ") InsBufLine (hbuf, ln + 7," Author: @ szName @ ") policime = getpolicime (1) szTime = policime. date InsBufLine (hbuf, ln + 8, "generated Date: @ szTime @") InsBufLine (hbuf, ln + 9, "Last modified:") iLen = strlen (szContent) nlnDesc = ln szTmp = "Function Description:" InsBufLine (hbuf, ln + 10, "Function Description: @ szContent @") InsBufLine (hbuf, ln + 11, "function list: ")
The above is the modified part of the Chinese language. The English language is the same and you do not need to go into details. This small modification is very simple, but it completes a small idea, the effect is as follows:
Select language:
Input author
Input Company
Enter Copyright
After fi is executed, you can see the file header:
Of course, there must be a description first.
In fact, the main purpose of doing this is to let everyone add some new functions to this macro and improve some new functions, especially for those developed by C/C ++.
PS: in the future, C development will not have any library functions (linux libc and so on) to automatically complete the full function. It really hurts to have a chance to see if it can be done by yourself.
I almost forgot. The modified enhanced version (let's just call it this way ...) I put it online, everyone can refer to: http://download.csdn.net/detail/xiaowh001/7549079