Mercurial > hg > octave-lyh
comparison liboctave/lo-cutils.c @ 11006:aca961a3f387
provide gethostname function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 Sep 2010 03:35:46 -0400 |
parents | 82db36545def |
children | e4e82740e9cd |
comparison
equal
deleted
inserted
replaced
11005:0de4eff677d6 | 11006:aca961a3f387 |
---|---|
15 for more details. | 15 for more details. |
16 | 16 |
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with Octave; see the file COPYING. If not, see | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | 19 <http://www.gnu.org/licenses/>. |
20 | |
21 */ | |
22 | |
23 /* | |
24 | |
25 The function gethostname was adapted from a similar function from GNU | |
26 Bash, the Bourne Again SHell, copyright (C) 1987, 1989, 1991 Free | |
27 Software Foundation, Inc. | |
28 | 20 |
29 */ | 21 */ |
30 | 22 |
31 #ifdef HAVE_CONFIG_H | 23 #ifdef HAVE_CONFIG_H |
32 #include <config.h> | 24 #include <config.h> |
65 octave_strncasecmp (const char *s1, const char *s2, size_t n) | 57 octave_strncasecmp (const char *s1, const char *s2, size_t n) |
66 { | 58 { |
67 return strncasecmp (s1, s2, n); | 59 return strncasecmp (s1, s2, n); |
68 } | 60 } |
69 | 61 |
70 OCTAVE_API int | |
71 octave_gethostname (char *name, int namelen) | |
72 { | |
73 return gethostname (name, namelen); | |
74 } | |
75 | |
76 #ifdef HAVE_LOADLIBRARY_API | 62 #ifdef HAVE_LOADLIBRARY_API |
77 #include <windows.h> | 63 #include <windows.h> |
78 | 64 |
79 /* Need this since in C++ can't cast from int(*)() to void* */ | 65 /* Need this since in C++ can't cast from int(*)() to void* */ |
80 OCTAVE_API void * | 66 OCTAVE_API void * |