Shared-Code Library; Creating The Library Interface - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Chapter 7: Flash Application Layout
The Access_AMS_Global_Variables macro is required in every subroutine which needs
to fetch or change AMS global variables. top_estack is a global variable in the computer
algebra system.
7.3.3.

Shared-Code Library

An application can make a library of its data structures and functions available as
attribute slots in its object frame. The app library interface should use attribute
slots 0x10000 (OO_FIRST_APP_ATTR) and up. Attribute slots 0x0000 – 0xFFFF
are reserved for the OS.
7.3.3.1.

Creating the Library Interface

Say, for example, your library implements the following functions and data
structures:
int fileTableCount;
FILE fileTable[FILE_TABLE_SIZE];
int fileOpen(AppID self, char const *filename);
int fileRead(AppID self, int handle, char *buff, int size);
int fileWrite(AppID self, int handle, char const *buff, int size);
void fileClose(AppID self, int handle);
Note: The first parameter of each exported function must be an AppID variable even though it
You can use Frame Description Language, FDL, to define an interface to these
data and functions.
fileio.fdl . . .
appvar 0x10000 PlayerFileTableCount: int *;
appvar
appfunc
appfunc
appfunc
appfunc
Some things to note in the above example:
The first variable, PlayerFileTableCount, is numbered 0x10000, the first
attribute number available for applications. Subsequent attribute numbers are
automatically incremented unless a new value is supplied.
The variable type or function result is placed after the colon (:) much in the
style of Pascal.
Function parameters list only the order and type of arguments. Do not include
parameter names.
TI-89 / TI-92 Plus Developer Guide
will always be the ID of your library.
PlayerFileTable: FILE *;
PlayerFileOpen(AppID, char const *): int;
PlayerFileRead(AppID, int, char *, int): int;
PlayerFileWrite(AppID, int, char const *, int): int;
PlayerFileClose(AppID, int): void;
Not for Distribution
51
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents