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,