add map func for c struct