(bind-func toString
"specialised toString function for PmEvent*"
(lambda (pmevent:PmEvent*)
(let ((str:i8* (salloc 256)))
(sprintf str "<PmEvent: type=%d chan=%d data1=%d data2=%d timestamp=%d>"
(Pm_Message_Type (tref pmevent 0))
(Pm_Message_Channel (tref pmevent 0))
(Pm_Message_Data1 (tref pmevent 0))
(Pm_Message_Data2 (tref pmevent 0))
(tref pmevent 1))
(String str))))