⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bgenstackbuffer.py

📁 reduced python source for embedded apps
💻 PY
字号:
"""Buffers allocated on the stack."""from bgenBuffer import FixedInputBufferType, FixedOutputBufferTypeclass StackOutputBufferType(FixedOutputBufferType):	"""Fixed output buffer allocated on the stack -- passed as (buffer, size).	Instantiate with the buffer size as parameter.	"""	def passOutput(self, name):		return "%s__out__, %s" % (name, self.size)class VarStackOutputBufferType(StackOutputBufferType):	"""Output buffer allocated on the stack -- passed as (buffer, &size).	Instantiate with the buffer size as parameter.	"""	def declareSize(self, name):		Output("int %s__len__ = %s;", name, self.size)	def passOutput(self, name):		return "%s__out__, &%s__len__" % (name, name)	def mkvalueArgs(self, name):		return "%s__out__, (int)%s__len__" % (name, name)class VarVarStackOutputBufferType(VarStackOutputBufferType):	"""Output buffer allocated on the stack -- passed as (buffer, size, &size).	Instantiate with the buffer size as parameter.	"""	def passOutput(self, name):		return "%s__out__, %s__len__, &%s__len__" % (name, name, name)class ReturnVarStackOutputBufferType(VarStackOutputBufferType):	"""Output buffer allocated on the stack -- passed as (buffer, size) -> size.	Instantiate with the buffer size as parameter.	The function's return value is the size.	(XXX Should have a way to suppress returning it separately, too.)	"""	def passOutput(self, name):		return "%s__out__, %s__len__" % (name, name)	def mkvalueArgs(self, name):		return "%s__out__, (int)_rv" % name

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -