mathcat_c

Crates.iomathcat_c
lib.rsmathcat_c
version0.1.0
sourcesrc
created_at2022-06-15 22:06:03.566116
updated_at2022-06-15 22:06:03.566116
descriptionC/C++ interface for MathCAT (for MathCAT info, see crates.io or nsoiffer.github.io/MathCAT)
homepage
repository
max_upload_size
id606767
size969,641
(NSoiffer)

documentation

README

C/C++ Interface for MathCAT

is a library that supports conversion of MathML to speech and braille among other things.

This project adds a C/C++ interface to MathCAT. Visit the MathCAT project page for more info or if you want to play around with MathCAT's capabilities, try out the demo.

Warning: the interface is subject to change. This is my first attempt to add a C interface to Rust code. There are two issues I'm not happy with the current interface:

  • Because strings are passed back and forth, C code needs to free the Rust strings returned. It's a bit ugly, but that's C's memory management...
  • Errors can happen and I didn't see a good way to handle this. The current method is to return an empty string to indicate an error. This means the calling code should check this condition after each condition. Call GetError() to find out what the error is.

To use this project:

  1. build the project (cargo build --release)
  2. this will create a release build in target/release and also create a directory c-example with mathcat.h and the MathCAT Rules dir in it.
  3. try compiling the the sample program test.c in that directory or create your own using that as an example. See some instructions for compiling in that file.

Alternatively, to avoid having to have a Rust build environment:

  1. download the MathCAT for C/C++ crate from https://crates.io/crates/mathcat_c
  2. download mathcat.h and the Rules from here
Commit count: 0

cargo fmt