X-Git-Url: http://git.scottworley.com/overonion/blobdiff_plain/673e2d68a8813804502df1923a6c2f6e727e69a0..f5ec0b4b91687c7a34d4760381f6e7424f981127:/reverse_lib.h?ds=sidebyside diff --git a/reverse_lib.h b/reverse_lib.h new file mode 100644 index 0000000..d8b0480 --- /dev/null +++ b/reverse_lib.h @@ -0,0 +1,15 @@ +#ifndef _OVERONION_REVERSE_LIB_H +#define _OVERONION_REVERSE_LIB_H + +#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, 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 */