CType
class CType (View source)
Class containing C type information.
Constants
TYPE_VOID
Since: 8.1
|
|
TYPE_FLOAT
Since: 8.1
|
|
TYPE_DOUBLE
Since: 8.1
|
|
TYPE_LONGDOUBLE
Since: 8.1
|
Please note that this constant may NOT EXIST if there is
no long double support on the current platform. |
TYPE_UINT8
Since: 8.1
|
|
TYPE_SINT8
Since: 8.1
|
|
TYPE_UINT16
Since: 8.1
|
|
TYPE_SINT16
Since: 8.1
|
|
TYPE_UINT32
Since: 8.1
|
|
TYPE_SINT32
Since: 8.1
|
|
TYPE_UINT64
Since: 8.1
|
|
TYPE_SINT64
Since: 8.1
|
|
TYPE_ENUM
Since: 8.1
|
|
TYPE_BOOL
Since: 8.1
|
|
TYPE_CHAR
Since: 8.1
|
|
TYPE_POINTER
Since: 8.1
|
|
TYPE_FUNC
Since: 8.1
|
|
TYPE_ARRAY
Since: 8.1
|
|
TYPE_STRUCT
Since: 8.1
|
|
ATTR_CONST
Since: 8.1
|
|
ATTR_INCOMPLETE_TAG
Since: 8.1
|
|
ATTR_VARIADIC
Since: 8.1
|
|
ATTR_INCOMPLETE_ARRAY
Since: 8.1
|
|
ATTR_VLA
Since: 8.1
|
|
ATTR_UNION
Since: 8.1
|
|
ATTR_PACKED
Since: 8.1
|
|
ATTR_MS_STRUCT
Since: 8.1
|
|
ATTR_GCC_STRUCT
Since: 8.1
|
|
ABI_DEFAULT
Since: 8.1
|
|
ABI_CDECL
Since: 8.1
|
|
ABI_FASTCALL
Since: 8.1
|
|
ABI_THISCALL
Since: 8.1
|
|
ABI_STDCALL
Since: 8.1
|
|
ABI_PASCAL
Since: 8.1
|
|
ABI_REGISTER
Since: 8.1
|
|
ABI_MS
Since: 8.1
|
|
ABI_SYSV
Since: 8.1
|
|
ABI_VECTORCALL
Since: 8.1
|
|
Methods
Returns the name of the type.
Returns the identifier of the root type.
Returns the size of the type in bytes.
Returns the alignment of the type in bytes.
Returns the bit-mask of type attributes.
Returns the identifier of the enum value type.
Returns the type of array elements.
Returns the size of an array.
Returns the original type of the pointer.
Returns the field string names of a structure or union.
Returns the offset of the structure by the name of this field. In the case that the type is a union, then for each field of this type the offset will be equal to 0.
Returns the field type of a structure or union.
Returns the application binary interface (ABI) identifier with which you can call the function.
Returns the return type of the function.
Returns the number of arguments to the function.
Returns the type of the function argument by its numeric index.
Details
string
getName()
Returns the name of the type.
int
getKind()
Returns the identifier of the root type.
Value may be one of:
- {\FFI\CType::TYPE_VOID} - {\FFI\CType::TYPE_FLOAT} - {\FFI\CType::TYPE_DOUBLE} - {\FFI\CType::TYPE_LONGDOUBLE} - {\FFI\CType::TYPE_UINT8} - {\FFI\CType::TYPE_SINT8} - {\FFI\CType::TYPE_UINT16} - {\FFI\CType::TYPE_SINT16} - {\FFI\CType::TYPE_UINT32} - {\FFI\CType::TYPE_SINT32} - {\FFI\CType::TYPE_UINT64} - {\FFI\CType::TYPE_SINT64} - {\FFI\CType::TYPE_ENUM} - {\FFI\CType::TYPE_BOOL} - {\FFI\CType::TYPE_CHAR} - {\FFI\CType::TYPE_POINTER} - {\FFI\CType::TYPE_FUNC} - {\FFI\CType::TYPE_ARRAY} - {\FFI\CType::TYPE_STRUCT}
int
getSize()
Returns the size of the type in bytes.
int
getAlignment()
Returns the alignment of the type in bytes.
int
getAttributes()
Returns the bit-mask of type attributes.
int
getEnumKind()
Returns the identifier of the enum value type.
Value may be one of:
CType
getArrayElementType()
Returns the type of array elements.
int
getArrayLength()
Returns the size of an array.
CType
getPointerType()
Returns the original type of the pointer.
array
getStructFieldNames()
Returns the field string names of a structure or union.
int
getStructFieldOffset(string $name)
Returns the offset of the structure by the name of this field. In the case that the type is a union, then for each field of this type the offset will be equal to 0.
CType
getStructFieldType(string $name)
Returns the field type of a structure or union.
int
getFuncABI()
Returns the application binary interface (ABI) identifier with which you can call the function.
Value may be one of:
CType
getFuncReturnType()
Returns the return type of the function.
int
getFuncParameterCount()
Returns the number of arguments to the function.
CType
getFuncParameterType(int $index)
Returns the type of the function argument by its numeric index.