#\r
\r
from __future__ import print_function\r
+from __future__ import absolute_import\r
import sys\r
import Common.LongFilePathOs as os\r
import re\r
import string\r
-import CodeFragmentCollector\r
-import FileProfile\r
+from Ecc import CodeFragmentCollector\r
+from Ecc import FileProfile\r
from CommonDataClass import DataClass\r
-import Database\r
+from Ecc import Database\r
from Common import EdkLogger\r
-from EccToolError import *\r
-import EccGlobalData\r
-import MetaDataParser\r
+from Ecc.EccToolError import *\r
+from Ecc import EccGlobalData\r
+from Ecc import MetaDataParser\r
\r
IncludeFileListDict = {}\r
AllIncludeFileListDict = {}\r
PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])\r
\r
\r
-def CheckHeaderFileData(FullFileName):\r
+def CheckHeaderFileData(FullFileName, AllTypedefFun=[]):\r
ErrorMsgList = []\r
\r
FileID = GetTableID(FullFileName, ErrorMsgList)\r
ResultSet = Db.TblFile.Exec(SqlStatement)\r
for Result in ResultSet:\r
if not Result[1].startswith('extern'):\r
- PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable definition appears in header file', FileTable, Result[0])\r
+ for Item in AllTypedefFun:\r
+ if '(%s)' % Result[1] in Item:\r
+ break\r
+ else:\r
+ PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable definition appears in header file', FileTable, Result[0])\r
\r
SqlStatement = """ select ID\r
from Function\r
if (len(CommentStrListTemp) <= 1):\r
# For Mac\r
CommentStrListTemp = CommentStr.split('\r')\r
- # Skip the content before the file header \r
+ # Skip the content before the file header\r
for CommentLine in CommentStrListTemp:\r
if CommentLine.strip().startswith('/** @file'):\r
FileStartFlag = True\r
if FileStartFlag == True:\r
CommentStrList.append(CommentLine)\r
- \r
+\r
ID = Result[1]\r
Index = 0\r
if CommentStrList and CommentStrList[0].strip().startswith('/** @file'):\r
if EccGlobalData.gConfig.HeaderCheckCFileCommentStartSpacesNum == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
if CommentLine.startswith('/** @file') == False and CommentLine.startswith('**/') == False and CommentLine.strip() and CommentLine.startswith(' ') == False:\r
PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment content should start with two spaces at each line', FileTable, ID)\r
- \r
+\r
CommentLine = CommentLine.strip()\r
if CommentLine.startswith('Copyright'):\r
NoCopyrightFlag = False\r
# Check whether C File header Comment's each reference at list should begin with a bullet character.\r
if EccGlobalData.gConfig.HeaderCheckCFileCommentReferenceFormat == '1' or EccGlobalData.gConfig.HeaderCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
if RefListFlag == True:\r
- if RefLine.strip() and RefLine.strip().startswith('**/') == False and RefLine.startswith(' -') == False: \r
- PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Each reference on a separate line should begin with a bullet character ""-"" ', FileTable, ID) \r
- \r
+ if RefLine.strip() and RefLine.strip().startswith('**/') == False and RefLine.startswith(' -') == False:\r
+ PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Each reference on a separate line should begin with a bullet character ""-"" ', FileTable, ID)\r
+\r
if NoHeaderCommentStartFlag:\r
PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header comment should begin with ""/** @file""', FileTable, ID)\r
return\r