Build and apply a ctypes prototype complete with parameter flags.
(name, result, *args)
| 44 | |
| 45 | |
| 46 | def cfunc(name, result, *args): |
| 47 | """Build and apply a ctypes prototype complete with parameter flags.""" |
| 48 | atypes = [] |
| 49 | aflags = [] |
| 50 | for arg in args: |
| 51 | atypes.append(arg[1]) |
| 52 | aflags.append((arg[2], arg[0]) + arg[3:]) |
| 53 | return CFUNCTYPE(result, *atypes)((name, _fl), tuple(aflags)) |
| 54 | |
| 55 | |
| 56 | api_version = "1.2" |