be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen#ifndef IOSTREAM_RAWLOG_PRIVATE_H
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen#define IOSTREAM_RAWLOG_PRIVATE_H
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen
76a58bc863893374000881e69d6dd4e3dccadddeTimo Sirainen#include "iostream-rawlog.h"
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen
76a58bc863893374000881e69d6dd4e3dccadddeTimo Sirainen#define IOSTREAM_RAWLOG_MAX_PREFIX_LEN 3
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainenstruct rawlog_iostream {
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen struct iostream_private *iostream;
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen enum iostream_rawlog_flags flags;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen
76d4ff1c1b31a1a09f6cbfe613a8d0efe62cbfd2Timo Sirainen struct ostream *rawlog_output;
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen buffer_t *buffer;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen bool input;
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen bool line_continued;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen};
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainenvoid iostream_rawlog_init(struct rawlog_iostream *rstream,
f1ed4fa248aaf6841ba638b9d66b2738d9f7aa18Timo Sirainen enum iostream_rawlog_flags flags, bool input);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainenvoid iostream_rawlog_write(struct rawlog_iostream *rstream,
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen const unsigned char *data, size_t size);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainenvoid iostream_rawlog_close(struct rawlog_iostream *rstream);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen#endif