# is_buffer boolean Is buffer access type
# has_attributes boolean Has C dot-selectable attributes
# default_value string Initial value
- # parsetuple_format string Format char for PyArg_ParseTuple
# pymemberdef_typecode string Type code for PyMemberDef struct
#
# declaration_code(entity_code,
is_buffer = 0
has_attributes = 0
default_value = ""
- parsetuple_format = ""
pymemberdef_typecode = None
def resolve(self):
is_pyobject = 1
default_value = "0"
- parsetuple_format = "O"
pymemberdef_typecode = "T_OBJECT"
buffer_defaults = None
is_numeric = 1
default_value = "0"
- parsetuple_formats = ( # rank -> format
- "BHIk??K???", # unsigned
- "bhil??Lfd?", # assumed signed
- "bhil??Lfd?", # explicitly signed
- )
-
sign_words = ("unsigned ", "", "signed ")
def __init__(self, rank, signed = 1, pymemberdef_typecode = None):
self.rank = rank
self.signed = signed
- ptf = self.parsetuple_formats[signed][rank]
- if ptf == '?':
- ptf = None
- self.parsetuple_format = ptf
self.pymemberdef_typecode = pymemberdef_typecode
def sign_and_name(self):
class CUTF8CharArrayType(CStringType, CArrayType):
# C 'char []' type.
- parsetuple_format = "s"
pymemberdef_typecode = "T_STRING_INPLACE"
is_unicode = 1
class CCharArrayType(CStringType, CArrayType):
# C 'char []' type.
- parsetuple_format = "s"
pymemberdef_typecode = "T_STRING_INPLACE"
def __init__(self, size):
class CCharPtrType(CStringType, CPtrType):
# C 'char *' type.
- parsetuple_format = "s"
pymemberdef_typecode = "T_STRING"
def __init__(self):