fix(ffi): return parser status and isolate thread errors
This commit is contained in:
parent
740cf9c693
commit
24438c4840
1 changed files with 234 additions and 24 deletions
12
README.md
12
README.md
|
|
@ -20,4 +20,14 @@ A fast GDSII parser and writer in Rust, with Apache Arrow integration for effici
|
|||
|
||||
## Usage
|
||||
|
||||
(To be added)
|
||||
`read_path` exports a library through the Arrow C Data Interface. Allocate
|
||||
initialized `ArrowArray` and `ArrowSchema` output structures, then check the
|
||||
returned status: `0` means success and `-1` means failure. Only import the Arrow
|
||||
outputs after success; the caller owns their release callbacks. Failed calls
|
||||
leave the outputs unchanged. See `test.py` for a Python CFFI example.
|
||||
|
||||
`last_error_message()` returns a UTF-8, null-terminated error string, or null
|
||||
after a successful parser call. Errors belong to the calling thread. Copy the
|
||||
message before making another parser call on that thread, and before the thread
|
||||
exits; calls on other threads do not invalidate it. Parser panics that unwind
|
||||
are converted into errors.
|
||||
|
|
|
|||
Loading…
Reference in a new issue