home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff392.lzh
/
SetNoClick
/
setnoclick.c
< prev
Wrap
C/C++ Source or Header
|
1990-10-27
|
1KB
|
46 lines
char *vers="\0$VER: setnoclick 1.0 -- Marc Boucher (Internet: marc@CAM.ORG / BIX: mboucher) Saturday 07-Jul-90 13:36:45";
#include <exec/types.h>
#include <devices/trackdisk.h>
#include <functions.h>
#include <stdio.h>
main(int ac, char **av)
{
struct IOExtTD *td;
struct MsgPort *po;
struct TDU_PublicUnit *tpu;
long unit=0;
switch(ac) {
case 1: break;
case 2: unit=atol(av[1]); break;
default:
fprintf(stderr, "Usage: %s [unitnum]\n", av[0]);
exit(1);
break;
}
po=CreatePort(NULL,0);
if(!po) exit(1);
td=(struct IOExtTD *)CreateExtIO(po, sizeof(struct IOExtTD));
if(!td) {
DeletePort(po);
exit(1);
}
if(OpenDevice("trackdisk.device", unit, (struct IORequest *)td, 0)) {
fprintf(stderr, "%s: trackdisk.device unit %d OpenDevice() failed\n", av[0], unit);
DeleteExtIO((struct IORequest *)td);
DeletePort(po);
exit(1);
}
tpu=(struct TDU_PublicUnit *)td->iotd_Req.io_Unit;
tpu->tdu_PubFlags|=TDPF_NOCLICK;
CloseDevice((struct IORequest *)td);
DeleteExtIO((struct IORequest *)td);
DeletePort(po);
return(0);
}