home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
utility
/
misc
/
guideutl
/
callguid
/
callguid.c
next >
Wrap
C/C++ Source or Header
|
1993-05-21
|
1KB
|
62 lines
/* 1stGuide oder 1stView rufen
*/
#include <aes.h>
#include <tos.h>
#include <errors.h>
#include <vaproto.h>
int main(int argc,char *argv[])
{
int event, viewer, gl_apid, open, msg[8];
int ret=0;
long adr;
EVENT evm = { MU_MESAG|MU_TIMER, 0, 0, 0, 0,0,0,0,0, 0,0,0,0,0, 2000,0,
0, 0,0,0,0,0,0, {0,0,0,0,0,0,0,0} };
if(argc==2)
{
if((gl_apid=appl_init())<0) Pterm(ENSMEM);
viewer=appl_find("1STGUIDE");
if(viewer<0) viewer=appl_find("1STVIEW ");
if(viewer<0) ret=EFILNF;
else
{
adr=(long)argv[1];
msg[0]=VA_START;
msg[1]=gl_apid;
msg[2]=0;
msg[3]=(int)(adr>>16);
msg[4]=(int)(adr&0x00ffffL);
msg[5]=0; msg[6]=0; msg[7]=0;
appl_write(viewer,16,msg);
do
{
event=EvntMulti(&evm);
if(event&MU_TIMER) break;
}
while(evm.ev_mmgpbuf[0]!=AV_ACCWINDOPEN);
if(event&MU_TIMER) ret=EFILNF;
else
{
evm.ev_mflags=MU_MESAG;
evm.ev_mtlocount=0;
open=1;
do
{
event=EvntMulti(&evm);
if(event&MU_MESAG)
{
if(evm.ev_mmgpbuf[0]==AV_ACCWINDCLOSED) open--;
else if(evm.ev_mmgpbuf[0]==AV_ACCWINDOPEN) open++;
}
}
while(open>0);
}
}
appl_exit();
}
else ret=ENMFIL;
return(ret);
}