cctools
chirp_stream.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2008- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef CHIRP_STREAM_H
8 #define CHIRP_STREAM_H
9 
10 #include <sys/time.h>
11 #include <stdio.h>
12 
25 typedef enum {
29 
39 struct chirp_stream *chirp_stream_open(const char *hostport, const char *path, chirp_stream_mode_t mode, time_t stoptime);
40 
49 int chirp_stream_printf(struct chirp_stream *stream, time_t stoptime, const char *fmt, ...);
50 
59 int chirp_stream_readline(struct chirp_stream *stream, char *line, int length, time_t stoptime);
60 
69 int chirp_stream_write(struct chirp_stream *stream, const void *data, int length, time_t stoptime);
70 
79 int chirp_stream_read(struct chirp_stream *stream, void *data, int length, time_t stoptime);
80 
87 int chirp_stream_flush(struct chirp_stream *stream, time_t stoptime);
88 
97 int chirp_stream_close(struct chirp_stream *stream, time_t stoptime);
98 
99 #endif
100 
101 /* vim: set noexpandtab tabstop=4: */
Open the stream for writing.
Definition: chirp_stream.h:27
int chirp_stream_write(struct chirp_stream *stream, const void *data, int length, time_t stoptime)
Write data to a stream.
chirp_stream_mode_t
Indicates what mode to be used for opening a stream.
Definition: chirp_stream.h:25
Open the stream for reading.
Definition: chirp_stream.h:26
int chirp_stream_close(struct chirp_stream *stream, time_t stoptime)
Closes a stream.
int chirp_stream_printf(struct chirp_stream *stream, time_t stoptime, const char *fmt,...)
Print formatted data to a stream with buffering.
int chirp_stream_flush(struct chirp_stream *stream, time_t stoptime)
Flush buffered data to the stream.
struct chirp_stream * chirp_stream_open(const char *hostport, const char *path, chirp_stream_mode_t mode, time_t stoptime)
Open a new stream for reading or writing.
int chirp_stream_read(struct chirp_stream *stream, void *data, int length, time_t stoptime)
Read data from a stream.
int chirp_stream_readline(struct chirp_stream *stream, char *line, int length, time_t stoptime)
Read a single line from a stream with buffering.