chirp_stream.h
Go to the documentation of this file.
/*
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef CHIRP_STREAM_H
#define CHIRP_STREAM_H
#include <sys/time.h>
#include <stdio.h>
typedef enum {
CHIRP_STREAM_READ,
CHIRP_STREAM_WRITE,
} chirp_stream_mode_t;
struct chirp_stream *chirp_stream_open(const char *hostport, const char *path, chirp_stream_mode_t mode, time_t stoptime);
int chirp_stream_printf(struct chirp_stream *stream, time_t stoptime, const char *fmt, ...);
int chirp_stream_readline(struct chirp_stream *stream, char *line, int length, time_t stoptime);
int chirp_stream_write(struct chirp_stream *stream, const void *data, int length, time_t stoptime);
int chirp_stream_read(struct chirp_stream *stream, void *data, int length, time_t stoptime);
int chirp_stream_flush(struct chirp_stream *stream, time_t stoptime);
int chirp_stream_close(struct chirp_stream *stream, time_t stoptime);
#endif
/* vim: set noexpandtab tabstop=8: */
chirp_stream_read
int chirp_stream_read(struct chirp_stream *stream, void *data, int length, time_t stoptime)
Read data from a stream.
chirp_stream_close
int chirp_stream_close(struct chirp_stream *stream, time_t stoptime)
Closes a stream.
chirp_stream_write
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
chirp_stream_mode_t
Indicates what mode to be used for opening a stream.
Definition chirp_stream.h:25
CHIRP_STREAM_WRITE
@ CHIRP_STREAM_WRITE
Open the stream for writing.
Definition chirp_stream.h:27
CHIRP_STREAM_READ
@ CHIRP_STREAM_READ
Open the stream for reading.
Definition chirp_stream.h:26
chirp_stream_printf
int chirp_stream_printf(struct chirp_stream *stream, time_t stoptime, const char *fmt,...)
Print formatted data to a stream with buffering.
chirp_stream_readline
int chirp_stream_readline(struct chirp_stream *stream, char *line, int length, time_t stoptime)
Read a single line from a stream with buffering.
chirp_stream_open
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.
chirp_stream_flush
int chirp_stream_flush(struct chirp_stream *stream, time_t stoptime)
Flush buffered data to the stream.