libcasio manages the file formats through a file API where you can open and decode a file, and export data into a file. A file is primarily represented by its type and platform:
An enumeration defining various file types that file formats libcasio can read and write can represent. The values in this enumeration are defined as flags so that such a value can also represent multiple file types with no ambiguity.
An add-in, i.e. a binary application which executes natively onto the calculator from the storage filesystem(s). The platform cannot be
casio_filefor_nonefor this type.
A main memory backup, see Main filesystems for more details about what a main memory is.
An e-activity, i.e. rich document for storing courses for example.
A picture, e.g.
A language file, which contains message translations with IDs, e.g.
A function key file, which contains function key pictures with IDs in the same fashion than language files, e.g.
A storage filesystem backup, typically
An enumeration defining various platforms for which the file formats libcasio can read and write can be made for. The values in this enumeration are defined as flags so that such a value can also represent multiple file platforms with no ambiguity.
No platform in particular; this value always evaluates as zero, so that any other value in this enumeration can make it precise.
The fx-9860G family of calculators, OS 1.x and OS 2.x.
The Classpad family of calculators, e.g. the fx-CP400.
The Prizm family of calculators, including the fx-CG10, fx-CG20 and fx-CG50 (Graph 90+E).
Ancient calculators supporting the CAS40 and CAS50 protocols.
The CasEmul software.
It is represented by the following object:
A decoded file of one of the supported file formats by libcasio.
Creating and freeing a file¶
A file can be created using one of the following functions:
casio_make_picture(casio_file_t **filep, unsigned int width, unsigned int height)¶
Create a picture file using the given dimensions.
casio_make_fkey(casio_file_t **filep, casio_filefor_t filefor, int count)¶
Create a function key file for the platform given in
casio_make_lang(casio_file_t **filep, casio_filefor_t filefor, int count)¶
Create a language file for the platform given in
casio_make_addin(casio_file_t **filep, casio_filefor_t filefor, size_t size, char const *name, char const *internal, casio_version_t const *versionp, time_t const *created)¶
Create an add-in file for the platform given in
sizebytes for the code,
nameas the public name,
internalas the internal name (usually starting with
versionppointing to the version structure, and
createdbeing the time of creation.
Once you’re done using a file, you shall use the following function:
Decoding a file¶
A file is decoded from a generic stream, using the following function:
casio_decode(casio_file_t **filep, char const *filename, tio_stream_t *buffer, casio_filetype_t expected_types)¶
Create a file from the stream in
filep. If you have the filename, you shall pass it in
filename(if not, just pass
NULL), this function will also try to guess the file type using the detected extension or filename (which has a significance for some file formats, e.g. ancient file formats managed by CaS).
If you don’t know what format you expect, pass zero to
expected_types. Otherwise, use the types as flags, e.g.
casio_filetype_picture | casio_filetype_mcs | casio_filetype_storageif you expect to find some pictures (main memory can contain pictures).