The length of this argument list is getting way out of hand. Perhaps we should consider storing them in a struct. Also, using pointer for the read/write arguments makes it somewhat clearer which argument are modified and which are read-only.