Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jato!jdickson From: jdickson@jato.jpl.nasa.gov (Jeff Dickson) Newsgroups: comp.sys.amiga.programmer Subject: BPTR Message-ID: <1991Feb27.162620.26427@jato.jpl.nasa.gov> Date: 27 Feb 91 16:26:20 GMT Reply-To: jdickson@jato.Jpl.Nasa.Gov (Jeff Dickson) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 24 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