Mercurial > octave
annotate liboctave/util/lo-cutils.c @ 21202:f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
* Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc,
Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc,
Array-voidp.cc, Array.cc, CColVector.cc, CDiagMatrix.cc, CMatrix.cc,
CNDArray.cc, CRowVector.cc, CSparse.cc, CSparse.h, DiagArray2.cc, MArray-C.cc,
MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc, MArray-s.cc, MArray.cc,
MDiagArray2.cc, MSparse-C.cc, MSparse-d.cc, MSparse.h, MatrixType.cc,
PermMatrix.cc, Range.cc, Sparse-C.cc, Sparse-b.cc, Sparse-d.cc, Sparse.cc,
boolMatrix.cc, boolNDArray.cc, boolSparse.cc, chMatrix.cc, chNDArray.cc,
dColVector.cc, dDiagMatrix.cc, dMatrix.cc, dNDArray.cc, dRowVector.cc,
dSparse.cc, dSparse.h, dim-vector.cc, fCColVector.cc, fCDiagMatrix.cc,
fCMatrix.cc, fCNDArray.cc, fCRowVector.cc, fColVector.cc, fDiagMatrix.cc,
fMatrix.cc, fNDArray.cc, fRowVector.cc, idx-vector.cc, int16NDArray.cc,
int32NDArray.cc, int64NDArray.cc, int8NDArray.cc, intNDArray.cc,
uint16NDArray.cc, uint32NDArray.cc, uint64NDArray.cc, uint8NDArray.cc,
blaswrap.c, cquit.c, f77-extern.cc, f77-fcn.c, f77-fcn.h, lo-error.c, quit.cc,
quit.h, CmplxAEPBAL.cc, CmplxCHOL.cc, CmplxGEPBAL.cc, CmplxHESS.cc, CmplxLU.cc,
CmplxQR.cc, CmplxQRP.cc, CmplxSCHUR.cc, CmplxSVD.cc, CollocWt.cc, DASPK.cc,
DASRT.cc, DASSL.cc, EIG.cc, LSODE.cc, ODES.cc, Quad.cc, base-lu.cc, base-qr.cc,
dbleAEPBAL.cc, dbleCHOL.cc, dbleGEPBAL.cc, dbleHESS.cc, dbleLU.cc, dbleQR.cc,
dbleQRP.cc, dbleSCHUR.cc, dbleSVD.cc, eigs-base.cc, fCmplxAEPBAL.cc,
fCmplxCHOL.cc, fCmplxGEPBAL.cc, fCmplxHESS.cc, fCmplxLU.cc, fCmplxQR.cc,
fCmplxQRP.cc, fCmplxSCHUR.cc, fCmplxSVD.cc, fEIG.cc, floatAEPBAL.cc,
floatCHOL.cc, floatGEPBAL.cc, floatHESS.cc, floatLU.cc, floatQR.cc,
floatQRP.cc, floatSCHUR.cc, floatSVD.cc, lo-mappers.cc, lo-specfun.cc,
oct-convn.cc, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-rand.cc,
oct-spparms.cc, randgamma.c, randmtzig.c, randpoisson.c, sparse-chol.cc,
sparse-dmsolve.cc, sparse-lu.cc, sparse-qr.cc, mx-defs.h, dir-ops.cc,
file-ops.cc, file-stat.cc, lo-sysdep.cc, mach-info.cc, oct-env.cc,
oct-group.cc, oct-openmp.h, oct-passwd.cc, oct-syscalls.cc, oct-time.cc,
oct-uname.cc, pathlen.h, sysdir.h, syswait.h, cmd-edit.cc, cmd-hist.cc,
data-conv.cc, f2c-main.c, glob-match.cc, lo-array-errwarn.cc,
lo-array-gripes.cc, lo-cutils.c, lo-cutils.h, lo-ieee.cc, lo-math.h,
lo-regexp.cc, lo-utils.cc, oct-base64.cc, oct-glob.cc, oct-inttypes.cc,
oct-inttypes.h, oct-locbuf.cc, oct-mutex.cc, oct-refcount.h, oct-rl-edit.c,
oct-rl-hist.c, oct-shlib.cc, oct-sort.cc, pathsearch.cc, singleton-cleanup.cc,
sparse-sort.cc, sparse-util.cc, statdefs.h, str-vec.cc, unwind-prot.cc,
url-transfer.cc, display-available.h, main-cli.cc, main-gui.cc, main.in.cc,
mkoctfile.in.cc, octave-config.in.cc, shared-fcns.h:
indent #ifdef blocks in liboctave and src directories.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 06 Feb 2016 06:40:13 -0800 |
parents | dfcb9d74b253 |
children | f7d1050b9b53 |
rev | line source |
---|---|
3613 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
3 Copyright (C) 2000-2015 John W. Eaton |
3613 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
3613 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
3613 | 20 |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
24 # include <config.h> |
3613 | 25 #endif |
26 | |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
27 #include "lo-error.h" |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
28 |
4290 | 29 /* This gives us a better chance of finding a prototype for strptime |
30 on some systems. */ | |
31 | |
32 #if ! defined (_XOPEN_SOURCE) | |
33 #define _XOPEN_SOURCE | |
34 #endif | |
35 | |
3803 | 36 #include <sys/types.h> |
37 #include <unistd.h> | |
38 | |
3613 | 39 #include <stdlib.h> |
3803 | 40 #include <string.h> |
3706 | 41 #include <time.h> |
3613 | 42 |
11512
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
11006
diff
changeset
|
43 #include "lo-cutils.h" |
5453 | 44 #include "syswait.h" |
45 | |
6108 | 46 OCTAVE_API void |
3613 | 47 octave_qsort (void *base, size_t n, size_t size, |
10180 | 48 int (*cmp) (const void *, const void *)) |
3613 | 49 { |
50 qsort (base, n, size, cmp); | |
51 } | |
52 | |
6108 | 53 OCTAVE_API int |
6111 | 54 octave_strcasecmp (const char *s1, const char *s2) |
55 { | |
56 return strcasecmp (s1, s2); | |
57 } | |
58 | |
59 OCTAVE_API int | |
60 octave_strncasecmp (const char *s1, const char *s2, size_t n) | |
61 { | |
62 return strncasecmp (s1, s2, n); | |
63 } | |
64 | |
5451 | 65 #ifdef HAVE_LOADLIBRARY_API |
21202
f7121e111991
maint: indent #ifdef blocks in liboctave and src directories.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
66 # include <windows.h> |
5451 | 67 |
68 /* Need this since in C++ can't cast from int(*)() to void* */ | |
6108 | 69 OCTAVE_API void * |
5453 | 70 octave_w32_library_search (HINSTANCE handle, const char * name) |
5451 | 71 { |
72 return (GetProcAddress (handle, name)); | |
73 } | |
74 #endif | |
75 | |
6108 | 76 OCTAVE_API pid_t |
5453 | 77 octave_waitpid (pid_t pid, int *status, int options) |
78 { | |
79 return WAITPID (pid, status, options); | |
80 } | |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
81 |
15254
e8abaaaa2d7d
avoid function defined but not used warning
John W. Eaton <jwe@octave.org>
parents:
15226
diff
changeset
|
82 static inline void |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
83 warn_missing_wait_macro (const char *id, int status) |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
84 { |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
85 (*current_liboctave_warning_handler) |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
86 ("%s always returns false in this version of Octave; status = %d", |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
87 id, status); |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
88 } |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
89 |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
90 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
91 octave_wifexited (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
92 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
93 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
94 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
95 #if defined (WIFEXITED) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
96 retval = WIFEXITED (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
97 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
98 warn_missing_wait_macro ("WIFEXITED", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
99 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
100 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
101 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
102 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
103 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
104 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
105 octave_wexitstatus (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
106 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
107 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
108 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
109 #if defined (WEXITSTATUS) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
110 retval = WEXITSTATUS (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
111 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
112 warn_missing_wait_macro ("WEXITSTATUS", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
113 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
114 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
115 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
116 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
117 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
118 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
119 octave_wifsignaled (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
120 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
121 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
122 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
123 #if defined (WIFSIGNALED) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
124 retval = WIFSIGNALED (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
125 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
126 warn_missing_wait_macro ("WIFSIGNALED", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
127 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
128 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
129 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
130 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
131 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
132 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
133 octave_wtermsig (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
134 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
135 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
136 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
137 #if defined (WTERMSIG) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
138 retval = WTERMSIG (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
139 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
140 warn_missing_wait_macro ("WTERMSIG", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
141 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
142 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
143 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
144 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
145 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
146 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
147 octave_wcoredump (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
148 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
149 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
150 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
151 #if defined (WCOREDUMP) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
152 retval = WCOREDUMP (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
153 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
154 warn_missing_wait_macro ("WCOREDUMP", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
155 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
156 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
157 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
158 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
159 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
160 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
161 octave_wifstopped (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
162 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
163 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
164 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
165 #if defined (WIFSTOPPED) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
166 retval = WIFSTOPPED (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
167 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
168 warn_missing_wait_macro ("WIFSTOPPED", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
169 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
170 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
171 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
172 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
173 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
174 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
175 octave_wstopsig (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
176 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
177 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
178 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
179 #if defined (WSTOPSIG) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
180 retval = WSTOPSIG (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
181 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
182 warn_missing_wait_macro ("WSTOPSIG", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
183 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
184 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
185 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
186 } |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
187 |
15226
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
188 OCTAVE_API int |
a0af93de0ba3
fix compilation problem if wait macros are undefined
John W. Eaton <jwe@octave.org>
parents:
15221
diff
changeset
|
189 octave_wifcontinued (int status) |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
190 { |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
191 int retval = 0; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
192 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
193 #if defined (WIFCONTINUED) |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
194 retval = WIFCONTINUED (status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
195 #else |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
196 warn_missing_wait_macro ("WIFCONTINUED", status); |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
197 #endif |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
198 |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
199 return retval; |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
200 } |