SourceInsight【生成函数头】


/************************************************************************ 
 功能描述:生成函数注释例子 
 参数说明: 
 原理说明: 
 返 回 值:环形缓冲区指针 
 作    者:肖鑫 2014-05-17 创建函数
*************************************************************************/ 
macro InsertFunctionHeader()
{
	// Get the owner's name from the environment variable: MYNAME.
	// If the variable doesn't exist, then the owner field is skipped.
	szMyName = getenv(MYNAME)
	if ("" == szMyName)
	{
		szMyName = "(set env MYNAME=YourName)"
	}

	/* 获取系统时间,将月转换为两位字符串,将日转换为两位字符串 */
	szTime = GetSysTime(1)
	ulYear = szTime.Year
	ulMonth = szTime.Month
	if (ulMonth < 10)
	{
		ulMonth = "0@ulMonth@"
	}
	ulDay = szTime.Day
	if (ulDay < 10)
	{
		ulDay = "0@ulDay@"
	}

	// Get a handle to the current file buffer and the name
	// and location of the current symbol where the cursor is.
	hbuf = GetCurrentBuf()
	szFunc = GetCurSymbol()
	ln = GetSymbolLine(szFunc)

	/* Record the start line */
	beginLn = ln

	// begin assembling the title string
	sz = "/************************************************************************"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = " 功能描述:"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = " 参数说明:"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = " 原理说明:"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = " 返 回 值:"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = " 作    者:@szMyName@ @ulYear@-@ulMonth@-@ulDay@ 创建函数"
	InsBufLine(hbuf, ln, sz)

	ln = ln + 1
	sz = "*************************************************************************/ "
	InsBufLine(hbuf, ln, sz)

	/* 将当前光标移至功能描述的后面 */
	SetBufIns(hbuf, beginLn + 1, 11)
}


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值