#ifndef _TRACE_WRITER_HPP_
#define _TRACE_WRITER_HPP_
+
#include <stddef.h>
#include <vector>
-namespace Trace {
-
- typedef unsigned Id;
+#include "trace_model.hpp"
- struct FunctionSig {
- Id id;
- const char *name;
- unsigned num_args;
- const char **arg_names;
- };
- struct StructSig {
- Id id;
- const char *name;
- unsigned num_members;
- const char **member_names;
- };
-
- struct EnumSig {
- Id id;
- const char *name;
- signed long long value;
- };
-
- struct BitmaskFlag {
- const char *name;
- unsigned long long value;
- };
-
- struct BitmaskSig {
- Id id;
- unsigned num_flags;
- const BitmaskFlag *flags;
- };
+namespace Trace {
+ class File;
class Writer {
protected:
- void *g_gzFile;
+ File *m_file;
unsigned call_no;
std::vector<bool> functions;
void writeNull(void);
void writeOpaque(const void *ptr);
+ void writeCall(Call *call);
+
protected:
void inline _write(const void *sBuffer, size_t dwBytesToWrite);
void inline _writeByte(char c);