Main filesystems

CASIO calculators have a main filesystem, also called “main memory” and “MCS” (for “Main Control Structure”) that contains all the little files necessary to the main functions, such as programming, working on lists, matrixes, spreadsheets, pictures, strings, and so on.

A main memory file is either a blob of data specific to a platform, or an interpreted memory file which is understood by libcasio.

The main memory head

Platform-generic definitions

Every main memory file has a head, which contains the meta-information for it, including its name and type as defined by the main memory. It is defined through the following type:

type casio_mcshead_t

The abstract object representing a main memory file head, including its meta-information.

It defines the platform for which the main memory file is for:

type casio_mcsfor_t

The main memory file platform, i.e. for which platform or protocol the file was for.

casio_mcsfor_none

Platform-independent file, although all the features in this file might not be supported by all platforms.

casio_mcsfor_mcs

Standard main memory archive (or protocol 7 main memory) file, for the fx-9860G.

casio_mcsfor_cas40

Legacy CAS40 header.

casio_mcsfor_cas50

Legacy CAS50 header.

casio_mcsfor_cas100

Legacy CAS100 header.

From the raw header, the library will usually try to find out a platform-independent type amongst the following:

type casio_mcstype_t

The main memory file type, as represented in libcasio for types that can be managed by it.

casio_mcstype_unknown

An unknown blob of data which hasn’t been interpreted by libcasio.

casio_mcstype_program

A program in Basic Casio.

casio_mcstype_list

A list of number values.

casio_mcstype_matrix

A matrix of number values.

casio_mcstype_picture

A picture (simple picture).

casio_mcstype_capture

A capture (double picture).

casio_mcstype_spreadsheet

A spreadsheet.

casio_mcstype_string

A string.

casio_mcstype_setup

The setup file, containing all the calculator settings.

casio_mcstype_alpha

The alpha memory, containing all the calculator variables.

casio_mcstype_vector

A vector.

casio_mcstype_end

An end file (specific to CAS links, see Using the CAS protocols).

Platform-specific headers

You’re not obliged to use the platform-generic main memory file type, you can get the raw headers from the platform, either in this format for fx-9860G files:

type casio_mcsheaders_t

Raw fx-9860G MCS headers.

char const *casio_mcsheaders_name

The file name.

char const *casio_mcsheaders_dirname

The directory name.

char const *casio_mcsheaders_group

The file group.

int casio_mcsheaders_type

The numerical type for the file.

Or in this format for CAS files:

type casio_casheaders_t

Raw CAS (CAS40, CAS50, CAS100) headers.

char const *casio_casheaders_app

The application name.

char const *casio_casheaders_name

The file name.

char const *casio_casheaders_data

The CAS data type.

unsigned long casio_casheaders_flags

The flags for such a header, such as:

CASIO_CASHEADERSFLAG_UNFINISHED

There still are file parts to read.

CASIO_CASHEADERSFLAG_MULTIPLE

The file is actually a set of files.

CASIO_CASHEADERSFLAG_REQUEST

The head is actually a request (for links).

You can make a head using the following functions:

int casio_get_mcshead_cas_headers(casio_mcshead_t *head, casio_casheaders_t **headersp)

Get the editable CAS headers pointer (updates are not taken into account until a set is made).

int casio_set_mcshead_cas_headers(casio_mcshead_t *head, casio_casheaders_t const *headers)

Warning

Only use a structure pointer that has been obtained through casio_get_mcshead_cas_headers() for binary compatibility.

Set the CAS headers.

int casio_get_mcshead_mcs_headers(casio_mcshead_t *head, casio_mcsheaders_t **headersp)

Get the editable MCS headers pointer (updates are not taken into account until a set is made).

int casio_set_mcshead_mcs_headers(casio_mcshead_t *head, casio_mcsheaders_t const *headers)

Warning

Only use a structure pointer that has been obtained through casio_get_mcshead_mcs_headers() for binary compatibility.

Set the MCS headers.

Managing the head

To get and set the type and platform, use the following functions:

int casio_get_mcshead_type(casio_mcshead_t *head, casio_mcstype_t *typep, casio_mcsfor_t *forp)

Get the MCS file head type and platform. If either of these two last pointers is NULL, then it will not be filled.

int casio_set_mcshead_type(casio_mcshead_t *head, casio_mcstype_t type, casio_mcsfor_t for_value)

Set the MCS file head type and platform.

The head contains some more data (for protocol 7, this data is actually within the file, but for a more coherent interface, libcasio considers it as being part of the head):

  • for pictures: a width, a height and a picture format.

  • for programs: a password.

TODO

Main memory files

It is represented by the following type:

type casio_mcsfile_t

The abstract object representing a main memory file for any platform.