| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/storage')
| -rw-r--r-- | src/storage/storage.c | 12 | ||||
| -rw-r--r-- | src/storage/storage.h | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/storage/storage.c b/src/storage/storage.c index 22c5c49..40185a3 100644 --- a/src/storage/storage.c +++ b/src/storage/storage.c @@ -6,7 +6,7 @@ #include <stdint.h> /* defines SIZE_MAX */ #include <stdio.h> -#include "../pipe/pipe.h" +#include "../error/error.h" #include "storage.h" @@ -15,12 +15,17 @@ int ZoO_storage_write_line const char filename [const restrict static 1], char line [const restrict static 1], size_t const line_size, - const struct ZoO_pipe io [const restrict static 1] + FILE io [const restrict static 1] ) { const int old_errno = errno; FILE * file; + if (filename == (const char *) NULL) + { + return 0; + } + file = fopen(filename, "a"); if (file == (FILE *) NULL) @@ -53,8 +58,7 @@ int ZoO_storage_write_line ZoO_ERROR ( io, - "Could not store line '%s' in %s.", - line, + "Could not store line in storage file %s.", filename ); diff --git a/src/storage/storage.h b/src/storage/storage.h index c287b23..9eff281 100644 --- a/src/storage/storage.h +++ b/src/storage/storage.h @@ -1,14 +1,14 @@ #ifndef _ZoO_STORAGE_STORAGE_H_ #define _ZoO_STORAGE_STORAGE_H_ -#include "../pipe/pipe_types.h" +#include <stdio.h> int ZoO_storage_write_line ( const char filename [const restrict static 1], char line [const restrict static 1], size_t const line_size, - const struct ZoO_pipe io [const restrict static 1] + FILE io [const restrict static 1] ); #endif |


