-
Notifications
You must be signed in to change notification settings - Fork 23
/
Z80Assembler.h
69 lines (48 loc) · 1.58 KB
/
Z80Assembler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Z80Assembler.h : Declaration of the CZ80Assembler
#pragma once
#include "resource.h" // main symbols
#include "list.h"
#include "storage.h"
#include "SPASM_i.h"
typedef struct
{
char name[64];
char value[64];
}
default_define_pair_t;
// CZ80Assembler
class ATL_NO_VTABLE CZ80Assembler :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CZ80Assembler, &CLSID_Z80Assembler>,
public IDispatchImpl<IZ80Assembler, &IID_IZ80Assembler, &LIBID_SPASM, 1, 2>
{
public:
DECLARE_REGISTRY_RESOURCEID(IDR_Z80ASSEMBLER)
BEGIN_COM_MAP(CZ80Assembler)
COM_INTERFACE_ENTRY(IZ80Assembler)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct();
void FinalRelease();
public:
STDMETHOD(get_Output)(IStream **ppStream);
STDMETHOD(get_InputFile)(LPBSTR lpbstrInput);
STDMETHOD(put_InputFile)(BSTR bstrInput);
STDMETHOD(get_OutputFile)(LPBSTR lpbstrOutput);
STDMETHOD(put_OutputFile)(BSTR bstrOutput);
STDMETHOD(ClearDefines)();
STDMETHOD(AddDefine)(BSTR bstrName, VARIANT varValue);
STDMETHOD(ClearIncludeDirectories)();
STDMETHOD(AddIncludeDirectory)(BSTR bstrDirectory);
STDMETHOD(Assemble)(VARIANT varInput, int *lpReturn);
STDMETHOD(get_Labels)(LPSAFEARRAY *lpsa);
private:
static LONG m_lIndex;
static void get_label_callback(label_t *label, CComSafeArray<IDispatch *> *lpsa);
LPSTREAM m_pStmOutput;
_bstr_t m_bstrInputFile;
_bstr_t m_bstrOutputFile;
list_t *default_defines;
};
OBJECT_ENTRY_AUTO(__uuidof(Z80Assembler), CZ80Assembler)