| Entry Points

### ticalcs_library_init

int TICALL ticalcs_library_init(void)

This function must be the first one to call. It inits library internals.

Return value : | the instance count.

### ticalcs_library_exit

int TICALL ticalcs_library_exit(void)

This function must be the last one to call. Used to release internal resources.

Return value : | the instance count.

### ticalcs_version_get

const char *TICALL ticalcs_version_get(void)

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

Return value : | a string.

### ticalcs_supported_calcs

uint32_t TICALL ticalcs_supported_calcs (void)

This function returns the calcs built into the current binary.

Return value : | an integer containing a binary OR of (1 << CALC_*) values, where CALC_* values are defined in enum CalcModel.

### ticalcs_handle_new

CalcHandle* TICALL ticalcs_handle_new(CalcModel model)

Create a new handle associated with the given cable on the given port. Must be freed with ticalcs_handle_del when no longer needed. Note: the handle is a pointer on an opaque structure and should not be modified.

model : | a hand-held model
Return value : | NULL if error, an handle otherwise.

### ticalcs_handle_del

int TICALL ticalcs_handle_del(CalcHandle* handle)

Release the handle and free the associated resources. If cable has not been detached with #ticalcs_cable_detach, it will be detached.

handle : | the handle
Return value : | always 0.

### ticalcs_handle_show

int TICALL ticalcs_handle_show(CalcHandle* handle)

Show information stored in the handle.

handle : | the handle
Return value : | always 0.

### ticalcs_get_model

CalcModel TICALL ticalcs_get_model(CalcHandle *handle)

Return the handle's calculator model.

handle : | the handle
Return value : | an integer containing the calc handle's calculator model.

### ticalcs_cable_attach

int TICALL ticalcs_cable_attach(CalcHandle* handle, CableHandle* cable)

Attach and open the given cable for use with the hand-held.

handle : | the handle
cable : | a cable to use
Return value : | 0 if successful, an error code otherwise.

### ticalcs_cable_detach

int TICALL ticalcs_cable_detach(CalcHandle* handle)

Close and detach the cable associated with the hand-held.

handle : | the handle
Return value : | 0 if successful, an error code otherwise.

### ticalcs_cable_get

CableHandle* TICALL ticalcs_cable_get(CalcHandle *handle)

Returns the cable associated with the hand-held.

handle : | the handle
Return value : | the cable handle or NULL.

### ticalcs_update_set

int TICALL ticalcs_update_set(CalcHandle* handle, CalcUpdate* upd)

Set the callbacks to use for the given handle.

handle : | the handle
update : | the callbacks to use
Return value : | 0 if successful, an error code otherwise.

### ticalcs_update_get

CalcUpdate* TICALL ticalcs_update_get(CalcHandle *handle)

Get the update callbacks used for the given handle.

handle : | the handle
Return value : | the update struct pointer or NULL.

### ticalcs_model_supports_dbus

{

Returns whether the given calculator model supports the protocol dubbed DBUS by libticalcs. That is, the standard protocol used by TI-Z80 and TI-68k calculators over the legacy I/O.

model : | a calculator model taken in #CalcModel.
Return value : | nonzero if the calculator supports the DBUS protocol, zero if it doesn't.

### ticalcs_model_supports_dusb

{

Returns whether the given calculator model supports the CARS protocol dubbed DUSB by libticalcs. That is, the standard protocol used by TI-Z80, TI-eZ80 and TI-68k calculators over the USB port.

model : | a calculator model taken in #CalcModel.
Return value : | nonzero if the calculator supports the DUSB protocol, zero if it doesn't.

### ticalcs_model_supports_nsp

{

Returns whether the given calculator model supports the NavNet protocol dubbed NSP by libticalcs. That is, the standard protocol used by TI-Nspire calculators over the USB port.

model : | a calculator model taken in #CalcModel.
Return value : | nonzero if the calculator supports the NSP protocol, zero if it doesn't.

### ticalcs_model_supports_installing_flashapps

{

Returns whether the given calculator model supports transferring additional FlashApps to the calculator. Some models support FlashApps only as an integral part of the OS upgrade image, arbitrary FlashApps can't be transferred.

model : | a calculator model taken in #CalcModel.
Return value : | nonzero if the calculator supports installing additional FlashApps onto the calculator, zero if it doesn't.

### ticalcs_calc_get_event_hook

{

Get the current event hook function pointer.

Return value : | a function pointer.

### ticalcs_calc_set_post_recv_hook

{

Set the current event hook function pointer.

hook : | new post recv hook
Return value : | the previous post recv hook, so that the caller can use it to chain hooks.

### ticalcs_calc_get_event_user_pointer

{

Set the current post recv hook function pointer.

Return value : | the previous post recv hook, so that the caller can use it to chain hooks.

### ticalcs_calc_set_event_user_pointer

{

Set the current post recv hook function pointer.

user_pointer : | new user pointer
Return value : | the previous post recv hook, so that the caller can use it to chain hooks.

### ticalcs_calc_get_event_count

{

Get the current event count since the handle was initialized.

Return value : | an unsigned integer.

### ticalcs_calc_fire_user_event

{

Fire a user-specified event to the registered event hook function, if any.

handle : | a previously allocated handle.
type : | event type.
user_data : | user-specified data.
user_len : | user-specified length.
Return value : | 0 if successful, an error code otherwise.

### Return to the main index