General functions and Generic TI charset <=> UTF-16 conversions

ticonv_version_get

TIEXPORT4 const char *TICALL ticonv_version_get(void)

This function returns the library version like "X.Y.Z".

Return value :
a constant string.

ticonv_utf16_strlen

TIEXPORT4 size_t TICALL ticonv_utf16_strlen(const unsigned short *str)

UTF-16 version of strlen (same as wcslen if wchar_t is UTF-16, but portable).

str :
null terminated UTF-16 string
Return value :
number of characters. Surrogate pairs are counted as 2 characters each.

ticonv_utf8_to_utf16

TIEXPORT4 unsigned short* ticonv_utf8_to_utf16(const char *str)

UTF-8 to UTF-16 conversion.

str :
null terminated UTF-8 string
Return value :
a newly allocated string or NULL if error.

ticonv_utf16_free

g_free((void *)str);

This function frees an UTF-16 string previously allocated by e.g. ticonv_utf8_to_utf16(). /

str :
previously allocated UTF-16 string to be freed.
Return value :


ticonv_utf16_to_utf8

TIEXPORT4 char* ticonv_utf16_to_utf8(const unsigned short *str)

UTF-16 to UTF-8 conversion.

str :
null terminated UTF-16 string
Return value :
a newly allocated string or NULL if error.

ticonv_utf8_free

g_free((void *)str);

This function frees an UTF-8 string previously allocated by e.g. ticonv_utf16_to_utf8(). /

str :
previously allocated UTF-8 string to be freed.
Return value :


ticonv_charset_utf16_to_ti_s

TIEXPORT4 char* TICALL ticonv_charset_utf16_to_ti_s(CalcModel model, const unsigned short *utf16, char *ti)

UTF-16 to TI charset conversion.

model :
a calculator model taken in #CalcModel.
utf16 :
null terminated string (input)
ti :
null terminated string (output)
Return value :
the %ti string or NULL if error.

ticonv_charset_utf16_to_ti

TIEXPORT4 char* TICALL ticonv_charset_utf16_to_ti(CalcModel model, const unsigned short *utf16)

UTF-16 to TI charset conversion.

model :
a calculator model taken in #CalcModel.
utf16 :
null terminated string (input)
Return value :
a newly allocated string or NULL if error.

ticonv_ti_free

g_free((void *)str);

This function frees a string in TI format previously allocated by e.g. ticonv_charset_utf16_to_ti(). /

str :
previously allocated TI string to be freed.
Return value :


ticonv_charset_ti_to_utf16_s

TIEXPORT4 unsigned short* TICALL ticonv_charset_ti_to_utf16_s(CalcModel model, const char *ti, unsigned short *utf16)

TI charset to UTF-16 conversion. The %utf16 destination buffer will hold the result. It must be big enough.

model :
a calculator model taken in #CalcModel.
ti :
null terminated string (input)
utf16 :
null terminated string (output)
Return value :
the %utf16 string or NULL if error.

ticonv_charset_ti_to_utf16

TIEXPORT4 unsigned short* TICALL ticonv_charset_ti_to_utf16(CalcModel model, const char *ti)

TI charset to UTF-16 conversion.

model :
a calculator model taken in #CalcModel.
ti :
null terminated string (input)
Return value :
a newly allocated string or NULL if error.

ticonv_varname_to_utf16_s

TIEXPORT4 unsigned short* TICALL ticonv_varname_to_utf16_s(CalcModel model, const char *src, unsigned short *dst, unsigned char type)

Some calculators (like TI73/82/83/83+/84+) does not return the real name of the variable (like L1) but uses a special encoded way. This functions expands the name and converts it to UTF-16.

model :
a calculator model taken in #CalcModel.
src :
a name of variable to detokenize and translate (17 chars max).
dst :
the location where to store the result (big enough).
type :
the variable type.
Return value :
the %dst string or NULL if error.

ticonv_varname_to_utf16

TIEXPORT4 unsigned short* TICALL ticonv_varname_to_utf16(CalcModel model, const char *src, unsigned char type)

Some calculators (like TI73/82/83/83+/84+) does not return the real name of the variable (like L1) but uses a special encoded way. This functions expands the name and converts it to UTF-16.

model :
a calculator model taken in #CalcModel.
src :
a name of variable to detokenize and translate (17 chars max).
type :
the variable type.
Return value :
a newly allocated string or NULL if error.

ticonv_varname_to_utf8_sn

TIEXPORT4 char* TICALL ticonv_varname_to_utf8_sn(CalcModel model, const char *src, char *dst, uint32_t maxlen, unsigned char type)

Some calculators (like TI73/82/83/83+/84+) does not return the real name of the variable (like L1) but uses a special encoded way. This functions expands the name and converts it to UTF-8.

model :
a calculator model taken in #CalcModel.
src :
a name of variable to detokenize and translate (17 chars max).
dst :
the location where to store the result.
maxlen :
maximum length for the result, minimum 1.
type :
the variable type.
Return value :
the %dst string or NULL if error.

ticonv_varname_to_utf8_s

TIEXPORT4 char* TICALL ticonv_varname_to_utf8_s(CalcModel model, const char *src, char *dst, unsigned char type)

Some calculators (like TI73/82/83/83+/84+) does not return the real name of the variable (like L1) but uses a special encoded way. This functions expands the name and converts it to UTF-8.

