[comp.sys.amiga] Where's CloseResource

ewhac@well.UUCP (03/26/87)

[ Poindexter should have put the secret documents here for the line eater. ]

	Okay, I've got a question for the West Chester bunch.  This morning,
I wanted to fiddle around with the 8520 Time-Of-Day clock.  Consulting the
RKM indicated that I should allocate the use of the 8520 using the
OpenResource() function in the Exec.

	When I got to the end of the program, I discovered that there is no
CloseResource() function anywhere.  I checked for variants like
FreeResource(), UnOpenResource(), YouCanHaveThisResourceBackNow(), etc.
Nothing.

	The example code in the RKM indicated that resources might be like
libraries, so I tried using CloseLibrary() instead.  That yielded a double
guru (the first Guru froze, took the machine down, and a second one came
up).

	I have the original Commodore-published ROM Kernel Manuals (not
Addison-Wesley), so there may be some information I don't have.  Any
suggestions?

	Adv-Thanks-ance.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 ________		 ___			Leo L. Schwab
	   \		/___--__		The Guy in The Cape
  ___  ___ /\		    ---##\		ihnp4!ptsfa!well!ewhac
      /   X  \_____    |  __ _---))			..or..
     /   /_\--    -----+==____\ // \  _		well ---\
___ (   o---+------------------O/   \/ \	dual ----> !unicom!ewhac
     \     /		    ___ \_  (`o )	hplabs -/       ("AE-wack")
 ____ \___/			     \_/
	      Recumbent Bikes:			"Work FOR?  I don't work FOR
	    The _O_n_l_y Way To Fly!		anybody!  I'm just having fun."

andy@cbmvax.UUCP (03/27/87)

In article <2831@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>	Okay, I've got a question for the West Chester bunch.  This morning,
>	When I got to the end of the program, I discovered that there is no
>CloseResource() function anywhere.  I checked for variants like
>FreeResource(), UnOpenResource(), YouCanHaveThisResourceBackNow(), etc.
>Nothing.
> ________		 ___			Leo L. Schwab

Gone.  Vanished.  Isn't there any more.  Kaput.

Basically, it was determined to be a do nothing routine, and went away.
All OpenResource does is get you a pointer to a resource.  The only
time it fails is if it doesn't find that resource on the system resource
list.

(The allocations of the resource are what usually fail;  and there
 are corresponding FREEs to the Allocs)

			andy finkel
-- 
andy finkel		{ihnp4|seismo|allegra}!cbmvax!andy 
Commodore/Amiga		 /or/ pyramid!amiga!andy }

"Do not meddle with the affairs of wizards, for it makes them soggy and hard 
to light."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

wpd@bacchus.UUCP (03/27/87)

In article <2831@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>
>	Okay, I've got a question for the West Chester bunch.  This morning,
>I wanted to fiddle around with the 8520 Time-Of-Day clock.  Consulting the
>RKM indicated that I should allocate the use of the 8520 using the
>OpenResource() function in the Exec.
>
>	When I got to the end of the program, I discovered that there is no
>CloseResource() function anywhere.  I checked for variants like
>FreeResource(), UnOpenResource(), YouCanHaveThisResourceBackNow(), etc.
>Nothing.

I recently interfaced my Amiga to a card that had an 8031 Microcontroller
on it through the parallel port as part of the final project in a lab course
I was taking.  Because my partner and I had already specified the protocol
(we were supposed to interface the card to one of the class computers, but were
lazy and didn't feel like fighting for one of the 5 available computers),
anyhow, I wrote my own parallel interface routines.  I used the OpenResource()
call and, like you, found no CloseResource().  I just commented out those lines
and pretended they were there.  I didn't have any problems re-openning the
resources later.  I never checked to see if that cost me memory.  I would bet
that OpenResource() is a "for-future-expansion" call.  Perhaps it would do
more when trying to allocate a resource on a PC-Card in the 2000?  I don't
know.

Disclaimer: I just read through this and disclaim any responsibility for
	    twisted eyes/brain-cells in trying to understand my ravings.

               __________________________________________________
               |                                                |
               | Patrick Doyle            (617) 253-3261 (msgs) |
               | MIT, E40-358                or 225-8467 (home) |
	       | (617) 253-4231 (work)     410 Memorial Dr.     |
               | wpd@athena.mit.edu        Cambridge, MA 02139  |
               | ...{decvax,ihnp4}!mit-eddie!mit-athena!wpd     |
               |________________________________________________|

page@ulowell.UUCP (03/28/87)

(Why is 'sausage' in the Keywords: line?)

There isn't one.  Resources do not need to be closed.  OpenResource
should really be called InitResource.  Actually, future resources
may have to be opened and closed like libraries and devices, so there
should be a CloseResource, just so you get in the habit of doing it.

Enclosed is a version of CloseResource you can use until 1.3.   :-)

int
CloseResource()
{
    return 0;
}

..Bob

-- 
Bob Page,  U of Lowell CS Dept.      ulowell!page,  page@ulowell.CSNET