Mercurial > hg > octave-lyh
annotate liboctave/util/lo-cutils.h @ 17191:ca5103ab0b21
check_gzip_magic before get_file_format (wrong type detection, bug #39652)
* load-save.cc (get_file_format): call check_gzip_magic before get_file_format
to avoid random LS_MAT_ASCII detections in gzipped files.
* ls-mat-ascii.cc (looks_like_mat_ascii_file): New arg, IS which could also
be a gzipped file, is now opened in the calling function.
* ls-mat-ascii.h (looks_like_mat_ascii_file): New arg, IS.
author | Andreas Weber <andy.weber.aw@gmail.com> |
---|---|
date | Fri, 02 Aug 2013 19:48:34 +0200 |
parents | 58018d0e9a71 |
children |
rev | line source |
---|---|
11512
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11512
diff
changeset
|
3 Copyright (C) 2012 John W. Eaton |
11512
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 #if !defined (octave_liboctave_cutils_h) |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 #define octave_liboctave_cutils_h 1 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
15930
450e4e60d2c9
* lo-cutils.h: Move sys/types include statement outside of extern C block.
John W. Eaton <jwe@octave.org>
parents:
15928
diff
changeset
|
26 #include <sys/types.h> |
450e4e60d2c9
* lo-cutils.h: Move sys/types include statement outside of extern C block.
John W. Eaton <jwe@octave.org>
parents:
15928
diff
changeset
|
27 |
11512
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #ifdef HAVE_LOADLIBRARY_API |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #define WIN32_LEAN_AND_MEAN |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include <windows.h> |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #endif |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 #ifdef __cplusplus |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 extern "C" { |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 #endif |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 OCTAVE_API void |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 octave_qsort (void *base, size_t n, size_t size, |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 int (*cmp) (const void *, const void *)); |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 OCTAVE_API int |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 octave_strcasecmp (const char *s1, const char *s2); |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 OCTAVE_API int |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 octave_strncasecmp (const char *s1, const char *s2, size_t n); |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 #ifdef HAVE_LOADLIBRARY_API |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 OCTAVE_API void * |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 octave_w32_library_search (HINSTANCE handle, const char *name); |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 #endif |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 OCTAVE_API pid_t |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 octave_waitpid (pid_t pid, int *status, int options); |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 |
15221
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
55 OCTAVE_API int octave_wifexited (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
56 OCTAVE_API int octave_wexitstatus (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
57 OCTAVE_API int octave_wifsignaled (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
58 OCTAVE_API int octave_wtermsig (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
59 OCTAVE_API int octave_wcoredump (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
60 OCTAVE_API int octave_wifstopped (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
61 OCTAVE_API int octave_wstopsig (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
62 OCTAVE_API int octave_wifcontinued (int status); |
a83b7b2f95ee
avoid C-style cast warnings from GCC for wait-related macros
John W. Eaton <jwe@octave.org>
parents:
14741
diff
changeset
|
63 |
11512
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 #ifdef __cplusplus |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 } |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 #endif |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
e4e82740e9cd
prototype fixes for C language files
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 #endif |