Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

SCompiler.h

Go to the documentation of this file.
00001 /* QuestDesigner - Open Zelda's Project
00002    Copyright (C) 2003 Kronuz
00003    Copyright (C) 2001/2003 Open Zelda's Project
00004  
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 };

Generated on Wed Apr 16 19:12:22 2003 for QuestDesigner by doxygen1.2.18