Mon, 28 Mar 2005
Using libraries

Load and initializing the library

#include 
int MathLibRef = -1;
...
// is library already loaded?
err = SysLibFind("MathLib", &MathLibRef);
if (err != 0) {
	// negative, load
	err = SysLibLoad('libr', 'MthL', &MathLibRef);
	if (err == 0) {
		err = MathLibOpen (MathLibRef, 1);
	}
}

Closing library

if (MathLibRef != -1) {
	Err err;
	UInt16 usecount;
	err = MathLibClose (MathLibRef, &usecount);
	if (usecount == 0) {
		SysLibRemove (MathLibRef);
	}
}

(posted at 20:40 | filed under programming/palmbits | link)    (comments | add new)