From bb0422682e50238bbb1e84d78616f2f8deedfc6c Mon Sep 17 00:00:00 2001 From: wangdl Date: Thu, 18 Jun 2026 15:00:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20complete=20=5Fseparate=20function=20tabl?= =?UTF-8?q?e=20(10=E2=86=9217)=20in=20out-pointer=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing: build_document_info, search_epub, update_position, create_note_anchor, create_note_anchor_from_search - Add memory management functions (rustbuffer_free/from_bytes) - Organize by category: memory, parse, search, events, anchors Co-Authored-By: Claude Opus 4.7 --- docs/c-abi-out-pointer-pattern.md | 55 ++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/docs/c-abi-out-pointer-pattern.md b/docs/c-abi-out-pointer-pattern.md index 1b56625..e428abe 100644 --- a/docs/c-abi-out-pointer-pattern.md +++ b/docs/c-abi-out-pointer-pattern.md @@ -207,18 +207,49 @@ data: *mut *mut u8 → 数据指针(双重指针:写入指针值) 项目中有以下函数使用 out-pointer 模式(`_separate` 后缀): -| 函数 | 输入 | 输出 | 状态 | -|------|:--:|:--:|:--:| -| `parse_markdown_separate` | JSON args | `Vec` | ✅ 已实现 | -| `parse_text_separate` | JSON args | `Vec` | ✅ 已实现 | -| `detect_material_type_separate` | 文件路径 | `MaterialType` | ✅ 已实现 | -| `read_image_meta_separate` | 文件路径 | `ImageMeta` | ✅ 已实现 | -| `read_text_stats_separate` | 文件路径 | `TextStats` | ✅ 已实现 | -| `search_markdown_blocks_separate` | JSON args | `Vec` | ✅ 已实现 | -| `search_text_content_separate` | JSON args | `Vec` | ✅ 已实现 | -| `search_pdf_pages_separate` | JSON args | `Vec` | ✅ 已实现 | -| `push_reading_event_separate` | JSON event | () | ✅ 已实现 | -| `export_pending_events_separate` | () | `Vec` | ✅ 已实现 | +### 内存管理 + +| 函数 | 说明 | +|------|------| +| `rustbuffer_free_separate` | 释放 out-pointer 分配的 buffer | +| `rustbuffer_from_bytes_separate` | 从 raw bytes 构造 RustBuffer | + +### 文档解析 + +| 函数 | 输入 | 输出 | +|------|:--:|:--:| +| `build_document_info_separate` | JSON args | `DocumentInfo` | +| `parse_markdown_separate` | JSON args | `Vec` | +| `parse_text_separate` | JSON args | `Vec` | +| `detect_material_type_separate` | String | `MaterialType` | +| `read_image_meta_separate` | String | `ImageMeta` | +| `read_text_stats_separate` | String | `TextStats` | + +### 搜索 + +| 函数 | 输入 | 输出 | +|------|:--:|:--:| +| `search_markdown_blocks_separate` | JSON args | `Vec` | +| `search_text_content_separate` | JSON args | `Vec` | +| `search_pdf_pages_separate` | JSON args | `Vec` | +| `search_epub_chapters_ffi_separate` | JSON args | `Vec` | + +### V1 事件(deprecated) + +| 函数 | 输入 | 输出 | +|------|:--:|:--:| +| `push_reading_event_separate` | JSON event | () | +| `update_reading_position_separate` | JSON args | () | +| `export_pending_events_separate` | () | `Vec` | + +### 锚点 + +| 函数 | 输入 | 输出 | +|------|:--:|:--:| +| `create_note_anchor_separate` | JSON args | `NoteAnchor` | +| `create_note_anchor_from_search_separate` | JSON args | `NoteAnchor` | + +**总计**:17 个 `_separate` 函数(含 2 个内存管理 + 15 个业务函数) ---