Compare commits
2 Commits
aadc641651
...
b871f2c17a
Author | SHA1 | Date |
---|---|---|
Slice | b871f2c17a | |
Slice | ad05c0b989 |
|
@ -17,7 +17,7 @@ from Common.BuildToolError import *
|
|||
import sys
|
||||
import os
|
||||
|
||||
__description__ = """
|
||||
__description__ = r"""
|
||||
Convert an AML file to a .c file containing the AML bytecode stored in a C
|
||||
array. By default, Tables\Dsdt.aml will generate Tables\Dsdt.c.
|
||||
Tables\Dsdt.c will contain a C array named "dsdt_aml_code" that contains
|
||||
|
|
|
@ -306,7 +306,7 @@ class BuildRule:
|
|||
_SubSectionList = [_InputFile, _OutputFile, _Command]
|
||||
|
||||
_PATH_SEP = "(+)"
|
||||
_FileTypePattern = re.compile("^[_a-zA-Z][_\-0-9a-zA-Z]*$")
|
||||
_FileTypePattern = re.compile(r"^[_a-zA-Z][_\-0-9a-zA-Z]*$")
|
||||
_BinaryFileRule = FileBuildRule(TAB_DEFAULT_BINARY_FILE, [], [os.path.join("$(OUTPUT_DIR)", "${s_name}")],
|
||||
["$(CP) ${src} ${dst}"], [])
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class DependencyExpression:
|
|||
#
|
||||
# open and close brace must be taken as individual tokens
|
||||
#
|
||||
TokenPattern = re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
|
||||
TokenPattern = re.compile(r"(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")
|
||||
|
||||
## Constructor
|
||||
#
|
||||
|
|
|
@ -28,7 +28,7 @@ from Common.DataType import TAB_COMPILER_MSFT
|
|||
gIncludePattern = re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICODE | re.IGNORECASE)
|
||||
|
||||
## Regular expression for matching macro used in header file inclusion
|
||||
gMacroPattern = re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
|
||||
gMacroPattern = re.compile(r"([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICODE)
|
||||
|
||||
gIsFileMap = {}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import os
|
|||
from Common.GlobalData import gIdentifierPattern
|
||||
from .UniClassObject import StripComments
|
||||
|
||||
IMAGE_TOKEN = re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
|
||||
IMAGE_TOKEN = re.compile(r'IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
|
||||
|
||||
#
|
||||
# Value of different image information block types
|
||||
|
|
|
@ -51,12 +51,12 @@ gInfSpecVersion = "0x00010017"
|
|||
#
|
||||
# Match name = variable
|
||||
#
|
||||
gEfiVarStoreNamePattern = re.compile("\s*name\s*=\s*(\w+)")
|
||||
gEfiVarStoreNamePattern = re.compile(r"\s*name\s*=\s*(\w+)")
|
||||
#
|
||||
# The format of guid in efivarstore statement likes following and must be correct:
|
||||
# guid = {0xA04A27f4, 0xDF00, 0x4D42, {0xB5, 0x52, 0x39, 0x51, 0x13, 0x02, 0x11, 0x3D}}
|
||||
#
|
||||
gEfiVarStoreGuidPattern = re.compile("\s*guid\s*=\s*({.*?{.*?}\s*})")
|
||||
gEfiVarStoreGuidPattern = re.compile(r"\s*guid\s*=\s*({.*?{.*?}\s*})")
|
||||
|
||||
#
|
||||
# Template string to generic AsBuilt INF
|
||||
|
|
|
@ -54,7 +54,7 @@ NOT_REFERENCED = 'not referenced'
|
|||
COMMENT_NOT_REFERENCED = ' ' + COMMENT + NOT_REFERENCED
|
||||
CHAR_ARRAY_DEFIN = 'unsigned char'
|
||||
COMMON_FILE_NAME = 'Strings'
|
||||
STRING_TOKEN = re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
|
||||
STRING_TOKEN = re.compile(r'STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)
|
||||
|
||||
EFI_HII_ARRAY_SIZE_LENGTH = 4
|
||||
EFI_HII_PACKAGE_HEADER_LENGTH = 4
|
||||
|
|
|
@ -26,7 +26,7 @@ from Common.Misc import *
|
|||
import json
|
||||
|
||||
## Regular expression for splitting Dependency Expression string into tokens
|
||||
gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)")
|
||||
gDepexTokenPattern = re.compile(r"(\(|\)|\w+| \S+\.inf)")
|
||||
|
||||
## Regular expression for match: PCD(xxxx.yyy)
|
||||
gPCDAsGuidPattern = re.compile(r"^PCD\(.+\..+\)$")
|
||||
|
|
|
@ -242,10 +242,10 @@ class ValueExpression(BaseExpression):
|
|||
|
||||
|
||||
SymbolPattern = re.compile("("
|
||||
"\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.\w+|"
|
||||
"&&|\|\||!(?!=)|"
|
||||
"(?<=\W)AND(?=\W)|(?<=\W)OR(?=\W)|(?<=\W)NOT(?=\W)|(?<=\W)XOR(?=\W)|"
|
||||
"(?<=\W)EQ(?=\W)|(?<=\W)NE(?=\W)|(?<=\W)GT(?=\W)|(?<=\W)LT(?=\W)|(?<=\W)GE(?=\W)|(?<=\W)LE(?=\W)"
|
||||
r"\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.\w+|"
|
||||
r"&&|\|\||!(?!=)|"
|
||||
r"(?<=\W)AND(?=\W)|(?<=\W)OR(?=\W)|(?<=\W)NOT(?=\W)|(?<=\W)XOR(?=\W)|"
|
||||
r"(?<=\W)EQ(?=\W)|(?<=\W)NE(?=\W)|(?<=\W)GT(?=\W)|(?<=\W)LT(?=\W)|(?<=\W)GE(?=\W)|(?<=\W)LE(?=\W)"
|
||||
")")
|
||||
|
||||
@staticmethod
|
||||
|
@ -737,7 +737,7 @@ class ValueExpression(BaseExpression):
|
|||
self._Token = "'" + UStr + "'"
|
||||
return self._Token
|
||||
elif Expr.startswith('UINT'):
|
||||
Re = re.compile('(?:UINT8|UINT16|UINT32|UINT64)\((.+)\)')
|
||||
Re = re.compile(r'(?:UINT8|UINT16|UINT32|UINT64)\((.+)\)')
|
||||
try:
|
||||
RetValue = Re.search(Expr).group(1)
|
||||
except:
|
||||
|
@ -975,7 +975,7 @@ class ValueExpressionEx(ValueExpression):
|
|||
TokenSpaceGuidName = ''
|
||||
if Item.startswith(TAB_GUID) and Item.endswith(')'):
|
||||
try:
|
||||
TokenSpaceGuidName = re.search('GUID\((\w+)\)', Item).group(1)
|
||||
TokenSpaceGuidName = re.search(r'GUID\((\w+)\)', Item).group(1)
|
||||
except:
|
||||
pass
|
||||
if TokenSpaceGuidName and TokenSpaceGuidName in self._Symb:
|
||||
|
|
|
@ -32,10 +32,10 @@ gDefaultStores = []
|
|||
gGuidDict = {}
|
||||
|
||||
# definition for a MACRO name. used to create regular expressions below.
|
||||
_MacroNamePattern = "[A-Z][A-Z0-9_]*"
|
||||
_MacroNamePattern = r"[A-Z][A-Z0-9_]*"
|
||||
|
||||
## Regular expression for matching macro used in DSC/DEC/INF file inclusion
|
||||
gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
|
||||
gMacroRefPattern = re.compile(r"\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
|
||||
gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
|
||||
gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
|
||||
|
||||
|
|
|
@ -41,16 +41,16 @@ from CommonDataClass.Exceptions import BadExpression
|
|||
from Common.caching import cached_property
|
||||
import struct
|
||||
|
||||
ArrayIndex = re.compile("\[\s*[0-9a-fA-FxX]*\s*\]")
|
||||
ArrayIndex = re.compile(r"\[\s*[0-9a-fA-FxX]*\s*\]")
|
||||
## Regular expression used to find out place holders in string template
|
||||
gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE | re.UNICODE)
|
||||
gPlaceholderPattern = re.compile(r"\$\{([^$()\s]+)\}", re.MULTILINE | re.UNICODE)
|
||||
|
||||
## regular expressions for map file processing
|
||||
startPatternGeneral = re.compile("^Start[' ']+Length[' ']+Name[' ']+Class")
|
||||
addressPatternGeneral = re.compile("^Address[' ']+Publics by Value[' ']+Rva\+Base")
|
||||
valuePatternGcc = re.compile('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$')
|
||||
pcdPatternGcc = re.compile('^([\da-fA-Fx]+) +([\da-fA-Fx]+)')
|
||||
secReGeneral = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)', re.UNICODE)
|
||||
startPatternGeneral = re.compile(r"^Start[' ']+Length[' ']+Name[' ']+Class")
|
||||
addressPatternGeneral = re.compile(r"^Address[' ']+Publics by Value[' ']+Rva\+Base")
|
||||
valuePatternGcc = re.compile(r'^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+)$')
|
||||
pcdPatternGcc = re.compile(r'^([\da-fA-Fx]+) +([\da-fA-Fx]+)')
|
||||
secReGeneral = re.compile(r'^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)', re.UNICODE)
|
||||
|
||||
StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')
|
||||
|
||||
|
@ -82,7 +82,7 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames):
|
|||
|
||||
if len(lines) == 0: return None
|
||||
firstline = lines[0].strip()
|
||||
if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):
|
||||
if re.match(r'^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):
|
||||
return _parseForXcodeAndClang9(lines, efifilepath, varnames)
|
||||
if (firstline.startswith("Archive member included ") and
|
||||
firstline.endswith(" file (symbol)")):
|
||||
|
@ -96,7 +96,7 @@ def _parseForXcodeAndClang9(lines, efifilepath, varnames):
|
|||
ret = []
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if status == 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \
|
||||
if status == 0 and (re.match(r'^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \
|
||||
or line == "# Symbols:"):
|
||||
status = 1
|
||||
continue
|
||||
|
@ -104,7 +104,7 @@ def _parseForXcodeAndClang9(lines, efifilepath, varnames):
|
|||
for varname in varnames:
|
||||
if varname in line:
|
||||
# cannot pregenerate this RegEx since it uses varname from varnames.
|
||||
m = re.match('^([\da-fA-FxX]+)([\s\S]*)([_]*%s)$' % varname, line)
|
||||
m = re.match(r'^([\da-fA-FxX]+)([\s\S]*)([_]*%s)$' % varname, line)
|
||||
if m is not None:
|
||||
ret.append((varname, m.group(1)))
|
||||
return ret
|
||||
|
@ -170,7 +170,7 @@ def _parseGeneral(lines, efifilepath, varnames):
|
|||
status = 0 #0 - beginning of file; 1 - PE section definition; 2 - symbol table
|
||||
secs = [] # key = section name
|
||||
varoffset = []
|
||||
symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$-]+) +([\da-fA-F]+)', re.UNICODE)
|
||||
symRe = re.compile(r'^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$-]+) +([\da-fA-F]+)', re.UNICODE)
|
||||
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
|
@ -1926,4 +1926,4 @@ def CopyDict(ori_dict):
|
|||
# Remove the c/c++ comments: // and /* */
|
||||
#
|
||||
def RemoveCComments(ctext):
|
||||
return re.sub('//.*?\n|/\*.*?\*/', '\n', ctext, flags=re.S)
|
||||
return re.sub(r'//.*?\n|/\*.*?\*/', '\n', ctext, flags=re.S)
|
||||
|
|
|
@ -30,9 +30,9 @@ from .DataType import TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_TAG,\
|
|||
##
|
||||
# Static variables used for pattern
|
||||
#
|
||||
gMacroRefPattern = re.compile('(DEF\([^\(\)]+\))')
|
||||
gEnvRefPattern = re.compile('(ENV\([^\(\)]+\))')
|
||||
gMacroDefPattern = re.compile("DEFINE\s+([^\s]+)")
|
||||
gMacroRefPattern = re.compile(r'(DEF\([^\(\)]+\))')
|
||||
gEnvRefPattern = re.compile(r'(ENV\([^\(\)]+\))')
|
||||
gMacroDefPattern = re.compile(r"DEFINE\s+([^\s]+)")
|
||||
gDefaultToolsDefFile = "tools_def.txt"
|
||||
|
||||
## ToolDefClassObject
|
||||
|
|
|
@ -64,11 +64,11 @@ ALIGNMENTS = {"Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K", "6
|
|||
ALIGNMENT_NOAUTO = ALIGNMENTS - {"Auto"}
|
||||
CR_LB_SET = {T_CHAR_CR, TAB_LINE_BREAK}
|
||||
|
||||
RegionSizePattern = compile("\s*(?P<base>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<size>(?:0x|0X)?[a-fA-F0-9]+)\s*")
|
||||
RegionSizeGuidPattern = compile("\s*(?P<base>\w+\.\w+[\.\w\[\]]*)\s*\|\s*(?P<size>\w+\.\w+[\.\w\[\]]*)\s*")
|
||||
RegionOffsetPcdPattern = compile("\s*(?P<base>\w+\.\w+[\.\w\[\]]*)\s*$")
|
||||
ShortcutPcdPattern = compile("\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*")
|
||||
BaseAddrValuePattern = compile('^0[xX][0-9a-fA-F]+')
|
||||
RegionSizePattern = compile(r"\s*(?P<base>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<size>(?:0x|0X)?[a-fA-F0-9]+)\s*")
|
||||
RegionSizeGuidPattern = compile(r"\s*(?P<base>\w+\.\w+[\.\w\[\]]*)\s*\|\s*(?P<size>\w+\.\w+[\.\w\[\]]*)\s*")
|
||||
RegionOffsetPcdPattern = compile(r"\s*(?P<base>\w+\.\w+[\.\w\[\]]*)\s*$")
|
||||
ShortcutPcdPattern = compile(r"\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*")
|
||||
BaseAddrValuePattern = compile(r'^0[xX][0-9a-fA-F]+')
|
||||
FileExtensionPattern = compile(r'([a-zA-Z][a-zA-Z0-9]*)')
|
||||
TokenFindPattern = compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
|
||||
AllIncludeFileList = []
|
||||
|
|
|
@ -733,7 +733,7 @@ class GenFds(object):
|
|||
if not os.path.exists(FfsPath[0]):
|
||||
continue
|
||||
MatchDict = {}
|
||||
ReFileEnds = compile('\S+(.ui)$|\S+(fv.sec.txt)$|\S+(.pe32.txt)$|\S+(.te.txt)$|\S+(.pic.txt)$|\S+(.raw.txt)$|\S+(.ffs.txt)$')
|
||||
ReFileEnds = compile(r'\S+(.ui)$|\S+(fv.sec.txt)$|\S+(.pe32.txt)$|\S+(.te.txt)$|\S+(.pic.txt)$|\S+(.raw.txt)$|\S+(.ffs.txt)$')
|
||||
FileList = os.listdir(FfsPath[0])
|
||||
for File in FileList:
|
||||
Match = ReFileEnds.search(File)
|
||||
|
|
|
@ -31,7 +31,7 @@ __copyright__ = "Copyright (c) 2008 - 2018, Intel Corporation. All rights reserv
|
|||
#====================================== Internal Libraries ========================================
|
||||
|
||||
#============================================== Code ===============================================
|
||||
symRe = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+) +([\da-fA-F]+)', re.UNICODE)
|
||||
symRe = re.compile(r'^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+) +([\da-fA-F]+)', re.UNICODE)
|
||||
|
||||
def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
|
||||
""" Parse map file to get binary patch pcd information
|
||||
|
@ -49,7 +49,7 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
|
|||
|
||||
if len(lines) == 0: return None
|
||||
firstline = lines[0].strip()
|
||||
if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):
|
||||
if re.match(r'^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):
|
||||
return _parseForXcodeAndClang9(lines, efifilepath)
|
||||
if (firstline.startswith("Archive member included ") and
|
||||
firstline.endswith(" file (symbol)")):
|
||||
|
@ -59,12 +59,12 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
|
|||
return _parseGeneral(lines, efifilepath)
|
||||
|
||||
def _parseForXcodeAndClang9(lines, efifilepath):
|
||||
valuePattern = re.compile('^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))')
|
||||
valuePattern = re.compile(r'^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))')
|
||||
status = 0
|
||||
pcds = []
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if status == 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \
|
||||
if status == 0 and (re.match(r'^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \
|
||||
or line == "# Symbols:"):
|
||||
status = 1
|
||||
continue
|
||||
|
@ -77,7 +77,7 @@ def _parseForXcodeAndClang9(lines, efifilepath):
|
|||
|
||||
def _parseForGCC(lines, efifilepath):
|
||||
""" Parse map file generated by GCC linker """
|
||||
dataPattern = re.compile('^.data._gPcd_BinaryPatch_([\w_\d]+)$')
|
||||
dataPattern = re.compile(r'^.data._gPcd_BinaryPatch_([\w_\d]+)$')
|
||||
status = 0
|
||||
imageBase = -1
|
||||
sections = []
|
||||
|
@ -136,7 +136,7 @@ def _parseGeneral(lines, efifilepath):
|
|||
status = 0 #0 - beginning of file; 1 - PE section definition; 2 - symbol table
|
||||
secs = [] # key = section name
|
||||
bPcds = []
|
||||
symPattern = re.compile('^[_]+gPcd_BinaryPatch_([\w]+)')
|
||||
symPattern = re.compile(r'^[_]+gPcd_BinaryPatch_([\w]+)')
|
||||
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
|
|
|
@ -28,15 +28,15 @@ __version__ = "%prog Version " + __version_number__
|
|||
__copyright__ = "Copyright (c) 2007-2018, Intel Corporation. All rights reserved."
|
||||
|
||||
## Regular expression for matching Line Control directive like "#line xxx"
|
||||
gLineControlDirective = re.compile('^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*)"')
|
||||
gLineControlDirective = re.compile(r'^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*)"')
|
||||
## Regular expression for matching "typedef struct"
|
||||
gTypedefPattern = re.compile("^\s*typedef\s+struct(\s+\w+)?\s*[{]*$", re.MULTILINE)
|
||||
gTypedefPattern = re.compile(r"^\s*typedef\s+struct(\s+\w+)?\s*[{]*$", re.MULTILINE)
|
||||
## Regular expression for matching "#pragma pack"
|
||||
gPragmaPattern = re.compile("^\s*#pragma\s+pack", re.MULTILINE)
|
||||
gPragmaPattern = re.compile(r"^\s*#pragma\s+pack", re.MULTILINE)
|
||||
## Regular expression for matching "typedef"
|
||||
gTypedef_SinglePattern = re.compile("^\s*typedef", re.MULTILINE)
|
||||
gTypedef_SinglePattern = re.compile(r"^\s*typedef", re.MULTILINE)
|
||||
## Regular expression for matching "typedef struct, typedef union, struct, union"
|
||||
gTypedef_MulPattern = re.compile("^\s*(typedef)?\s+(struct|union)(\s+\w+)?\s*[{]*$", re.MULTILINE)
|
||||
gTypedef_MulPattern = re.compile(r"^\s*(typedef)?\s+(struct|union)(\s+\w+)?\s*[{]*$", re.MULTILINE)
|
||||
|
||||
#
|
||||
# The following number pattern match will only match if following criteria is met:
|
||||
|
@ -44,14 +44,14 @@ gTypedef_MulPattern = re.compile("^\s*(typedef)?\s+(struct|union)(\s+\w+)?\s*[{]
|
|||
# as the pattern is greedily match, so it is ok for the gDecNumberPattern or gHexNumberPattern to grab the maximum match
|
||||
#
|
||||
## Regular expression for matching HEX number
|
||||
gHexNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])(0[xX])([0-9a-fA-F]+)(U(?=$|[^a-zA-Z0-9_]))?")
|
||||
gHexNumberPattern = re.compile(r"(?<=[^a-zA-Z0-9_])(0[xX])([0-9a-fA-F]+)(U(?=$|[^a-zA-Z0-9_]))?")
|
||||
## Regular expression for matching decimal number with 'U' postfix
|
||||
gDecNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])([0-9]+)U(?=$|[^a-zA-Z0-9_])")
|
||||
gDecNumberPattern = re.compile(r"(?<=[^a-zA-Z0-9_])([0-9]+)U(?=$|[^a-zA-Z0-9_])")
|
||||
## Regular expression for matching constant with 'ULL' 'LL' postfix
|
||||
gLongNumberPattern = re.compile("(?<=[^a-zA-Z0-9_])(0[xX][0-9a-fA-F]+|[0-9]+)U?LL(?=$|[^a-zA-Z0-9_])")
|
||||
gLongNumberPattern = re.compile(r"(?<=[^a-zA-Z0-9_])(0[xX][0-9a-fA-F]+|[0-9]+)U?LL(?=$|[^a-zA-Z0-9_])")
|
||||
|
||||
## Regular expression for matching "Include ()" in asl file
|
||||
gAslIncludePattern = re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE)
|
||||
gAslIncludePattern = re.compile(r"^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE)
|
||||
## Regular expression for matching C style #include "XXX.asl" in asl file
|
||||
gAslCIncludePattern = re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)
|
||||
## Patterns used to convert EDK conventions to EDK2 ECP conventions
|
||||
|
|
|
@ -109,7 +109,7 @@ LIBS = -lCommon
|
|||
variablePattern = re.compile(r'[\t\s]*0[xX][a-fA-F0-9]+$')
|
||||
SkuIdPattern = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*$')
|
||||
## regular expressions for finding decimal and hex numbers
|
||||
Pattern = re.compile('^[1-9]\d*|0$')
|
||||
Pattern = re.compile(r'^[1-9]\d*|0$')
|
||||
HexPattern = re.compile(r'0[xX][0-9a-fA-F]+$')
|
||||
## Regular expression for finding header file inclusions
|
||||
from AutoGen.GenMake import gIncludePattern
|
||||
|
@ -2829,7 +2829,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
# start generating makefile
|
||||
MakeApp = PcdMakefileHeader
|
||||
if sys.platform == "win32":
|
||||
MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) + 'INC = '
|
||||
MakeApp = MakeApp + r'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + r'APPNAME = %s\n' % (PcdValueInitName) + r'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) + 'INC = '
|
||||
else:
|
||||
MakeApp = MakeApp + PcdGccMakefile
|
||||
MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, PcdValueCommonName)) + \
|
||||
|
@ -2939,7 +2939,7 @@ class DscBuildData(PlatformBuildClassObject):
|
|||
MakeApp += "$(OBJECTS) : %s\n" % include_file
|
||||
if sys.platform == "win32":
|
||||
PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source\C\Common\PcdValueCommon.c"))
|
||||
MakeApp = MakeApp + '%s\PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)
|
||||
MakeApp = MakeApp + r'%s\PcdValueCommon.c : %s\n' % (self.OutputPath, PcdValueCommonPath)
|
||||
MakeApp = MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommonPath)
|
||||
else:
|
||||
PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c"))
|
||||
|
|
|
@ -1893,7 +1893,7 @@ class DecParser(MetaFileParser):
|
|||
self._SectionType = []
|
||||
ArchList = set()
|
||||
PrivateList = set()
|
||||
Line = re.sub(',[\s]*', TAB_COMMA_SPLIT, self._CurrentLine)
|
||||
Line = re.sub(r',[\s]*', TAB_COMMA_SPLIT, self._CurrentLine)
|
||||
for Item in Line[1:-1].split(TAB_COMMA_SPLIT):
|
||||
if Item == '':
|
||||
EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR,
|
||||
|
|
|
@ -40,6 +40,12 @@ http://opensource.org/licenses/bsd-license.php.
|
|||
#define IMAGE_FILE_MACHINE_X64 0x8664
|
||||
#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2
|
||||
#define IMAGE_FILE_MACHINE_ARM64 0xAA64
|
||||
#define IMAGE_FILE_MACHINE_RISCV32 0x5032
|
||||
#define IMAGE_FILE_MACHINE_RISCV64 0x5064
|
||||
#define IMAGE_FILE_MACHINE_RISCV128 0x5128
|
||||
#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232
|
||||
#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264
|
||||
|
||||
|
||||
//
|
||||
// EXE file formats
|
||||
|
@ -499,6 +505,20 @@ typedef struct {
|
|||
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16 9
|
||||
#define EFI_IMAGE_REL_BASED_DIR64 10
|
||||
|
||||
///
|
||||
/// Relocation types of RISC-V processor.
|
||||
///
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_HI20 5
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8
|
||||
|
||||
//
|
||||
// Relocation types of LoongArch processor.
|
||||
//
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA 8
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8
|
||||
|
||||
|
||||
///
|
||||
/// Line number format.
|
||||
///
|
||||
|
|
|
@ -34,6 +34,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||
#define IMAGE_FILE_MACHINE_X64 0x8664
|
||||
#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2
|
||||
#define IMAGE_FILE_MACHINE_ARM64 0xAA64
|
||||
#define IMAGE_FILE_MACHINE_RISCV32 0x5032
|
||||
#define IMAGE_FILE_MACHINE_RISCV64 0x5064
|
||||
#define IMAGE_FILE_MACHINE_RISCV128 0x5128
|
||||
#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232
|
||||
#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264
|
||||
|
||||
|
||||
//
|
||||
// EXE file formats
|
||||
|
@ -493,6 +499,19 @@ typedef struct {
|
|||
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16 9
|
||||
#define EFI_IMAGE_REL_BASED_DIR64 10
|
||||
|
||||
///
|
||||
/// Relocation types of RISC-V processor.
|
||||
///
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_HI20 5
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8
|
||||
|
||||
//
|
||||
// Relocation types of LoongArch processor.
|
||||
//
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA 8
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8
|
||||
|
||||
///
|
||||
/// Line number format.
|
||||
///
|
||||
|
|
|
@ -505,6 +505,12 @@ typedef struct {
|
|||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7
|
||||
#define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8
|
||||
|
||||
//
|
||||
// Relocation types of LoongArch processor.
|
||||
//
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA 8
|
||||
#define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8
|
||||
|
||||
///
|
||||
/// Line number format.
|
||||
///
|
||||
|
|
|
@ -60,9 +60,9 @@
|
|||
|
||||
//typedef UINTN size_t;
|
||||
|
||||
#define NSVG_PI (3.14159265358979323846264338327f)
|
||||
#define NSVG_PI_DEG (0.01745329251994f)
|
||||
#define NSVG_KAPPA90 (0.5522847493f) // Length proportional to radius of a cubic bezier handle for 90deg arcs.
|
||||
const float NSVG_PI = 3.141592653589793f;
|
||||
const float NSVG_PI_DEG = 0.01745329251994f;
|
||||
const float NSVG_KAPPA90 = 0.5522847493f; // Length proportional to radius of a cubic bezier handle for 90deg arcs.
|
||||
#define pow(x,n) PowF(x,n)
|
||||
#define sqrt(x) SqrtF(x)
|
||||
#define sqrtf(x) SqrtF(x)
|
||||
|
@ -219,9 +219,6 @@ void nsvg__outputDanglingPtr()
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
//int nsvg__shapesBound(NSVGshape *shapes, float* bounds);
|
||||
void nsvg__takeXformBounds(NSVGshape *shape, float *xform, float *bounds);
|
||||
void nsvg__deleteShapes(NSVGshape* shape);
|
||||
|
||||
|
@ -421,7 +418,7 @@ void nsvg__parseXML(char* input,
|
|||
while (*s) {
|
||||
if (*s == '<' && state == NSVG_XML_CONTENT) {
|
||||
// skip cdata
|
||||
if (strncmp(s, "<![CDATA[", 9) == 0) {
|
||||
if (strncmp(const_cast<const char*>(s), "<![CDATA[", 9) == 0) {
|
||||
s += 9;
|
||||
char* rv = strstr(s, "]]>");
|
||||
if (rv) s = rv + 3;
|
||||
|
@ -526,7 +523,7 @@ void nsvg__xformInverse(float* inv, float* t)
|
|||
inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet);
|
||||
}
|
||||
|
||||
void nsvg__xformPremultiply(float* t, float* s)
|
||||
void nsvg__xformPremultiply(float* t, float* s) // t=s*t
|
||||
{
|
||||
float s2[6];
|
||||
memcpy(s2, s, sizeof(float)*6);
|
||||
|
@ -546,7 +543,7 @@ static void nsvg__xformVec(float* dx, float* dy, float x, float y, float* t)
|
|||
*dy = x*t[1] + y*t[3];
|
||||
}
|
||||
|
||||
#define NSVG_EPSILON (1e-12)
|
||||
const double NSVG_EPSILON = 1e-12;
|
||||
|
||||
static int nsvg__ptInBounds(float* pt, float* bounds)
|
||||
{
|
||||
|
@ -1097,21 +1094,7 @@ static void nsvg__getLocalBounds(float* bounds, NSVGshape *shape) //, float* atX
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
static void nsvg__getSymbolBounds(NSVGparser* p)
|
||||
{
|
||||
NSVGsymbol* symbol = p->symbols;
|
||||
NSVGshape* shape = symbol->shapes;
|
||||
if (!shape) return;
|
||||
symbol->bounds[0] = FLT_MAX;
|
||||
symbol->bounds[1] = FLT_MAX;
|
||||
symbol->bounds[2] = -FLT_MAX;
|
||||
symbol->bounds[3] = -FLT_MAX;
|
||||
nsvg__shapesBound(shape, symbol->bounds);
|
||||
// nsvg__dumpFloat("Symbol has bounds", symbol->bounds, 4); //nothing
|
||||
nsvg__dumpFloat("Symbol has viewbox", symbol->viewBox, 4);
|
||||
}
|
||||
*/
|
||||
|
||||
static void nsvg__addShape(NSVGparser* p)
|
||||
{
|
||||
NSVGattrib* attr = nsvg__getAttr(p);
|
||||
|
@ -1145,14 +1128,7 @@ static void nsvg__addShape(NSVGparser* p)
|
|||
p->pathList = NULL;
|
||||
|
||||
shape->clip.count = attr->clipPathCount;
|
||||
// if (shape->clip.count > 0) {
|
||||
// shape->clip.index = (NSVGclipPathIndex*)nsvg__alloccopy(attr->clipPathCount * sizeof(NSVGclipPathIndex),
|
||||
// p->clipPathStack);
|
||||
// if (shape->clip.index == NULL) {
|
||||
// nsvg__delete(shape);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
for (int i=0; i<shape->clip.count; i++) {
|
||||
shape->clip.index[i] = p->clipPathStack[i];
|
||||
}
|
||||
|
@ -1169,9 +1145,7 @@ static void nsvg__addShape(NSVGparser* p)
|
|||
shape->fill.paint.gradientLink = nsvg__createGradientLink(attr->fillGradient);
|
||||
if (shape->fill.paint.gradientLink == NULL) {
|
||||
shape->fill.type = NSVG_PAINT_NONE;
|
||||
// if (shape->clip.index) {
|
||||
// nsvg__delete(shape->clip.index);
|
||||
// }
|
||||
|
||||
nsvg__delete(shape, "nsvg__addShape"_XS8);
|
||||
return;
|
||||
}
|
||||
|
@ -1198,9 +1172,7 @@ static void nsvg__addShape(NSVGparser* p)
|
|||
shape->stroke.paint.gradientLink = nsvg__createGradientLink(attr->strokeGradient);
|
||||
if (shape->stroke.paint.gradientLink == NULL) {
|
||||
shape->fill.type = NSVG_PAINT_NONE;
|
||||
// if (shape->clip.index) {
|
||||
// nsvg__delete(shape->clip.index);
|
||||
// }
|
||||
|
||||
nsvg__delete(shape, "nsvg__addShape"_XS8);
|
||||
return;
|
||||
}
|
||||
|
@ -1218,7 +1190,6 @@ static void nsvg__addShape(NSVGparser* p)
|
|||
}
|
||||
|
||||
// Set flags
|
||||
// shape->flags = ((attr->visible & NSVG_VIS_DISPLAY) && (attr->visible & NSVG_VIS_VISIBLE) ? NSVG_VIS_VISIBLE : 0x00);
|
||||
shape->flags = attr->visible;
|
||||
if (p->defsFlag) {
|
||||
shape->flags = 0;
|
||||
|
@ -1718,20 +1689,6 @@ static unsigned int nsvg__parseColorName(const char* str)
|
|||
return NSVG_RGB(128, 128, 128); //if not found then Grey50%
|
||||
}
|
||||
|
||||
/*
|
||||
static unsigned int nsvg__parseColorRGBA(const char* str)
|
||||
{
|
||||
int r = -1, g = -1, b = -1;
|
||||
float a = -1;
|
||||
char s1[32]="", s2[32]="", s3[32]="";
|
||||
sscanf(str + 5, "%d%[%%, \t]%d%[%%, \t]%d%[%%, \t]%f", &r, s1, &g, s2, &b, s3, &a);
|
||||
if (strchr(s1, '%')) {
|
||||
return NSVG_RGBA((r*255)/100,(g*255)/100,(b*255)/100,(a*255)/100);
|
||||
} else {
|
||||
return NSVG_RGBA(r,g,b,(a*255));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static unsigned int nsvg__parseColor(const char* str)
|
||||
{
|
||||
|
@ -2349,20 +2306,7 @@ static void nsvg__parseStyle(NSVGparser* p, const char* str)
|
|||
if (*str) ++str;
|
||||
}
|
||||
}
|
||||
/*
|
||||
static void nsvg__parseAttribs(NSVGparser* p, const char** dict)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; dict[i]; i += 2)
|
||||
{
|
||||
if (strcmp(dict[i], "style") == 0)
|
||||
nsvg__parseStyle(p, dict[i + 1]);
|
||||
else {
|
||||
nsvg__parseAttr(p, dict[i], dict[i + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static int nsvg__getArgsPerElement(char cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
|
@ -2593,7 +2537,6 @@ static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args,
|
|||
}
|
||||
dx = x1 - x2;
|
||||
dy = y1 - y2;
|
||||
// d = sqrtf(dx*dx + dy*dy);
|
||||
d = nsvg__vmag(dx, dy);
|
||||
if (d < 1e-6f || rx < 1e-6f || ry < 1e-6f) {
|
||||
// The arc degenerates to a line
|
||||
|
@ -2950,7 +2893,7 @@ static void nsvg__parseUse(NSVGparser* p, char** dict)
|
|||
shape = (NSVGshape*)nsvg__alloczero(sizeof(NSVGshape), "nsvg__parseUse shape2"_XS8);
|
||||
if (!shape) return;
|
||||
memcpy(shape->xform, xform, sizeof(float)*6);
|
||||
// nsvg__xformMultiply(shape->xform, &xform[0]);
|
||||
|
||||
shape->isSymbol = true;
|
||||
shape->link = refSym->shapes;
|
||||
shape->group = attr->group;
|
||||
|
@ -2970,17 +2913,6 @@ static void nsvg__parseUse(NSVGparser* p, char** dict)
|
|||
// nsvg__dumpFloat("used symbol has bounds", shape->bounds, 4);
|
||||
}
|
||||
|
||||
/* //there can't be own gradient
|
||||
// DBG("paint type=%d\n", shape->fill.type);
|
||||
if (shape->fill.type == NSVG_PAINT_GRADIENT_LINK) {
|
||||
shape->fill.gradientLink = nsvg__createGradientLink(ref->fill.gradientLink->id);
|
||||
}
|
||||
|
||||
if (shape->stroke.type == NSVG_PAINT_GRADIENT_LINK) {
|
||||
shape->stroke.gradientLink = nsvg__createGradientLink(ref->stroke.gradientLink->id);
|
||||
}
|
||||
*/
|
||||
|
||||
shape->next = NULL;
|
||||
shape->flags = NSVG_VIS_DISPLAY | NSVG_VIS_VISIBLE; //use always visible
|
||||
|
||||
|
@ -3336,85 +3268,6 @@ static void nsvg__parsePoly(NSVGparser* p, char** attr, int closeFlag)
|
|||
nsvg__addShape(p);
|
||||
}
|
||||
|
||||
/* Slice - I dont know what it should be
|
||||
static void nsvg__parseIMAGE(NSVGparser* p, const char** attr)
|
||||
{
|
||||
float x = 0.0f;
|
||||
float y = 0.0f;
|
||||
float w = 0.0f;
|
||||
float h = 0.0f;
|
||||
int i;
|
||||
const char *href = NULL;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) {
|
||||
if (strcmp(attr[i], "x") == 0) {
|
||||
x = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p));
|
||||
} else
|
||||
if (strcmp(attr[i], "y") == 0) {
|
||||
y = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p));
|
||||
} else
|
||||
if (strcmp(attr[i], "width") == 0) {
|
||||
w = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p));
|
||||
} else
|
||||
if (strcmp(attr[i], "height") == 0) {
|
||||
h = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p));
|
||||
} else
|
||||
if (strcmp(attr[i], "xlink:href") == 0) {
|
||||
href = attr[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (w != 0.0f && h != 0.0f) {
|
||||
nsvg__resetPath(p);
|
||||
|
||||
NSVGattrib* attr = nsvg__getAttr(p);
|
||||
float scale = 1.0f;
|
||||
NSVGshape *shape, *cur, *prev;
|
||||
|
||||
if (href == NULL)
|
||||
return;
|
||||
|
||||
shape = (NSVGshape*)nsvg__alloczero(sizeof(NSVGshape));
|
||||
if (shape == NULL) return;
|
||||
|
||||
memcpy(shape->id, attr->id, sizeof shape->id);
|
||||
memcpy(shape->title, attr->title, sizeof shape->title);
|
||||
// DBG("shapeID=%s\n", shape->id);
|
||||
shape->group = attr->group;
|
||||
scale = nsvg__getAverageScale(attr->xform);
|
||||
shape->opacity = attr->opacity;
|
||||
shape->image_href = href;
|
||||
p->plist = NULL;
|
||||
|
||||
shape->bounds[0] = x;
|
||||
shape->bounds[1] = y;
|
||||
shape->bounds[2] = x+w;
|
||||
shape->bounds[3] = y+h;
|
||||
|
||||
nsvg__xformIdentity(shape->xform);
|
||||
|
||||
// Set flags
|
||||
shape->flags = (attr->visible ? NSVG_VIS_DISPLAY | NSVG_VIS_VISIBLE : 0x00);
|
||||
|
||||
// Add to tail
|
||||
prev = NULL;
|
||||
cur = p->image->shapes;
|
||||
while (cur != NULL) {
|
||||
prev = cur;
|
||||
cur = cur->next;
|
||||
}
|
||||
if (prev == NULL)
|
||||
p->image->shapes = shape;
|
||||
else
|
||||
prev->next = shape;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//parse embedded PNG image
|
||||
static void nsvg__parseEmbeddedPNG(NSVGparser* p, char** dict)
|
||||
{
|
||||
|
@ -4143,17 +3996,12 @@ static void nsvg__startElement(void* ud, const char* el, char** dict)
|
|||
} else if (strcmp(el, "title") == 0) {
|
||||
p->titleFlag = 1;
|
||||
} else if (strcmp(el, "image") == 0) {
|
||||
// nsvg__pushAttr(p);
|
||||
// nsvg__parseIMAGE(p, dict);
|
||||
nsvg__parseEmbeddedPNG(p, dict);
|
||||
// nsvg__popAttr(p);
|
||||
} else if (strcmp(el, "pattern") == 0) {
|
||||
nsvg__parsePattern(p, dict);
|
||||
p->patternFlag = 1;
|
||||
|
||||
} else if (strcmp(el, "clover:theme") == 0) {
|
||||
ThemeX->parseTheme((void*)p, dict);
|
||||
|
||||
} else {
|
||||
strncpy(p->unknown, el, 63);
|
||||
}
|
||||
|
@ -4173,7 +4021,6 @@ static void nsvg__endElement(void* ud, const char* el)
|
|||
} else if (strcmp(el, "pattern") == 0) {
|
||||
p->patternFlag = 0;
|
||||
} else if (strcmp(el, "symbol") == 0) {
|
||||
// nsvg__getSymbolBounds(p); //no sense
|
||||
nsvg__popAttr(p);
|
||||
p->symbolFlag = 0;
|
||||
} else if (strcmp(el, "svg") == 0) {
|
||||
|
@ -4719,6 +4566,3 @@ void nsvg__deleteImage(NSVGimage* image)
|
|||
}
|
||||
nsvg__delete(image, "nsvgDelete image"_XS8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue