1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#ifndef _FLASH_IOSTREAM_H_
#define _FLASH_IOSTREAM_H_
#include <stdio.h>
#include <stddef.h>
#include <sys/types.h>
/* Input stream functions */
struct input_stream;
extern struct input_stream *
new_input_stream(const char *filename);
extern const char *
input_stream_get_name(struct input_stream *in);
extern ssize_t
input_stream_getdelims(struct input_stream *in, char **lineptr,
size_t *n, const char *delims);
extern ssize_t
input_stream_getline(struct input_stream *in, char **lineptr, size_t *n);
extern void
free_input_stream(struct input_stream *in);
/* Output stream functions */
struct output_stream;
enum out_compression_type {
OUT_COMPRESSION_NONE,
OUT_COMPRESSION_GZIP,
};
extern struct output_stream *
new_output_stream(enum out_compression_type ctype,
const char *path,
const char *filter_prog,
const char *filter_prog_args);
extern const char *
output_stream_get_name(struct output_stream *out);
extern void
output_stream_write(struct output_stream *out,
const void *buf, size_t count);
extern void
output_stream_fputs(struct output_stream *out, const char *s);
extern void
output_stream_fputc(struct output_stream *out, char c);
extern void
free_output_stream(struct output_stream *out);
/* fopen() and fclose() wrappers */
extern void *
xfopen(const char *filename, const char *mode);
extern void
xfclose(FILE *fp, const char *name);
#endif /* _FLASH_IOSTREAM_H_ */
|