Since: 7.4

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

string
getName()

Returns the name of the type.

int
getKind()

Returns the identifier of the root type.

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.

getArrayElementType()

Returns the type of array elements.

int
getArrayLength()

Returns the size of an array.

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.

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.

getFuncReturnType()

Returns the return type of the function.

int
getFuncParameterCount()

Returns the number of arguments to the function.

getFuncParameterType(int $index)

Returns the type of the function argument by its numeric index.

Details

string getName()

Since: 8.0

Returns the name of the type.

Return Value

string

int getSize()

Since: 8.1

Returns the size of the type in bytes.

Return Value

int

int getAlignment()

Since: 8.1

Returns the alignment of the type in bytes.

Return Value

int

int getAttributes()

Since: 8.1

Returns the bit-mask of type attributes.

Return Value

int

int getEnumKind()

Since: 8.1

Returns the identifier of the enum value type.

Value may be one of:

Return Value

int

Exceptions

Exception

CType getArrayElementType()

Since: 8.1

Returns the type of array elements.

Return Value

CType

Exceptions

Exception

int getArrayLength()

Since: 8.1

Returns the size of an array.

Return Value

int

Exceptions

Exception

CType getPointerType()

Since: 8.1

Returns the original type of the pointer.

Return Value

CType

Exceptions

Exception

array getStructFieldNames()

Since: 8.1

Returns the field string names of a structure or union.

Return Value

array

Exceptions

Exception

int getStructFieldOffset(string $name)

Since: 8.1

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.

Parameters

string $name

Return Value

int

Exceptions

Exception

CType getStructFieldType(string $name)

Since: 8.1

Returns the field type of a structure or union.

Parameters

string $name

Return Value

CType

Exceptions

Exception

int getFuncABI()

Since: 8.1

Return Value

int

Exceptions

Exception

CType getFuncReturnType()

Since: 8.1

Returns the return type of the function.

Return Value

CType

Exceptions

Exception

int getFuncParameterCount()

Since: 8.1

Returns the number of arguments to the function.

Return Value

int

Exceptions

Exception

CType getFuncParameterType(int $index)

Since: 8.1

Returns the type of the function argument by its numeric index.

Parameters

int $index

Return Value

CType

Exceptions

Exception