Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cbmvax!cbmehq!cbmfra!swinjm!forgeas From: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Newsgroups: comp.sys.amiga.programmer Subject: Re: GetMiscResource ? Message-ID: <194c52b1.ARN0ebf@swinjm.UUCP> Date: 14 Jun 91 09:51:45 GMT References: <1949138e.ARN0d5b@trantor.informatik.uni-erlangen.de> Reply-To: forgeas@swinjm.UUCP (Jean-Michel Forgeas) Followup-To: comp.sys.amiga.programmer Organization: The Software Winery Lines: 38 In article <1949138e.ARN0d5b@trantor.informatik.uni-erlangen.de>, Andy Klingler writes: > How do I call GetMiscResource from Lattice/SAS C 5.05 ? > [...] > So, what's the trick? I'm using the 2.0 includes/amiga.lib and you can try these lines of code (example about the parallel port). They seem to do the job. //-----------------------------begin------------------------------ #include #include #include #include struct Library *MiscBase; CPTR CIAA, CIAB; //-------init if (! (MiscBase = (struct Library *) OpenResource( MISCNAME ))) goto END_ERROR; if (! (CIAA = OpenResource( CIAANAME ))) goto END_ERROR; if (AllocMiscResource( MR_PARALLELPORT, name )) goto END_ERROR; if (! (CIAB = OpenResource( CIABNAME ))) goto END_ERROR; if (AllocMiscResource( MR_PARALLELBITS, name )) goto END_ERROR; //--------cleanup if (CIAB) FreeMiscResource( MR_PARALLELBITS ); if (CIAA) FreeMiscResource( MR_PARALLELPORT ); //------------------------------end----------------------------- -- \___/ Jean-Michel Forgeas \-/ cbmvax!cbmehq!cbmfra!swinjm!forgeas | The Software Winery -^- And, where is the universe ?