annotate liboctave/lo-cutils.c @ 13741:b0e70a71647b stable release-3-4-3

Version 3.4.3 released. * configure.ac (AC_INIT): Version number is now 3.4.3. (OCTAVE_RELEASE_DATE): Update to 2011-10-10.
author John W. Eaton <jwe@octave.org>
date Mon, 10 Oct 2011 10:23:45 -0400
parents fd0a3ac60b0e
children 72c96de7a403
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
1 /*
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
2
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11512
diff changeset
3 Copyright (C) 2000-2011 John W. Eaton
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
4
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
6
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
10 option) any later version.
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
11
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
15 for more details.
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
16
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6111
diff changeset
19 <http://www.gnu.org/licenses/>.
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
20
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
21 */
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
22
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
25 #endif
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
26
4290
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
27 /* This gives us a better chance of finding a prototype for strptime
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
28 on some systems. */
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
29
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
30 #if ! defined (_XOPEN_SOURCE)
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
31 #define _XOPEN_SOURCE
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
32 #endif
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
33
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
34 #include <sys/types.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
35 #include <unistd.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
36
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
37 #include <stdlib.h>
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
38 #include <string.h>
3706
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
39 #include <time.h>
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
40
11512
e4e82740e9cd prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents: 11006
diff changeset
41 #include "lo-cutils.h"
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
42 #include "syswait.h"
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
43
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
44 OCTAVE_API void
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
45 octave_qsort (void *base, size_t n, size_t size,
10180
be952ce74023 bootstrap.conf fixes
John W. Eaton <jwe@octave.org>
parents: 10178
diff changeset
46 int (*cmp) (const void *, const void *))
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
47 {
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
48 qsort (base, n, size, cmp);
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
49 }
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
50
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
51 OCTAVE_API int
6111
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
52 octave_strcasecmp (const char *s1, const char *s2)
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
53 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
54 return strcasecmp (s1, s2);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
55 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
56
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
57 OCTAVE_API int
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
58 octave_strncasecmp (const char *s1, const char *s2, size_t n)
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
59 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
60 return strncasecmp (s1, s2, n);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
61 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
62
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
63 #ifdef HAVE_LOADLIBRARY_API
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
64 #include <windows.h>
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
65
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
66 /* Need this since in C++ can't cast from int(*)() to void* */
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
67 OCTAVE_API void *
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
68 octave_w32_library_search (HINSTANCE handle, const char * name)
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
69 {
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
70 return (GetProcAddress (handle, name));
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
71 }
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
72 #endif
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
73
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
74 OCTAVE_API pid_t
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
75 octave_waitpid (pid_t pid, int *status, int options)
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
76 {
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
77 return WAITPID (pid, status, options);
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
78 }