Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtksh / ksh93 / src / lib / libast / include / wait.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: wait.h /main/3 1995/11/01 17:42:20 rswiston $ */
24 /***************************************************************
25 *                                                              *
26 *                      AT&T - PROPRIETARY                      *
27 *                                                              *
28 *         THIS IS PROPRIETARY SOURCE CODE LICENSED BY          *
29 *                          AT&T CORP.                          *
30 *                                                              *
31 *                Copyright (c) 1995 AT&T Corp.                 *
32 *                     All Rights Reserved                      *
33 *                                                              *
34 *           This software is licensed by AT&T Corp.            *
35 *       under the terms and conditions of the license in       *
36 *       http://www.research.att.com/orgs/ssr/book/reuse        *
37 *                                                              *
38 *               This software was created by the               *
39 *           Software Engineering Research Department           *
40 *                    AT&T Bell Laboratories                    *
41 *                                                              *
42 *               For further information contact                *
43 *                     gsf@research.att.com                     *
44 *                                                              *
45 ***************************************************************/
46
47 /* : : generated by proto : : */
48                   
49 /*
50  * ast POSIX wait/exit support
51  */
52
53 #ifndef _WAIT_H
54 #if !defined(__PROTO__)
55 #if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
56 #if defined(__cplusplus)
57 #define __MANGLE__      "C"
58 #else
59 #define __MANGLE__
60 #endif
61 #define __STDARG__
62 #define __PROTO__(x)    x
63 #define __OTORP__(x)
64 #define __PARAM__(n,o)  n
65 #if !defined(__STDC__) && !defined(__cplusplus)
66 #if !defined(c_plusplus)
67 #define const
68 #endif
69 #define signed
70 #define void            int
71 #define volatile
72 #define __V_            char
73 #else
74 #define __V_            void
75 #endif
76 #else
77 #define __PROTO__(x)    ()
78 #define __OTORP__(x)    x
79 #define __PARAM__(n,o)  o
80 #define __MANGLE__
81 #define __V_            char
82 #define const
83 #define signed
84 #define void            int
85 #define volatile
86 #endif
87 #if defined(__cplusplus) || defined(c_plusplus)
88 #define __VARARG__      ...
89 #else
90 #define __VARARG__
91 #endif
92 #if defined(__STDARG__)
93 #define __VA_START__(p,a)       va_start(p,a)
94 #else
95 #define __VA_START__(p,a)       va_start(p)
96 #endif
97 #endif
98
99 #define _WAIT_H
100
101 #include <ast.h>
102 #include <ast_wait.h>
103
104 #if _sys_wait
105 #if defined(__STDPP__directive) && defined(__STDPP__hide)
106 __STDPP__directive pragma pp:hide wait waitpid
107 #else
108 #define wait            ______wait
109 #define waitpid         ______waitpid
110 #endif
111 #include <sys/wait.h>
112 #if defined(__STDPP__directive) && defined(__STDPP__hide)
113 __STDPP__directive pragma pp:nohide wait waitpid
114 #else
115 #undef  wait
116 #undef  waitpid
117 #endif
118 #endif
119
120 #ifndef WNOHANG
121 #define WNOHANG         1
122 #endif
123
124 #ifndef WUNTRACED
125 #define WUNTRACED       2
126 #endif
127
128 #if !_ok_wif
129 #undef  WIFEXITED
130 #undef  WEXITSTATUS
131 #undef  WIFSIGNALED
132 #undef  WTERMSIG
133 #undef  WIFSTOPPED
134 #undef  WSTOPSIG
135 #undef  WTERMCORE
136 #endif
137
138 #ifndef WIFEXITED
139 #define WIFEXITED(x)    (!((x)&((1<<(EXIT_BITS-1))-1)))
140 #endif
141
142 #ifndef WEXITSTATUS
143 #define WEXITSTATUS(x)  (((x)>>EXIT_BITS)&((1<<EXIT_BITS)-1))
144 #endif
145
146 #ifndef WIFSIGNALED
147 #define WIFSIGNALED(x)  (((x)&((1<<(EXIT_BITS-1))-1))!=0)
148 #endif
149
150 #ifndef WTERMSIG
151 #define WTERMSIG(x)     ((x)&((1<<(EXIT_BITS-1))-1))
152 #endif
153
154 #ifndef WIFSTOPPED
155 #define WIFSTOPPED(x)   (((x)&((1<<EXIT_BITS)-1))==((1<<(EXIT_BITS-1))-1))
156 #endif
157
158 #ifndef WSTOPSIG
159 #define WSTOPSIG(x)     WEXITSTATUS(x)
160 #endif
161
162 #ifndef WTERMCORE
163 #define WTERMCORE(x)    ((x)&(1<<(EXIT_BITS-1)))
164 #endif
165
166 extern __MANGLE__ pid_t         wait __PROTO__((int*));
167 extern __MANGLE__ pid_t         waitpid __PROTO__((pid_t, int*, int));
168
169 #endif