docs(includes): R11 注释英文化——75 个文件的中文注释改写为英文短注释
按规范「注释只讲解作用,不掺杂历史原因,尽量英文」:把 includes 下 75 个 .vp 的中文 # 注释与三引号 docstring 改写为英文,每个注释块压到 2 行以内。 保留要点:作用、约束、危险警告(不得/必须/注意)、ABI 与类型约定(如 BYTEPTR | t.CPtr = i8** 的跨模块坍缩坑)、位宽/长度约定、fail-fast 要求、内存与句柄所有权。 未动:文件头注释(规范豁免,仍是中文)、运行时中文字符串常量(printf / fatal_error / MlirFail 等用户可见消息,属代码字面量)。 验证:独立脚本比对 HEAD 与工作区的代码骨架(剥离 # 注释与三引号 docstring 后的非空行)——75 个文件逐字节一致;行尾 CRLF/LF 未被改动;全文剩余中文仅 547 行头注释、0 条行尾注释。bootstrap 三重重编 SUCCESS;全量 77/77 顺序回归通过。
This commit is contained in:
1 parent
27121f56a7
commit
e71daeea0e
75 files changed
+3040
-4214
No files matched your search
+14
-14
@@ -14,18 +14,18 @@ define X509Version2 = 1
|
||||
define X509Version3 = 2
|
||||
|
||||
# ============================================================
|
||||
# 1) 证书对象生命周期
|
||||
# 1) Certificate object lifecycle
|
||||
# ============================================================
|
||||
# X509 *X509_new(void) / void X509_free(X509 *a)
|
||||
extern def X509_new() -> X509Ptr
|
||||
extern def X509_free(a: X509Ptr)
|
||||
# int i2d_X509(X509 *a, unsigned char **pp) / X509 *d2i_X509(X509 **a, const unsigned char **pp, long length)
|
||||
# (pp 语义复杂,Viper 端建议用 d2i_X509_bio/i2d_X509_bio,故不暴露裸 d2i/i2d)
|
||||
# (pp semantics are complex; use d2i_X509_bio/i2d_X509_bio, so raw d2i/i2d are not exposed)
|
||||
extern def d2i_X509_bio(bp: BioPtr, x509: bytes) -> X509Ptr
|
||||
extern def i2d_X509_bio(bp: BioPtr, x509: X509Ptr) -> int
|
||||
|
||||
# ============================================================
|
||||
# 2) 证书字段读取
|
||||
# 2) Certificate field access
|
||||
# ============================================================
|
||||
# long X509_get_version(const X509 *x)
|
||||
extern def X509_get_version(x: X509Ptr) -> int32
|
||||
@@ -51,7 +51,7 @@ extern def X509_digest(data: X509Ptr, type: EvpMdPtr, md: bytes, len: bytes) ->
|
||||
extern def X509_verify(a: X509Ptr, r: EvpPkeyPtr) -> int
|
||||
|
||||
# ============================================================
|
||||
# 3) X509_NAME 读取(subject/issuer 各 RDN 段)
|
||||
# 3) X509_NAME access (subject/issuer RDN entries)
|
||||
# ============================================================
|
||||
# int X509_NAME_entry_count(const X509_NAME *name)
|
||||
extern def X509_NAME_entry_count(name: X509NamePtr) -> int
|
||||
@@ -65,11 +65,11 @@ extern def X509_NAME_ENTRY_get_object(ne: X509NameEntryPtr) -> Asn1ObjectPtr
|
||||
extern def X509_NAME_ENTRY_get_data(ne: X509NameEntryPtr) -> Asn1StringPtr
|
||||
# int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid, char *buf, int len)
|
||||
extern def X509_NAME_get_text_by_NID(name: X509NamePtr, nid: int, buf: bytes, len: int) -> int
|
||||
# char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size) → 返回指向 buf 的指针
|
||||
# char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size) -> returns pointer to buf
|
||||
extern def X509_NAME_oneline(a: X509NamePtr, buf: bytes, size: int) -> str
|
||||
|
||||
# ============================================================
|
||||
# 4) 扩展(SAN 等)
|
||||
# 4) Extensions (SAN, ...)
|
||||
# ============================================================
|
||||
# int X509_get_ext_count(const X509 *x)
|
||||
extern def X509_get_ext_count(x: X509Ptr) -> int
|
||||
@@ -87,30 +87,30 @@ extern def X509_EXTENSION_get_data(ne: X509ExtensionPtr) -> Asn1OctetStringPtr
|
||||
extern def X509V3_EXT_print(out: BioPtr, ext: X509ExtensionPtr,
|
||||
flag: uint32, indent: int) -> int
|
||||
|
||||
# GENERAL_NAME 遍历(SAN:DNS/URI/IP/email)
|
||||
# GENERAL_NAME iteration (SAN: DNS/URI/IP/email)
|
||||
extern def GENERAL_NAME_free(a: GeneralNamePtr)
|
||||
extern def GENERAL_NAMES_free(a: GeneralNamesPtr)
|
||||
# int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
|
||||
extern def GENERAL_NAME_print(out: BioPtr, gen: GeneralNamePtr) -> int
|
||||
# 通用 OPENSSL 栈访问(STACK_OF 的内核,宏 sk_xxx_num/value 最终落到这)
|
||||
# Generic OPENSSL stack access (backing STACK_OF; sk_xxx_num/value macros land here)
|
||||
# int OPENSSL_sk_num(const OPENSSL_STACK *st)
|
||||
extern def OPENSSL_sk_num(st: bytes) -> int
|
||||
# void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
|
||||
extern def OPENSSL_sk_value(st: bytes, i: int) -> GeneralNamePtr
|
||||
# void OPENSSL_sk_free(OPENSSL_STACK *st)
|
||||
extern def OPENSSL_sk_free(st: bytes)
|
||||
# const char *OBJ_nid2sn ... 已放 objects.vp;此处放 GNR 常量
|
||||
# const char *OBJ_nid2sn ... lives in objects.vp; GNR constants go here
|
||||
define GenEmail = 1
|
||||
define GenDns = 2
|
||||
define GenUri = 6
|
||||
define GenIpadd = 7
|
||||
|
||||
# ---- SAN 便捷读取(把某类 GENERAL_NAME 数量统计)----
|
||||
# ---- SAN convenience access (count GENERAL_NAME entries) ----
|
||||
def x509_san_count(gns: GeneralNamesPtr) -> int:
|
||||
return OPENSSL_sk_num(gns)
|
||||
|
||||
# ============================================================
|
||||
# 5) 证书链校验(X509_STORE_CTX)
|
||||
# 5) Certificate chain verification (X509_STORE_CTX)
|
||||
# ============================================================
|
||||
# X509_STORE *X509_STORE_new(void) / void X509_STORE_free(X509_STORE *v)
|
||||
extern def X509_STORE_new() -> X509StorePtr
|
||||
@@ -149,7 +149,7 @@ extern def X509_STORE_CTX_get_current_cert(ctx: X509StoreCtxPtr) -> X509Ptr
|
||||
extern def X509_verify_cert_error_string(n: int32) -> str
|
||||
|
||||
# ============================================================
|
||||
# 6) ASN.1 字符串 / 时间助手(asn1.h)
|
||||
# 6) ASN.1 string / time helpers (asn1.h)
|
||||
# ============================================================
|
||||
# int ASN1_STRING_length(const ASN1_STRING *x)
|
||||
extern def ASN1_STRING_length(x: Asn1StringPtr) -> int
|
||||
@@ -157,7 +157,7 @@ extern def ASN1_STRING_length(x: Asn1StringPtr) -> int
|
||||
extern def ASN1_STRING_get0_data(x: Asn1StringPtr) -> bytes
|
||||
# int ASN1_STRING_type(const ASN1_STRING *x)
|
||||
extern def ASN1_STRING_type(x: Asn1StringPtr) -> int
|
||||
# int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in) → 返回长度,需 CRYPTO_free(*out)
|
||||
# int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in) -> returns length; caller must CRYPTO_free(*out)
|
||||
extern def ASN1_STRING_to_UTF8(out: bytes, inn: Asn1StringPtr) -> int
|
||||
# int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
|
||||
extern def ASN1_STRING_print(bp: BioPtr, v: Asn1StringPtr) -> int
|
||||
@@ -171,7 +171,7 @@ extern def ASN1_TIME_compare(a: Asn1TimePtr, b: Asn1TimePtr) -> int
|
||||
extern def ASN1_INTEGER_get(a: Asn1IntegerPtr) -> int32
|
||||
# int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
|
||||
extern def ASN1_INTEGER_set(a: Asn1IntegerPtr, v: int32) -> int
|
||||
# int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a) → 十进制打印到 BIO
|
||||
# int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a) -> prints decimal to BIO
|
||||
extern def i2a_ASN1_INTEGER(bp: BioPtr, a: Asn1IntegerPtr) -> int
|
||||
# const char *ASN1_tag2str(int tag)
|
||||
extern def ASN1_tag2str(tag: int) -> str
|
||||
Reference in new issue
Block a user