Lines Matching refs:fmt
76 def CalcSize(fmt): argument
77 if "A" in fmt:
78 fmt = fmt.replace("A", "s")
80 fmt = (re.split('\d+$', fmt)[0])
81 return struct.calcsize(fmt)
83 def CalcNumElements(fmt): argument
84 prevlen = len(fmt)
85 fmt = fmt.replace("S", "")
86 numstructs = prevlen - len(fmt)
87 size = CalcSize(fmt)
88 elements = struct.unpack(fmt, b"\x00" * size)
92 def Struct(name, fmt, fieldnames, substructs={}): argument
124 for i in range(len(fmt)):
125 if fmt[i] == "S":
127 index = CalcNumElements(fmt[:i])
131 elif fmt[i] == "A":
133 index = CalcNumElements(fmt[:i])
138 _format += fmt[i]
157 % (fmt, numfields, fieldnames, len(_fieldnames)))