| 379 | # Dummy to be able to consistently use *Api instances for all items in the |
| 380 | # array api |
| 381 | class BoolValuesApi: |
| 382 | def __init__(self, name, index, api_name): |
| 383 | self.name = name |
| 384 | self.index = index |
| 385 | self.type = 'PyBoolScalarObject' |
| 386 | self.api_name = api_name |
| 387 | |
| 388 | def define_from_array_api_string(self): |
| 389 | return "#define %s ((%s *)%s[%d])" % (self.name, |
| 390 | self.type, |
| 391 | self.api_name, |
| 392 | self.index) |
| 393 | |
| 394 | def array_api_define(self): |
| 395 | return " (void *) &%s" % self.name |
| 396 | |
| 397 | def internal_define(self): |
| 398 | astr = """\ |
| 399 | extern NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2]; |
| 400 | """ |
| 401 | return astr |
| 402 | |
| 403 | class FunctionApi: |
| 404 | def __init__(self, name, index, annotations, return_type, args, api_name): |