把 includes 下 64 个 .vp 的文件头注释(含 traceback.vp 第 13-427 行的整块文件级说明)以及 2 处漏网的正文中文注释(ast/lexer.vp、json/__writer.vp)与 1 处中文 docstring(memhub.vp)逐行译为英文;同步把 fltk/gen_ffi.py 的生成模板与其自身注释英文化,使重新生成仍为英文。 只改注释/文档串文字:行数与代码逐字节不变(骨架比对 140 文件漂移 0),运行时中文字符串字面量 305 处保持原样。验证:三重重编 SUCCESS(170.21s)+ 全量 77/77 顺序回归通过 + VET 编译 SUCCESS / --search-paths 7 条 exit 0。
52 lines
1.9 KiB
Plaintext
52 lines
1.9 KiB
Plaintext
import t, c
|
|
from openssl.types import *
|
|
|
|
# ============================================================
|
|
# openssl/err.vp — OpenSSL error queue
|
|
# Corresponding header: err.h
|
|
# ============================================================
|
|
|
|
# unsigned long ERR_get_error(void) -- pop queue head and return error code
|
|
extern def ERR_get_error() -> uint32
|
|
# unsigned long ERR_peek_error(void)
|
|
extern def ERR_peek_error() -> uint32
|
|
# unsigned long ERR_peek_last_error(void)
|
|
extern def ERR_peek_last_error() -> uint32
|
|
# void ERR_clear_error(void)
|
|
extern def ERR_clear_error()
|
|
|
|
# char *ERR_error_string(unsigned long e, char *buf) -- buf may be NULL (uses internal static buffer)
|
|
extern def ERR_error_string(e: uint32, buf: bytes) -> str
|
|
# void ERR_error_string_n(unsigned long e, char *buf, size_t len)
|
|
extern def ERR_error_string_n(e: uint32, buf: bytes, len: sizet)
|
|
# const char *ERR_lib_error_string(unsigned long e)
|
|
extern def ERR_lib_error_string(e: uint32) -> str
|
|
# const char *ERR_func_error_string(unsigned long e)
|
|
extern def ERR_func_error_string(e: uint32) -> str
|
|
# const char *ERR_reason_error_string(unsigned long e)
|
|
extern def ERR_reason_error_string(e: uint32) -> str
|
|
|
|
# Stack marks (for partial-failure rollback)
|
|
extern def ERR_set_mark() -> int
|
|
extern def ERR_pop_to_mark() -> int
|
|
extern def ERR_clear_last_mark() -> int
|
|
|
|
# void ERR_print_errors(BIO *bp) -- dump the whole queue to BIO (see bio.vp)
|
|
extern def ERR_print_errors(bp: BioPtr)
|
|
# void ERR_print_errors_fp(FILE *fp) -- FILE* not exposed yet
|
|
|
|
# ---- Error code unpacking (inline-macro equivalents) ----
|
|
# OpenSSL error code layout: system bit 0x80000000, library 24-31, reason 0-15
|
|
define ErrLibMask = 0xff000000
|
|
define ErrReasonMask = 0x0000ffff
|
|
define ErrSystemFlag = 0x80000000
|
|
|
|
def err_get_lib(code: uint32) -> int:
|
|
if (code & ErrSystemFlag) != 0:
|
|
return 0
|
|
return (code >> 24) & 0xff
|
|
|
|
|
|
def err_get_reason(code: uint32) -> int:
|
|
return code & ErrReasonMask
|