sourcepawn/decompiler/decompiler.h
author Nicholas Hastings <skamonkey@gmail.com>
Mon May 13 14:19:17 2013 -0400 (2013-05-13)
changeset 3912 b06c6b3eec00
parent 2325 7a24ee5557fb
permissions -rw-r--r--
Don't omit frame pointer on msvc builds.
     1 #ifndef _INCLUDE_SP_DECOMP_ENGINE_H_
     2 #define _INCLUDE_SP_DECOMP_ENGINE_H_
     3 
     4 #include <stdio.h>
     5 #include "file_format.h"
     6 #include "code_analyzer.h"
     7 
     8 class PrintBuffer
     9 {
    10 public:
    11 	PrintBuffer();
    12 	~PrintBuffer();
    13 public:
    14 	void Set(const char *fmt, ...);
    15 	void Append(const char *fmt, ...);
    16 	void Prepend(const char *fmt, ...);
    17 	void Reset();
    18 	void Dump(FILE *fp);
    19 private:
    20 	void Grow(size_t len);
    21 private:
    22 	char *printbuf;
    23 	size_t printbuf_alloc;
    24 	size_t printbuf_pos;
    25 };
    26 
    27 struct sp_decomp_t
    28 {
    29 	sp_file_t *plugin;
    30 	sp_opdef_t opdef[OP_TOTAL+1];
    31 	FunctionInfo *funcs;
    32 	cell_t *pcode_map;
    33 	FunctionInfo *natives;
    34 };
    35 
    36 sp_decomp_t *Sp_InitDecomp(const char *file, int *err);
    37 void Sp_FreeDecomp(sp_decomp_t *decomp);
    38 
    39 #endif //_INCLUDE_SP_DECOMP_ENGINE_H_