Every record has a pointer to a struct dbRecordType *rdes, which is defined in a file named base.h in Epics Base, which is somehow included into every record. This typedef struct has a char * name, which should give the type of the record (ai, ao, bi, bo...).
-- MartinFeldmann - 04 Jan 2007