28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 34 #include "Platform.h" 35 36 #ifdef POSIX 37 38 #ifndef POSIXPLATFORM_H 39 #define POSIXPLATFORM_H 40 41 42 class PosixPlatform : virtual public Platform{ 43 public: 44 PosixPlatform(void); 45 virtual ~PosixPlatform(void); 46 47 public: 48 virtual void SetCurrentDirectory(TString Value); 49 50 virtual Module LoadLibrary(TString FileName); 51 virtual void FreeLibrary(Module AModule); 52 virtual Procedure GetProcAddress(Module AModule, std::string MethodName); 53 virtual std::vector<TString> GetLibraryImports(const TString FileName); 54 virtual std::vector<TString> FilterOutRuntimeDependenciesForPlatform(std::vector<TString> Imports); 55 }; 56 57 #endif //POSIXPLATFORM_H 58 #endif //POSX | 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 34 #include "Platform.h" 35 36 #ifdef POSIX 37 38 #ifndef POSIXPLATFORM_H 39 #define POSIXPLATFORM_H 40 41 42 class PosixPlatform : virtual public Platform{ 43 public: 44 PosixPlatform(void); 45 virtual ~PosixPlatform(void); 46 47 public: 48 virtual MessageResponse ShowResponseMessage(TString title, TString description); 49 //virtual MessageResponse ShowResponseMessageB(TString description); 50 51 virtual void SetCurrentDirectory(TString Value); 52 53 virtual Module LoadLibrary(TString FileName); 54 virtual void FreeLibrary(Module AModule); 55 virtual Procedure GetProcAddress(Module AModule, std::string MethodName); 56 virtual std::vector<TString> GetLibraryImports(const TString FileName); 57 virtual std::vector<TString> FilterOutRuntimeDependenciesForPlatform(std::vector<TString> Imports); 58 59 virtual Process* CreateProcess(); 60 }; 61 62 63 class PosixProcess : public Process { 64 private: 65 pid_t FChildPID; 66 sigset_t saveblock; 67 #ifdef MAC 68 struct sigaction savintr, savequit; 69 #endif //MAC 70 bool FRunning; 71 72 void Cleanup(); 73 74 public: 75 PosixProcess(); 76 virtual ~PosixProcess(); 77 78 virtual bool IsRunning(); 79 virtual bool Terminate(); 80 virtual bool Execute(const TString Application, const std::vector<TString> Arguments, 81 bool AWait = false); 82 virtual bool Wait(); 83 virtual TProcessID GetProcessID(); 84 }; 85 86 #endif //POSIXPLATFORM_H 87 #endif //POSX |