Logo Search packages:      
Sourcecode: cbmlink version File versions  Download package

static int read_sector_file ( FILE *  f,
unsigned  sector,
unsigned  blocks,
char *  buf 
) [static]

Read a sector from the specified file

f the input file
sector number of the current sector (for diagnostics)
blocks number of blocks processed (for diagnostics)
buf (output) the sector (256 bytes)
0 on success, nonzero on failure

Definition at line 390 of file disk.c.

References backspaces.

Referenced by disk_write().

  unsigned len;
  fputs (backspaces + (sizeof backspaces - 1) -
       fprintf (stderr, "s%u  ", sector), stderr);
  fflush (stderr);

  len = fread (buf, 1, 256, f);
  switch (len) {
  case 256:
    return 0;
  case 0:
    fprintf (stderr, "\ndisk_write: %u blocks\n", blocks);
    fprintf (stderr, "\ndisk_write: short block %u (%u bytes)\n",
           blocks, len);
  return 1;

Generated by  Doxygen 1.6.0   Back to index