From ccab2de5fbb6901c72086e6004cd9a4f61fa5621 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Tue, 12 Nov 2024 19:36:45 -0800 Subject: [PATCH] add missing annotation --- parser/llguidance.h | 17 +++++++++++++++-- parser/src/ffi.rs | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/parser/llguidance.h b/parser/llguidance.h index b26420e..9ea56e8 100644 --- a/parser/llguidance.h +++ b/parser/llguidance.h @@ -9,8 +9,6 @@ typedef struct LlgConstraint LlgConstraint; -typedef struct LlgConstraintStep LlgConstraintStep; - typedef struct LlgTokenizer LlgTokenizer; typedef struct LlgParserLimits { @@ -110,6 +108,21 @@ typedef struct LlgCommitResult { bool is_stop; } LlgCommitResult; +typedef struct LlgConstraintStep { + /** + * The constraint to compute mask for. + */ + struct LlgConstraint *constraint; + /** + * Pointer to memory where the mask should be written. + */ + uint32_t *mask_dest; + /** + * The length of the mask_dest array in bytes (not elements). + */ + size_t mask_byte_len; +} LlgConstraintStep; + /** * Function which llg calls when an operation is done. */ diff --git a/parser/src/ffi.rs b/parser/src/ffi.rs index 5d65ad9..68617c6 100644 --- a/parser/src/ffi.rs +++ b/parser/src/ffi.rs @@ -213,6 +213,7 @@ pub struct LlgConstraintInit { } #[derive(Clone)] +#[repr(C)] pub struct LlgConstraintStep { /// The constraint to compute mask for. pub constraint: *mut LlgConstraint,