Define ctypes structures, argtypes and restypes; fix for redmine issue #9105