summaryrefslogtreecommitdiff
path: root/openmp/src/file.c
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2021-12-08 01:50:12 -0700
committerLogan Hunt <loganhunt@simponic.xyz>2021-12-08 01:50:12 -0700
commitc846568cf28b4d128cf893dc0abb6ccb5ccdcc32 (patch)
tree01ad0e303ea59103f2af9b9aa007785b88fa80ca /openmp/src/file.c
parent253b267f1cee377a834860fb4deac54ef9a78b7a (diff)
downloadgol-c846568cf28b4d128cf893dc0abb6ccb5ccdcc32.tar.gz
gol-c846568cf28b4d128cf893dc0abb6ccb5ccdcc32.zip
Timing study
Diffstat (limited to 'openmp/src/file.c')
-rw-r--r--openmp/src/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openmp/src/file.c b/openmp/src/file.c
index 3ecb613..e10b667 100644
--- a/openmp/src/file.c
+++ b/openmp/src/file.c
@@ -1,5 +1,6 @@
#include "file.h"
+// Read a grid from a binary file into the space without padding
void read_in(char* filename, struct GAME* game) {
FILE* file = fopen(filename, "rb");
for (int i = game->padding; i < game->height+game->padding; i++) {
@@ -8,6 +9,7 @@ void read_in(char* filename, struct GAME* game) {
fclose(file);
}
+// Write a grid to a binary file into the space without padding
void write_out(char* filename, struct GAME* game) {
FILE* file = fopen(filename, "w+");
for (int i = game->padding; i < game->height+game->padding; i++) {