| """ |
| ISO_C_BINDING maps for f2py2e. |
| Only required declarations/macros/functions will be used. |
| |
| Copyright 1999 -- 2011 Pearu Peterson all rights reserved. |
| Copyright 2011 -- present NumPy Developers. |
| Permission to use, modify, and distribute this software is given under the |
| terms of the NumPy License. |
| |
| NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. |
| """ |
| |
| iso_c_binding_map = { |
| 'integer': { |
| 'c_int': 'int', |
| 'c_short': 'short', |
| 'c_long': 'long', |
| 'c_long_long': 'long_long', |
| 'c_signed_char': 'signed_char', |
| 'c_size_t': 'unsigned', |
| 'c_int8_t': 'signed_char', |
| 'c_int16_t': 'short', |
| 'c_int32_t': 'int', |
| 'c_int64_t': 'long_long', |
| 'c_int_least8_t': 'signed_char', |
| 'c_int_least16_t': 'short', |
| 'c_int_least32_t': 'int', |
| 'c_int_least64_t': 'long_long', |
| 'c_int_fast8_t': 'signed_char', |
| 'c_int_fast16_t': 'short', |
| 'c_int_fast32_t': 'int', |
| 'c_int_fast64_t': 'long_long', |
| 'c_intmax_t': 'long_long', |
| 'c_intptr_t': 'long', |
| 'c_ptrdiff_t': 'long', |
| }, |
| 'real': { |
| 'c_float': 'float', |
| 'c_double': 'double', |
| 'c_long_double': 'long_double' |
| }, |
| 'complex': { |
| 'c_float_complex': 'complex_float', |
| 'c_double_complex': 'complex_double', |
| 'c_long_double_complex': 'complex_long_double' |
| }, |
| 'logical': { |
| 'c_bool': 'unsigned_char' |
| }, |
| 'character': { |
| 'c_char': 'char' |
| } |
| } |
|
|
| |
| isoc_c2pycode_map = {} |
| iso_c2py_map = {} |
|
|
| isoc_kindmap = {} |
| for fortran_type, c_type_dict in iso_c_binding_map.items(): |
| for c_type in c_type_dict.keys(): |
| isoc_kindmap[c_type] = fortran_type |
|
|