Download 58 Building an Application

Transcript
Reference Section
You should provide the following functions to represent the environment of the SDL system:
•
xInitEnv and xCloseEnv, which are called during initialization
and termination of the application
•
xOutEnv which should treat signals sent to the environment
•
xInEnv which should treat signals sent into the SDL system from
the environment
There are two ways to get a skeleton for the env functions:
•
You can copy the file sctenv.c from the directory
<installation directory>/sdt/sdtdir/<machine dependent dir>/INCLUDE
where <machine dependent dir> is for example sunos5sdtdir on
SunOS 5, hppasdtdir on HP, and wini386 in Windows. (In Windows, / should be replaced by \ in the path above.)
This file also contains some trace mechanisms that may be used to
trace the execution in a target computer. This trace can, however,
only be used if you have the source code for the run-time library (included in the Cadvanced SDL to C Compiler) and can produce a
new object library with the appropriate switches.
•
You can generate a skeleton by using the Generate environment
functions option in the Make dialog in the Organizer. In very simple
cases you might obtain executable env functions by just tuning the
macros in this generated file, but in the general case you must use it
as a skeleton and edit it. Remember then to copy the file so that it is
not overwritten when code is generated the next time.
An advantage with the generated env functions is that the SDL to C
Compiler knows about the signal interface to be implemented in the env
functions, and can therefore insert code or macros for all signals in the
interface. To calculate this information is not that easy, especially if partitioning (generating code for a part of a system) is used.
July 2003
Telelogic Tau 4.5 User’s Manual
,um-st1
2703