Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
file_output_stream.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
24 #ifndef FILE_OUTPUT_STREAM_H
25 #define FILE_OUTPUT_STREAM_H
26 
28 #include "streams.h"
29 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
41 typedef struct FileOutputStream
42 {
45 
48 
50  FILE *fos_out_f;
51 
58 
68 GRASSROOTS_UTIL_API OutputStream *AllocateFileOutputStream (const char * const filename_s);
69 
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* FILE_OUTPUT_STREAM_H */
82 
FileOutputStream
An OutputStream that writes to user-specified files.
Definition: file_output_stream.h:41
grassroots_util_library.h
streams.h
FileOutputStream::AllocateFileOutputStream
OutputStream * AllocateFileOutputStream(const char *const filename_s)
Allocate a FileOutputStream.
FileOutputStream::fos_stream
OutputStream fos_stream
The base OutputStream.
Definition: file_output_stream.h:44
FileOutputStream::fos_filename_s
char * fos_filename_s
The filename that this OutputStream will write to.
Definition: file_output_stream.h:47
FileOutputStream::fos_out_f
FILE * fos_out_f
The FILE for this OutputStream.
Definition: file_output_stream.h:50
DeallocateFileOutputStream
void DeallocateFileOutputStream(OutputStream *stream_p)
Free a FileOutputStream.
FileOutputStream::fos_close_on_exit_flag
bool fos_close_on_exit_flag
true if the fos_out_f will be closed on exit, false otherwise.
Definition: file_output_stream.h:56
OutputStream
An datatype to abstract out the process of writing log and error messages to the appropriate processe...
Definition: streams.h:106
GRASSROOTS_UTIL_API
#define GRASSROOTS_UTIL_API
Definition: grassroots_util_library.h:47