Lines Matching refs:fmt
75 def CalcSize(fmt): argument
76 if "A" in fmt:
77 fmt = fmt.replace("A", "s")
78 return struct.calcsize(fmt)
80 def CalcNumElements(fmt): argument
81 prevlen = len(fmt)
82 fmt = fmt.replace("S", "")
83 numstructs = prevlen - len(fmt)
84 size = CalcSize(fmt)
85 elements = struct.unpack(fmt, "\x00" * size)
89 def Struct(name, fmt, fieldnames, substructs={}): argument
121 for i in xrange(len(fmt)):
122 if fmt[i] == "S":
124 index = CalcNumElements(fmt[:i])
128 elif fmt[i] == "A":
130 index = CalcNumElements(fmt[:i])
135 _format += fmt[i]
154 % (fmt, numfields, fieldnames, len(_fieldnames)))