model :
a calculator model taken in #CalcModel.
src :
a name of variable to detokenize and translate (17 chars max).
dst :
the location where to store the result (large enough).
type :
the variable type.
Return value :
the %dst string or NULL if error.

ticonv_varname_to_utf8

TIEXPORT4 char* TICALL ticonv_varname_to_utf8(CalcModel model, const char *src, unsigned char type)

Some calculators (like TI73/82/83/83+/84+) does not return the real name of the variable (like L1) but uses a special encoded way. This functions expands the name and converts it to UTF-8.

model :
a calculator model taken in #CalcModel.
src :
a name of variable to detokenize and translate.
type :
the variable type.
Return value :
a newly allocated string or NULL if error.

ticonv_varname_to_filename_sn

TIEXPORT4 char* TICALL ticonv_varname_to_filename_sn(CalcModel model, const char *src, char *dst, uint32_t maxlen, unsigned char type)

This function converts a varname into a valid filename (depends on locale). Example: 'foobar' => foobar, 'alpha' => _alpha_/alpha.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
a buffer to store result in the GLib filename encoding (64 bytes max).
maxlen :
maximum length for the result, minimum 1.
type :
the variable type.
Return value :
%dst or NULL if error.

ticonv_varname_to_filename_s

TIEXPORT4 char* TICALL ticonv_varname_to_filename_s(CalcModel model, const char *src, char *dst, unsigned char type)

This function converts a varname into a valid filename (depends on locale). Example: 'foobar' => foobar, 'alpha' => _alpha_/alpha.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
a buffer to store result in the GLib filename encoding (64 bytes max).
type :
the variable type.
Return value :
%dst or NULL if error.

ticonv_varname_to_filename

TIEXPORT4 char* TICALL ticonv_varname_to_filename(CalcModel model, const char *src, unsigned char type)

This function converts a varname into a valid filename (depends on locale). Example: 'foobar' => foobar, 'alpha' => _alpha_/alpha.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
type :
the variable type.
Return value :
%dst as a newly allocated string or NULL if error.

ticonv_varname_to_tifile_sn

TIEXPORT4 char* TICALL ticonv_varname_to_tifile_sn(CalcModel model, const char *src, char *dst, uint32_t maxlen, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
the location where to store the result.
maxlen :
maximum length for the result, minimum 1.
type :
the variable type.
Return value :
%dst or NULL if error.

ticonv_varname_to_tifile_s

TIEXPORT4 char* TICALL ticonv_varname_to_tifile_s(CalcModel model, const char *src, char *dst, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
the location where to store the result (large enough).
type :
the variable type.
Return value :
%dst or NULL if error.

ticonv_varname_to_tifile

TIEXPORT4 char* TICALL ticonv_varname_to_tifile(CalcModel model, const char *src, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
type :
the variable type.
Return value :
%dst as a newly allocated string or NULL if error.

ticonv_varname_from_tifile_sn

TIEXPORT4 char* TICALL ticonv_varname_from_tifile_sn(CalcModel model, const char *src, char *dst, uint32_t maxlen, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
the location where to store the result.
maxlen :
maximum length for the result, minimum 1.
type :
the variable type.
Return value :
%dst as a newly allocated string or NULL if error.

ticonv_varname_from_tifile_s

TIEXPORT4 char* TICALL ticonv_varname_from_tifile_s(CalcModel model, const char *src, char *dst, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
dst :
the location where to store the result (large enough).
type :
the variable type.
Return value :
%dst as a newly allocated string or NULL if error.

ticonv_varname_from_tifile

TIEXPORT4 char* TICALL ticonv_varname_from_tifile(CalcModel model, const char *src, unsigned char type)

This function converts a raw varname into a TI file varname. Needed because USB hand-helds use TI-UTF-8 while TI files are still encoded in raw varname encoding.

model :
a calculator model taken in #CalcModel.
src :
the name of variable to convert (raw/binary name).
type :
the variable type.
Return value :
%dst as a newly allocated string or NULL if error.

ticonv_model_uses_utf8

{

Returns whether the given calculator model uses UTF-8.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator uses UTF-8, zero if it doesn't.

ticonv_model_is_tiz80

{

Returns whether the given calculator model is considered a TI-Z80 calculator, based on a Z80 processor.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator is a TI-Z80 calculator, zero if it doesn't.

ticonv_model_is_tiez80

{

Returns whether the given calculator model is considered a TI-eZ80 calculator, based on an eZ80 processor.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator is a TI-eZ80 calculator, zero if it doesn't.

ticonv_model_is_ti68k

{

Returns whether the given calculator model is considered a TI-68k calculator, based on a 68000 processor.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator is a TI-68k calculator, zero if it doesn't.

ticonv_model_is_tinspire

{

Returns whether the given calculator model is a TI-Nspire calculator.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator is a TI-Nspire calculator, zero if it doesn't.

ticonv_model_has_legacy_ioport

{

Returns whether the given calculator model has a legacy I/O port: female proprietary 2.5mm stereo jack.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator has a legacy I/O port, zero if it doesn't.

ticonv_model_has_usb_ioport

{

Returns whether the given calculator model has an USB I/O port: female mini-USB A/B port.

model :
a calculator model taken in #CalcModel.
Return value :
nonzero if the calculator has an USB I/O port, zero if it doesn't.

Return to the main index