lo-cutils.c

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2000-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 /* This gives us a better chance of finding a prototype for strptime
00028    on some systems.  */
00029 
00030 #if ! defined (_XOPEN_SOURCE)
00031 #define _XOPEN_SOURCE
00032 #endif
00033 
00034 #include <sys/types.h>
00035 #include <unistd.h>
00036 
00037 #include <stdlib.h>
00038 #include <string.h>
00039 #include <time.h>
00040 
00041 #include "lo-cutils.h"
00042 #include "syswait.h"
00043 
00044 OCTAVE_API void
00045 octave_qsort (void *base, size_t n, size_t size,
00046               int (*cmp) (const void *, const void *))
00047 {
00048   qsort (base, n, size, cmp);
00049 }
00050 
00051 OCTAVE_API int
00052 octave_strcasecmp (const char *s1, const char *s2)
00053 {
00054   return strcasecmp (s1, s2);
00055 }
00056 
00057 OCTAVE_API int
00058 octave_strncasecmp (const char *s1, const char *s2, size_t n)
00059 {
00060   return strncasecmp (s1, s2, n);
00061 }
00062 
00063 #ifdef HAVE_LOADLIBRARY_API
00064 #include <windows.h>
00065 
00066 /* Need this since in C++ can't cast from int(*)() to void* */
00067 OCTAVE_API void *
00068 octave_w32_library_search (HINSTANCE handle, const char * name)
00069 {
00070   return (GetProcAddress (handle, name));
00071 }
00072 #endif
00073 
00074 OCTAVE_API pid_t
00075 octave_waitpid (pid_t pid, int *status, int options)
00076 {
00077   return WAITPID (pid, status, options);
00078 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines