set most of trunk svn property eol-style:native
[reactos.git] / reactos / tools / sysreg / os_support.h
1 #ifndef OS_SUPPORT_H__
2 #define OS_SUPPORT_H__
3
4 /* $Id: os_support.h 24643 2006-10-24 11:45:21Z janderwald $
5 *
6 * PROJECT: System regression tool for ReactOS
7 * LICENSE: GPL - See COPYING in the top level directory
8 * FILE: tools/sysreg/conf_parser.h
9 * PURPOSE: operating systems specific code
10 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald at sbox tugraz at)
11 */
12
13 #ifdef WIN32
14 #include <windows.h>
15 #elif defined(__LINUX__)
16 #include <unistd.h>
17 #endif
18
19 #include "user_types.h"
20
21 namespace System_
22 {
23 //---------------------------------------------------------------------------------------
24 ///
25 /// class OsSupport
26 ///
27 /// Description: this class encapsulates operating system specific functions
28 ///
29 ///
30
31 class OsSupport
32 {
33 public:
34 #ifdef WIN32
35
36 typedef DWORD ProcessID;
37
38 #elif defined(__LINUX__)
39
40 typedef pid_t ProcessID;
41
42 #else
43 #error you need to define pid handle type for your platform
44 #endif
45
46 //---------------------------------------------------------------------------------------
47 ///
48 /// OsSupport
49 ///
50 /// Description: constructor of class OsSupport
51
52 virtual ~OsSupport()
53 {}
54
55 //---------------------------------------------------------------------------------------
56 ///
57 /// createProcess
58 ///
59 /// Description: this functions creates a new process and returns its pid on success
60 ///
61 /// @param procname name of the file to execute
62 /// @param procargsnum num of arguments for the new process
63 /// @param procargs arguments for the new process
64 ///
65 ///
66
67 static ProcessID createProcess(TCHAR * procname, int procargsnum, TCHAR ** procargs);
68
69 //---------------------------------------------------------------------------------------
70 ///
71 /// terminateProcess
72 ///
73 /// Description: this function terminates a process given by its pid
74 ///
75 /// Note: returns true if the process with the given pid was terminated
76 ///
77 /// @param pid process id of the process to terminate
78
79 static bool terminateProcess(ProcessID pid);
80
81 protected:
82 //---------------------------------------------------------------------------------------
83 ///
84 /// OsSupport
85 ///
86 /// Description: constructor of class OsSupport
87
88 OsSupport()
89 {}
90
91 }; // end of class OsSupport
92
93 } // end of namespace System_
94
95 #endif /* end of OS_SUPPORT_H__ */