X-Git-Url: http://git.scottworley.com/overonion/blobdiff_plain/2061508697fa23aff04a6c3e15fd1dc9c93ce1d4..HEAD:/reverse_lib.h?ds=sidebyside diff --git a/reverse_lib.h b/reverse_lib.h index f4d7dd6..d8b0480 100644 --- a/reverse_lib.h +++ b/reverse_lib.h @@ -1,8 +1,15 @@ #ifndef _OVERONION_REVERSE_LIB_H #define _OVERONION_REVERSE_LIB_H -/* Copy the contents of input_filename to output_fd backwards. +#include + +/* Copy the contents of input_filename to output_stream backwards. * input_filename must be a real file, not a pipe. */ -void reverse_file(const char* input_filename, int output_fd); +void reverse_file(const char* input_filename, FILE* output_stream); + +/* Save the contents of input_stream to a temporary file. On EOF, + * emit them backwards to output_stream. Temporary files go in + * $TMPDIR if set, /tmp otherwise. */ +void reverse_stream(FILE* input_stream, FILE* output_stream); #endif /* _OVERONION_REVERSE_LIB_H */