summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-01-20 22:19:09 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-01-20 22:19:09 +0100
commitdf3657b2a99ef20da99ac3c6c02f43cc23e70fca (patch)
tree86a9e72bbbbaf7296b2d7cd2725a8bc42611a1f3 /src/file/data_output.c
parent0d49fb74eadcf933f696420cd182077927680d26 (diff)
Moving towards a server/clients structure.
Diffstat (limited to 'src/file/data_output.c')
-rw-r--r--src/file/data_output.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/file/data_output.c b/src/file/data_output.c
deleted file mode 100644
index 04e3964..0000000
--- a/src/file/data_output.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#define _POSIX_C_SOURCE 200809L
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdint.h> /* defines SIZE_MAX */
-#include <stdio.h>
-
-#include "error.h"
-
-#include "data_output.h"
-
-int ZoO_data_output_write_line
-(
- const char filename [const restrict static 1],
- char line [const restrict static 1],
- size_t const line_size
-)
-{
- const int old_errno = errno;
- FILE * file;
-
- file = fopen(filename, "a");
-
- if (file == (FILE *) NULL)
- {
- ZoO_ERROR
- (
- "Could not open file '%s' in appending mode.",
- filename
- );
-
- return -1;
- }
-
- line[line_size - 1] = '\n';
-
- if
- (
- fwrite
- (
- (const void *) line,
- sizeof(char),
- line_size,
- file
- ) < line_size
- )
- {
- line[line_size - 1] = '\0';
-
- ZoO_ERROR
- (
- "Could not store line '%s' in %s.",
- line,
- filename
- );
-
- fclose(file);
-
- return -1;
- }
-
- fclose(file);
-
- return 0;
-}