utmp, wtmp, lastlog reader

How to read utmp, wtmp and lastlog files present in /var/log directory. Should I write my own application to parse or is there any ready tool that I can use.