annotate liboctave/lo-cutils.c @ 10180:be952ce74023

bootstrap.conf fixes
author John W. Eaton <jwe@octave.org>
date Thu, 21 Jan 2010 03:25:23 -0500
parents 6bd86b6287b1
children 0522a65bcd56
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
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006, 2007 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
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
23 /*
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
24
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
25 The function gethostname was adapted from a similar function from GNU
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
26 Bash, the Bourne Again SHell, copyright (C) 1987, 1989, 1991 Free
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
27 Software Foundation, Inc.
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
28
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
29 */
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
30
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
31 #ifdef HAVE_CONFIG_H
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
32 #include <config.h>
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
33 #endif
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
34
4290
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
35 /* 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
36 on some systems. */
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
37
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
38 #if ! defined (_XOPEN_SOURCE)
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
39 #define _XOPEN_SOURCE
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
40 #endif
73431774c0b7 [project @ 2003-01-05 06:30:44 by jwe]
jwe
parents: 4093
diff changeset
41
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
42 #ifdef HAVE_UNISTD_H
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
43 #ifdef HAVE_SYS_TYPES_H
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
44 #include <sys/types.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
45 #endif
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
46 #include <unistd.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
47 #endif
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
48
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
49 #include <stdlib.h>
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
50 #include <string.h>
3706
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
51 #include <time.h>
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
52
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
53 #include "syswait.h"
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
54
10172
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
55 OCTAVE_API int
10175
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
56 octave_link (const char *old_name, const char *new_name)
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
57 {
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
58 return link (old_name, new_name);
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
59 }
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
60
d354be89b2c3 use link module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10174
diff changeset
61 OCTAVE_API int
10176
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
62 octave_symlink (const char *old_name, const char *new_name)
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
63 {
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
64 return symlink (old_name, new_name);
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
65 }
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
66
a0665fa8798c use symlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10175
diff changeset
67 OCTAVE_API int
10177
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
68 octave_readlink (const char *name, char *buf, size_t size)
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
69 {
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
70 return readlink (name, buf, size);
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
71 }
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
72
cb3d926b4d9e use readlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10176
diff changeset
73 OCTAVE_API int
10172
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
74 octave_mkdir (const char *name, mode_t mode)
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
75 {
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
76 return mkdir (name, mode);
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
77 }
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
78
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
79 OCTAVE_API int
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
80 octave_mkfifo (const char *name, mode_t mode)
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
81 {
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
82 return mkfifo (name, mode);
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
83 }
96ed9db3345c provide wrappers for mkdir and mkfifo
John W. Eaton <jwe@octave.org>
parents: 10170
diff changeset
84
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
85 OCTAVE_API void
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
86 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
87 int (*cmp) (const void *, const void *))
3613
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
88 {
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
89 qsort (base, n, size, cmp);
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
90 }
0a93682f89c8 [project @ 2000-03-17 10:58:25 by jwe]
jwe
parents:
diff changeset
91
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
92 OCTAVE_API char *
3706
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
93 oct_strptime (const char *buf, const char *format, struct tm *tm)
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
94 {
3786
9bb6e4197fc5 [project @ 2001-02-07 18:14:43 by jwe]
jwe
parents: 3707
diff changeset
95 return (char *) strptime (buf, format, tm);
3706
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
96 }
6581e686f83f [project @ 2000-07-25 05:30:02 by jwe]
jwe
parents: 3613
diff changeset
97
4093
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 3803
diff changeset
98 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 3803
diff changeset
99
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 3803
diff changeset
100 #include <winsock.h>
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 3803
diff changeset
101
5a82e874999b [project @ 2002-10-08 23:48:45 by jwe]
jwe
parents: 3803
diff changeset
102 #elif ! defined (HAVE_GETHOSTNAME) && defined (HAVE_SYS_UTSNAME_H)
3707
58140935c812 [project @ 2000-07-28 09:40:52 by jwe]
jwe
parents: 3706
diff changeset
103
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
104 #include <sys/utsname.h>
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
105
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
106 int
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
107 gethostname (char *name, int namelen)
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
108 {
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
109 int i;
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
110 struct utsname ut;
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
111
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
112 --namelen;
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
113
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
114 uname (&ut);
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
115 i = strlen (ut.nodename) + 1;
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
116 strncpy (name, ut.nodename, i < namelen ? i : namelen);
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
117 name[namelen] = '\0';
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
118
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
119 return 0;
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
120 }
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
121
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
122 #endif
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
123
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
124 OCTAVE_API int
10169
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
125 octave_rmdir (const char *name)
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
126 {
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
127 return rmdir (name);
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
128 }
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
129
06bd6e57f889 use rmdir module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
130 OCTAVE_API int
10170
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
131 octave_rename (const char *from, const char *to)
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
132 {
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
133 return rename (from, to);
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
134 }
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
135
1dffc8b2fca7 use rename module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10169
diff changeset
136 OCTAVE_API int
6111
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
137 octave_strcasecmp (const char *s1, const char *s2)
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
138 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
139 return strcasecmp (s1, s2);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
140 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
141
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
142 OCTAVE_API int
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
143 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
144 {
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
145 return strncasecmp (s1, s2, n);
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
146 }
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
147
10178
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
148 OCTAVE_API char *
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
149 octave_tempnam (const char *pdir, const char *ppfx)
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
150 {
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
151 return tempnam (pdir, ppfx);
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
152 }
6bd86b6287b1 provide wrapper for tempnam
John W. Eaton <jwe@octave.org>
parents: 10177
diff changeset
153
10173
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
154 OCTAVE_API mode_t
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
155 octave_umask (mode_t mode)
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
156 {
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
157 #if defined (HAVE_UMASK)
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
158 return umask (mode);
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
159 #else
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
160 return 0;
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
161 #endif
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
162 }
2b1f3f156aaf provide wrapper for umask
John W. Eaton <jwe@octave.org>
parents: 10172
diff changeset
163
6111
ed81d74118bb [project @ 2006-10-27 02:43:23 by jwe]
jwe
parents: 6108
diff changeset
164 OCTAVE_API int
10174
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
165 octave_unlink (const char *name)
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
166 {
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
167 return unlink (name);
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
168 }
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
169
eb64bf1c6107 use unlink module from gnulib
John W. Eaton <jwe@octave.org>
parents: 10173
diff changeset
170 OCTAVE_API int
3803
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
171 octave_gethostname (char *name, int namelen)
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
172 {
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
173 return gethostname (name, namelen);
63c75bc3db82 [project @ 2001-02-28 08:24:40 by jwe]
jwe
parents: 3786
diff changeset
174 }
3707
58140935c812 [project @ 2000-07-28 09:40:52 by jwe]
jwe
parents: 3706
diff changeset
175
5451
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
176 #ifdef HAVE_LOADLIBRARY_API
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
177 #include <windows.h>
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
178
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
179 /* 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
180 OCTAVE_API void *
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
181 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
182 {
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
183 return (GetProcAddress (handle, name));
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
184 }
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
185 #endif
ed08548b9054 [project @ 2005-09-15 19:52:50 by jwe]
jwe
parents: 5307
diff changeset
186
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5453
diff changeset
187 OCTAVE_API pid_t
5453
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
188 octave_waitpid (pid_t pid, int *status, int options)
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
189 {
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
190 return WAITPID (pid, status, options);
89f5979e8552 [project @ 2005-09-17 00:50:58 by jwe]
jwe
parents: 5451
diff changeset
191 }