| author | David Anderson <dvander@alliedmods.net> |
| Wed Feb 25 20:07:12 2009 -0500 (2009-02-25) | |
| changeset 2607 | f3b8bbe17f85 |
| parent 2325 | 7a24ee5557fb |
| permissions | -rw-r--r-- |
1 #ifndef _INCLUDE_SP_DECOMP_ENGINE_H_
2 #define _INCLUDE_SP_DECOMP_ENGINE_H_
4 #include <stdio.h>
5 #include "file_format.h"
6 #include "code_analyzer.h"
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 };
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 };
36 sp_decomp_t *Sp_InitDecomp(const char *file, int *err);
37 void Sp_FreeDecomp(sp_decomp_t *decomp);
39 #endif //_INCLUDE_SP_DECOMP_ENGINE_H_