Translates the C functions that are (int, char**, n char*, and optional extra types in *args) to a more pythonic version that wraps the char** arg in the appropriate type.
(func, n, *args)
| 19 | return [c_char_p]*n |
| 20 | |
| 21 | def _var_string_args_func(func, n, *args): |
| 22 | ''' |
| 23 | Translates the C functions that are |
| 24 | (int, char**, n char*, and optional extra types in *args) |
| 25 | to a more pythonic version that wraps the char** arg in |
| 26 | the appropriate type. |
| 27 | ''' |
| 28 | def call_func(one, two, *rest): |
| 29 | arr_type = c_char_p*len(two) |
| 30 | func.argtypes = [c_int, arr_type] + _string_args(n) + list(args) |
| 31 | arr = arr_type(*map(c_char_p, two)) |
| 32 | return func(one, arr, *rest) |
| 33 | return call_func |
| 34 | |
| 35 | def _handle_string_func(func, *moretypes): |
| 36 | ''' |