C 类型句柄

(PHP 7 >= 7.4.0, PHP 8)

简介

类概要

final class FFI\CType {
/* 常量 */
public const int TYPE_VOID;
public const int TYPE_FLOAT;
public const int TYPE_DOUBLE;
public const int TYPE_LONGDOUBLE;
public const int TYPE_UINT8;
public const int TYPE_SINT8;
public const int TYPE_UINT16;
public const int TYPE_SINT16;
public const int TYPE_UINT32;
public const int TYPE_SINT32;
public const int TYPE_UINT64;
public const int TYPE_SINT64;
public const int TYPE_ENUM;
public const int TYPE_BOOL;
public const int TYPE_CHAR;
public const int TYPE_POINTER;
public const int TYPE_FUNC;
public const int TYPE_ARRAY;
public const int TYPE_STRUCT;
public const int ATTR_CONST;
public const int ATTR_INCOMPLETE_TAG;
public const int ATTR_VARIADIC;
public const int ATTR_VLA;
public const int ATTR_UNION;
public const int ATTR_PACKED;
public const int ATTR_MS_STRUCT;
public const int ATTR_GCC_STRUCT;
public const int ABI_DEFAULT;
public const int ABI_CDECL;
public const int ABI_FASTCALL;
public const int ABI_THISCALL;
public const int ABI_STDCALL;
public const int ABI_PASCAL;
public const int ABI_REGISTER;
public const int ABI_MS;
public const int ABI_SYSV;
public const int ABI_VECTORCALL;
/* 方法 */
public getAlignment(): int
public getAttributes(): int
public getEnumKind(): int
public getFuncABI(): int
public getKind(): int
public getName(): string
public getSize(): int
}

目录

添加注释

用户贡献的注释 1 个注释

0
scorninpc at php dot net
4 年前
如果要检查类型是否正确,可以比较 CType。

\FFI::typeof(\FFI::addr($a)) == \FFI::typeof(\FFI::new("void *"))

CType 需要一些方法,比如 equal() 或 toString(),但是......
To Top