1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 #if HAVE_READLINE_HISTORY_H
30 #include <readline/history.h>
31 #else /* no readline/history.h */
32 extern void using_history ();
33 extern int read_history ();
34 extern void stifle_history ();
35 #endif /* no readline/history.h */
36 #endif /* -lhistory */
38 #if HAVE_FPU_CONTROL_H
39 #include <fpu_control.h>
47 #elif defined (__WIN32__) && defined (__BORLANDC__)
50 #define gettext(STRING) \
65 #include "dictionary.h"
68 #include "file-handle.h"
84 struct dictionary *default_dict;
85 struct expression *process_if_expr;
87 struct trns_header **t_trns;
94 int FILTER_before_TEMPORARY;
96 struct file_handle *default_handle;
98 struct ctl_stmt *ctl_stack;
107 static void get_date (void);
111 init_glob (int argc UNUSED, char **argv)
113 set_program_name (argv[0]);
115 /* FIXME: Allow i18n of other locale items (besides LC_MESSAGES). */
118 setlocale (LC_MESSAGES, "");
120 setlocale (LC_MONETARY, "");
121 bindtextdomain (PACKAGE, locale_dir);
122 textdomain (PACKAGE);
123 #endif /* ENABLE_NLS */
129 /* PORTME: If your system/OS has the nasty tendency to halt with a
130 SIGFPE whenever there's a floating-point overflow (or other
131 exception), be sure to mask off those bits in the FPU here.
132 PSPP wants a guarantee that, no matter what boneheaded
133 floating-point operation it performs, the process will not halt. */
134 #if HAVE_FEHOLDEXCEPT
140 #elif HAVE___SETFPUCW && defined(_FPU_IEEE)
141 __setfpucw (_FPU_IEEE);
143 _control87 (0xffff, 0x137f);
147 default_dict = dict_create ();
149 last_vfm_invocation = time (NULL);
152 ds_init (&tokstr, 64);
161 cp = strchr (pgmname, DIR_SEPARATOR);
174 logfn = xstrdup ("pspp.log");
183 cancel_transformations ();
184 dict_destroy (default_dict);
187 ds_destroy (&tokstr);
199 if ((time_t) -1 == time (&t))
201 strcpy (curdate, "?? ??? 2???");
204 tmp = localtime (&t);
206 strftime (curdate, 12, "%d %b %Y",tmp);
211 _RTLENTRY _EXPFUNC _matherr (struct exception _FAR *__e)
217 _RTLENTRY _EXPFUNC _matherrl (struct _exceptionl _FAR *__e)