; ; Ullrich von Bassewitz, 22.06.2002 ; ; Original C code by Marc 'BlackJack' Rintsch, 19.03.2001 ; ; int __fastcall__ cbm_read (unsigned char lfn, void* buffer, unsigned int size) ; /* Reads up to "size" bytes from a file to "buffer". ; ** Returns the number of actually read bytes, 0 if there are no bytes left ; ** (EOF) or -1 in case of an error. _oserror contains an errorcode then (see ; ** table below). ; */ ; { ; static unsigned int bytesread; ; static unsigned char tmp; ; ; /* if we can't change to the inputchannel #lfn then return an error */ ; if (_oserror = cbm_k_chkin(lfn)) return -1; ; ; bytesread = 0; ; ; while (bytesread