[win32] merge change#886 from maintbranch
[p5sagit/p5-mst-13.2.git] / os2 / OS2 / Process / Process.xs
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4
5 #include <process.h>
6
7 static int
8 not_here(s)
9 char *s;
10 {
11     croak("%s not implemented on this architecture", s);
12     return -1;
13 }
14
15 static unsigned long
16 constant(name, arg)
17 char *name;
18 int arg;
19 {
20     errno = 0;
21     if (name[0] == 'P' && name[1] == '_') {
22         if (strEQ(name, "P_BACKGROUND"))
23 #ifdef P_BACKGROUND
24             return P_BACKGROUND;
25 #else
26             goto not_there;
27 #endif
28         if (strEQ(name, "P_DEBUG"))
29 #ifdef P_DEBUG
30             return P_DEBUG;
31 #else
32             goto not_there;
33 #endif
34         if (strEQ(name, "P_DEFAULT"))
35 #ifdef P_DEFAULT
36             return P_DEFAULT;
37 #else
38             goto not_there;
39 #endif
40         if (strEQ(name, "P_DETACH"))
41 #ifdef P_DETACH
42             return P_DETACH;
43 #else
44             goto not_there;
45 #endif
46         if (strEQ(name, "P_FOREGROUND"))
47 #ifdef P_FOREGROUND
48             return P_FOREGROUND;
49 #else
50             goto not_there;
51 #endif
52         if (strEQ(name, "P_FULLSCREEN"))
53 #ifdef P_FULLSCREEN
54             return P_FULLSCREEN;
55 #else
56             goto not_there;
57 #endif
58         if (strEQ(name, "P_MAXIMIZE"))
59 #ifdef P_MAXIMIZE
60             return P_MAXIMIZE;
61 #else
62             goto not_there;
63 #endif
64         if (strEQ(name, "P_MINIMIZE"))
65 #ifdef P_MINIMIZE
66             return P_MINIMIZE;
67 #else
68             goto not_there;
69 #endif
70         if (strEQ(name, "P_NOCLOSE"))
71 #ifdef P_NOCLOSE
72             return P_NOCLOSE;
73 #else
74             goto not_there;
75 #endif
76         if (strEQ(name, "P_NOSESSION"))
77 #ifdef P_NOSESSION
78             return P_NOSESSION;
79 #else
80             goto not_there;
81 #endif
82         if (strEQ(name, "P_NOWAIT"))
83 #ifdef P_NOWAIT
84             return P_NOWAIT;
85 #else
86             goto not_there;
87 #endif
88         if (strEQ(name, "P_OVERLAY"))
89 #ifdef P_OVERLAY
90             return P_OVERLAY;
91 #else
92             goto not_there;
93 #endif
94         if (strEQ(name, "P_PM"))
95 #ifdef P_PM
96             return P_PM;
97 #else
98             goto not_there;
99 #endif
100         if (strEQ(name, "P_QUOTE"))
101 #ifdef P_QUOTE
102             return P_QUOTE;
103 #else
104             goto not_there;
105 #endif
106         if (strEQ(name, "P_SESSION"))
107 #ifdef P_SESSION
108             return P_SESSION;
109 #else
110             goto not_there;
111 #endif
112         if (strEQ(name, "P_TILDE"))
113 #ifdef P_TILDE
114             return P_TILDE;
115 #else
116             goto not_there;
117 #endif
118         if (strEQ(name, "P_UNRELATED"))
119 #ifdef P_UNRELATED
120             return P_UNRELATED;
121 #else
122             goto not_there;
123 #endif
124         if (strEQ(name, "P_WAIT"))
125 #ifdef P_WAIT
126             return P_WAIT;
127 #else
128             goto not_there;
129 #endif
130         if (strEQ(name, "P_WINDOWED"))
131 #ifdef P_WINDOWED
132             return P_WINDOWED;
133 #else
134             goto not_there;
135 #endif
136     }
137
138     errno = EINVAL;
139     return 0;
140
141 not_there:
142     errno = ENOENT;
143     return 0;
144 }
145
146
147 MODULE = OS2::Process           PACKAGE = OS2::Process
148
149
150 unsigned long
151 constant(name,arg)
152         char *          name
153         int             arg
154