#include <math.h>
#include <stddef.h>
+#include <float.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#include "kinds.h"
+/* Define the type used for the current record number for large file I/O.
+ The size must be consistent with the size defined on the compiler side. */
+#ifdef HAVE_GFC_INTEGER_8
+typedef GFC_INTEGER_8 GFC_IO_INT;
+#else
+#ifdef HAVE_GFC_INTEGER_4
+typedef GFC_INTEGER_4 GFC_IO_INT;
+#else
+#error "GFC_INTEGER_4 should be available for the library to compile".
+#endif
+#endif
+
/* The following two definitions must be consistent with the types used
by the compiler. */
/* The type used of array indices, amongst other things. */
#define GFC_REAL_16_HUGE LDBL_MAX
#endif
+#define GFC_REAL_4_DIGITS FLT_MANT_DIG
+#define GFC_REAL_8_DIGITS DBL_MANT_DIG
+#ifdef HAVE_GFC_REAL_10
+#define GFC_REAL_10_DIGITS LDBL_MANT_DIG
+#endif
+#ifdef HAVE_GFC_REAL_16
+#define GFC_REAL_16_DIGITS LDBL_MANT_DIG
+#endif
+
+#define GFC_REAL_4_RADIX FLT_RADIX
+#define GFC_REAL_8_RADIX FLT_RADIX
+#ifdef HAVE_GFC_REAL_10
+#define GFC_REAL_10_RADIX FLT_RADIX
+#endif
+#ifdef HAVE_GFC_REAL_16
+#define GFC_REAL_16_RADIX FLT_RADIX
+#endif
+
#ifndef GFC_MAX_DIMENSIONS
#define GFC_MAX_DIMENSIONS 7
#endif
int pedantic;
int convert;
size_t record_marker;
+ int max_subrecord_length;
}
compile_options_t;
extern void init_compile_options (void);
internal_proto(init_compile_options);
+#define GFC_MAX_SUBRECORD_LENGTH 2147483639 /* 2**31 - 9 */
/* Structure for statement options. */
ERROR_EOR = -2,
ERROR_END = -1,
ERROR_OK = 0, /* Indicates success, must be zero. */
- ERROR_OS, /* Operating system error, more info in errno. */
+ ERROR_OS = 5000, /* Operating system error, more info in errno. */
ERROR_OPTION_CONFLICT,
ERROR_BAD_OPTION,
ERROR_MISSING_OPTION,
ERROR_INTERNAL_UNIT,
ERROR_ALLOCATION,
ERROR_DIRECT_EOR,
+ ERROR_SHORT_RECORD,
ERROR_LAST /* Not a real error, the last error # + 1. */
}
error_codes;
{ SILENT, WARNING, ERROR }
notification;
+/* This is returned by notify_std and several io functions. */
+typedef enum
+{ SUCCESS = 1, FAILURE }
+try;
+
/* The filename and line number don't go inside the globals structure.
They are set by the rest of the program and must be linked to. */
extern void generate_error (struct st_parameter_common *, int, const char *);
internal_proto(generate_error);
+extern try notify_std (struct st_parameter_common *, int, const char *);
+internal_proto(notify_std);
+
/* fpu.c */
extern void set_fpu (void);
extern void close_units (void);
internal_proto(close_units);
+extern int unit_to_fd (int);
+internal_proto(unit_to_fd);
+
/* stop.c */
extern void stop_numeric (GFC_INTEGER_4);
internal_proto(internal_unpack_c10);
#endif
+#if defined HAVE_GFC_COMPLEX_16
+extern void internal_unpack_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *);
+internal_proto(internal_unpack_c16);
+#endif
+
/* string_intrinsics.c */
extern GFC_INTEGER_4 compare_string (GFC_INTEGER_4, const char *,
gfc_array_i4 * get);
iexport_proto(random_seed);
-/* normalize.c */
-
-extern GFC_REAL_4 normalize_r4_i4 (GFC_UINTEGER_4, GFC_UINTEGER_4);
-internal_proto(normalize_r4_i4);
-
-extern GFC_REAL_8 normalize_r8_i8 (GFC_UINTEGER_8, GFC_UINTEGER_8);
-internal_proto(normalize_r8_i8);
-
/* size.c */
typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t;