ok?
This commit is contained in:
parent
2b222dda0b
commit
3b1db93d74
5 changed files with 126 additions and 72 deletions
24
tape.h
Normal file
24
tape.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct {
|
||||
int reads;
|
||||
int writes;
|
||||
FILE* file;
|
||||
} tape;
|
||||
|
||||
typedef struct {
|
||||
void* location;
|
||||
int length;
|
||||
int capacity;
|
||||
} buffer;
|
||||
|
||||
// sorts the entire buffer
|
||||
void quicksort(buffer* buff);
|
||||
|
||||
// reads [capacity] records
|
||||
void read_buffer(buffer* buff, tape* tape);
|
||||
// writes everything
|
||||
void write_buffer(buffer* buff, tape* tape);
|
||||
|
||||
void clear_tape(tape* tape);
|
||||
Loading…
Add table
Add a link
Reference in a new issue