This commit is contained in:
bronku 2025-10-14 16:35:41 +02:00
parent 2b222dda0b
commit 3b1db93d74
5 changed files with 126 additions and 72 deletions

24
tape.h Normal file
View 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);