00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020
00025 #pragma once
00026
00027 enum _ftype { t_printf, t_error };
00028
00029 struct SCStruct {
00030 _ftype type;
00031 const char *message;
00032 va_list argptr;
00033 int number;
00034 char *filename;
00035 int firstline;
00036 int lastline;
00037 };
00038
00050 class SCompiler {
00051 friend DWORD WINAPI ThreadProc( LPVOID lpParameter );
00052 static HANDLE m_Mutex;
00053 static bool m_bInUse;
00054 public:
00055 SCompiler();
00056 ~SCompiler();
00057
00058 static HWND m_shWnd;
00059 static int sc_printf(const char *format, va_list argptr);
00060 static int sc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr);
00061 static void *sc_opensrc(char *filename);
00062 static void sc_closesrc(void *handle);
00063 static void sc_resetsrc(void *handle,void *position);
00064 static char *sc_readsrc(void *handle,char *target,int maxchars);
00065 static void *sc_getpossrc(void *handle);
00066 static int sc_eofsrc(void *handle);
00067 static void *sc_openasm(char *filename);
00068 static void sc_closeasm(void *handle, int deletefile);
00069 static void sc_resetasm(void *handle);
00070 static int sc_writeasm(void *handle,char *st);
00071 static char *sc_readasm(void *handle, char *target, int maxchars);
00072 static void *sc_openbin(char *filename);
00073 static void sc_closebin(void *handle,int deletefile);
00074 static void sc_resetbin(void *handle);
00075 static int sc_writebin(void *handle,void *buffer,int size);
00076 static long sc_lengthbin(void *handle);
00077
00078 int Compile(LPCSTR szInludeDir, LPCSTR szSrcFile, LPCSTR szDestFile);
00079 void StartThread(int argc, char*argv[]);
00080
00081 };