💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › Srcs › SAMPLE.C.txt captured on 2024-06-16 at 14:27:40.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

#pragma keep "telcom"

#include <stdio.h>
#include <locator.h>
#include <loader.h>
#include <orca.h>
#include <memory.h>
#include <gsos.h>

#include "modemmgr.h"

main()
{
int itemnum;
int ch;
word junk;
char *path_sm,*path_mm;
InitialLoadOutputRec ilr_sm,ilr_mm;
handle toolMem;
word toolPtr;

   TLStartUp();
   path_mm = "\p1:tool.mm";  /* assume TOL file is in same directory as */
                             /* application file */
   /* APW users- \p inserts a length byte at the beginning of the string.
      You must add code to do this if APW doesn't support it. */

   /* use the System Loader to bring in the tool set */
   ilr_mm = InitialLoad(userid(),path_mm,1);
   if (toolerror()) {
      printf("mm error %x\n",toolerror());
      exit(1);
   }

   /* get a direct page from the memory manager */

   toolMem = NewHandle(0x0100l,userid(),0xC005,0l);
   toolPtr = (word) *toolMem;

/*
   printf("modem mgr ->%lx\n",ilr_mm.startAddr);
   printf("mm WAP    ->%x\n",toolPtr+0x0100);

   /* use the tool locator to install our user tool set */
   SetTSPtr(0x8000, 1, ilr_mm.startAddr);
   ModemMStartUp(toolPtr);

   /* your program goes here */

   ModemMShutDown();
   junk = UserShutDown(ilr_mm.userID,0);

   TLShutDown();
}