MCPcopy Create free account
hub / github.com/numpy/numpy / GlobalVarApi

Class GlobalVarApi

numpy/core/code_generators/genapi.py:357–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 return astr
356
357class GlobalVarApi:
358 def __init__(self, name, index, type, api_name):
359 self.name = name
360 self.index = index
361 self.type = type
362 self.api_name = api_name
363
364 def define_from_array_api_string(self):
365 return "#define %s (*(%s *)%s[%d])" % (self.name,
366 self.type,
367 self.api_name,
368 self.index)
369
370 def array_api_define(self):
371 return " (%s *) &%s" % (self.type, self.name)
372
373 def internal_define(self):
374 astr = """\
375extern NPY_NO_EXPORT %(type)s %(name)s;
376""" % {'type': self.type, 'name': self.name}
377 return astr
378
379# Dummy to be able to consistently use *Api instances for all items in the
380# array api

Callers 1

do_generate_apiFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected