hw04/disk.h

19 lines
949 B
C
Raw Permalink Normal View History

2020-04-25 03:14:20 -07:00
#ifndef _DISK_H_
#define _DISK_H_
/******************************************************************************/
#define DISK_BLOCKS 8192 /* number of blocks on the disk */
#define BLOCK_SIZE 4096 /* block size on "disk" */
/******************************************************************************/
int make_disk(char *name); /* create an empty, virtual disk file */
int open_disk(char *name); /* open a virtual disk (file) */
int close_disk(); /* close a previously opened disk (file) */
int block_write(int block, char *buf);
/* write a block of size BLOCK_SIZE to disk */
int block_read(int block, char *buf);
/* read a block of size BLOCK_SIZE from disk */
/******************************************************************************/
#endif