cybiko:macimpl:newcode

CS 395 Project: Integrating New Code

For the final phase of the project, you must incorporate new versions of rf.c and the the I/O routines. Follow this link for copies of all the new code.

There are two key improvements in the RF layer code. First, it's integrated with the new I/O code so that an indicator is automatically displayed when the channel is in use. Second, it's been modified to improve the response time of RF_InUse. These modifications make it incompatible with the previous RF layer, so your code won't communicate correctly with applications using an earlier version. The interface is unchanged though, so it should be a drop-in replacement.

The dialog.c package has been split into two independent components: console.c, which implements the scrolling text window and WriteText, and dialog.c which now just provides the collection of dialog boxes. The code in console.c is enhanced in a number of ways. It now supports a non-scrolling status line and an in-use indicator in addition to the main scrolling text window. The performance of the code that manages scrolling has been significnatly improved as well. Switching over to the new code requires the following changes:

  1. Add an #include for console.h in all files that use the output routines.
  2. Replace the call to Dialog_Scroll in main.c with Console_Scroll.
  3. Replace Init_Dialogs with a call to Dialogs_Init and Console_Init.
  4. Replace Dest_Dialogs with calls to Dialogs_Dest and Console_Dest. (If you weren't calling the destructor in your code, make sure you add these destructor calls just before your application exits.)
  5. Edit the makefile so that console.o is added to the project.
  6. Copy filer.list, on.pic, and off.pic into the res subdirectory.

You can display text on the single status line by calling WriteStatus. It takes the same arguments as WriteText, but truncates the output at 25 characters.


Brad Richards 2002

  • cybiko/macimpl/newcode.txt
  • Last modified: 2009/11/27 17:56
  • by 127.0.0.1