cangjie-cffi
CommunityCangjie-C interop: foreign calls and memory.
AuthorJunjieChen0
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill enables robust cross-language interoperation between Cangjie and C/C++ code. It standardizes how to declare external C functions, map C structs, pass inout pointers, manage memory via LibC, and construct safe callbacks using CFunc and CString, reducing boilerplate and risk.
Core Features & Use Cases
- Foreign declarations: declare external C functions from Cangjie with optional @C qualifiers, and call them inside unsafe blocks.
- CFunc and inout: define function pointers and automatically pass addresses for inout parameters, enabling bidirectional callbacks.
- Memory management: allocate and free native memory via LibC, work with CPointer<T>, CString, and resource management utilities.
- Interop workflows: Create and manipulate C pointers, maps between C types and Cangjie types, and implement C callbacks from Cangjie side.
- Use Case: Build a plugin or extension that integrates with an existing C API, handling strings and structured data safely from Cangjie.
Quick Start
Use the cangjie-cffi skill to declare a foreign function and call it from Cangjie inside an unsafe block.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: cangjie-cffi Download link: https://github.com/JunjieChen0/NJUST/archive/main.zip#cangjie-cffi Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.