[comp.sys.amiga.programmer] BPTR

jdickson@jato.jpl.nasa.gov (Jeff Dickson) (02/28/91)

	I work with AmigaDOS a lot. I'm well aware of the differences between
BPTR's and 'C' pointers. Although AmigaDOS functions do not return 'C' pointers
to file locks for example, assigning the return to variables declared as such
saves having to clutter up your source code with subsequent casts.

	typedef struct FileLock *FLPNTR;
	long n;
	FLPNTR Lock();
	FLPNTR lk;

	if ((lk = (FLPNTR)BCPL2C(Lock("bozo", ACCESS_READ))) != (FLPNTR)0) {
		n = lk->fl_Key;

	For you die hards that insist that BPTR's cannot be thought of as
'C' pointers in disquise:

	BPTR lk; 
	
	if ((lk = (BPTR)lock("mickey_mouse", ACCESS_READ)) != (BPTR)0) {
		n = ((FLPNTR)BCPL2C(lk))->fl_Key;


						Jeff