1 /*
2 
3 Copyright (C) 2009-2016   Lukas F. Reichlin
4 
5 This file is part of LTI Syncope.
6 
7 LTI Syncope is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 LTI Syncope is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with LTI Syncope.  If not, see <http://www.gnu.org/licenses/>.
19 
20 Common code for oct-files.
21 
22 Author: Lukas Reichlin <lukas.reichlin@gmail.com>
23 Created: February 2012
24 Version: 0.2
25 
26 */
27 
28 #ifndef COMMON_H
29 #define COMMON_H
30 
31 #include <octave/f77-fcn.h>
32 
33 #if defined (OCTAVE_HAVE_F77_INT_TYPE)
34 #  define TO_F77_INT(x) octave::to_f77_int (x)
35 #else
36 typedef octave_idx_type F77_INT;
37 #  define TO_F77_INT(x) (x)
38 typedef octave_idx_type F77_LOGICAL;
39 #endif
40 
41 F77_INT max (F77_INT a, F77_INT b);
42 F77_INT max (F77_INT a, F77_INT b, F77_INT c);
43 F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d);
44 F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d, F77_INT e);
45 F77_INT min (F77_INT a, F77_INT b);
46 
47 void error_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[]);
48 void warning_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[]);
49 void warning_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[], octave_idx_type offset);
50 
51 // FIXME: Keep until Octave 4.2 and older are no longer supported.
52 // This conditional defines f77_exception_encountered as a dummy constant
53 // to preserve code that needed to check its value to work correctly in older
54 // versions of Octave.
55 #if defined (OCTAVE_MAJOR_VERSION) && OCTAVE_MAJOR_VERSION >= 6
56 static const int f77_exception_encountered = 0;
57 #endif
58 
59 #include "config.h"
60 
61 #endif
62