3 def iterate_dll (head, field, match, pfield):
5 Iterates over a DLL data structure
7 head: name of the symbol denoting the head of the DLL
8 field: the field that should be search for match
9 match: the mathing value for field
10 pfield: the field whose value is to be printed for matched elements; None to
11 print all fields of the matched elemented
14 (symbol, _) = lookup_symbol (head)
16 print "Can't find symbol: " + head
19 symbol_val = symbol.value().derefence
20 if match == symbol_val[field]:
24 print symbol_val[pfield]
25 symbol = symbol_val["next"]