summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-02-09 20:03:33 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-02-09 20:03:33 +0100
commit7af295b2ec22f06b24079bf895ac97079f64b6d7 (patch)
tree84a554fc2c169956e3ee975152332c39f6c3615a /src/storage
parent9ca43c73ba29d6b42cd771f1567074418c883c3e (diff)
It's starting to "properly" reply...
The ACSL coverage is far behind though.
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/storage.c12
-rw-r--r--src/storage/storage.h4
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