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"
67 #include "file-handle.h"
84 struct dictionary *default_dict;
85 struct expression *process_if_expr;
87 struct transformation *t_trns;
88 size_t n_trns, m_trns, f_trns;
90 int FILTER_before_TEMPORARY;
92 struct file_handle *default_handle;
101 static void get_date (void);
105 init_glob (int argc UNUSED, char **argv)
107 set_program_name (argv[0]);
109 /* FIXME: Allow i18n of other locale items (besides LC_MESSAGES). */
112 setlocale (LC_MESSAGES, "");
114 setlocale (LC_MONETARY, "");
115 bindtextdomain (PACKAGE, locale_dir);
116 textdomain (PACKAGE);
117 #endif /* ENABLE_NLS */
123 /* PORTME: If your system/OS has the nasty tendency to halt with a
124 SIGFPE whenever there's a floating-point overflow (or other
125 exception), be sure to mask off those bits in the FPU here.
126 PSPP wants a guarantee that, no matter what boneheaded
127 floating-point operation it performs, the process will not halt. */
128 #if HAVE_FEHOLDEXCEPT
134 #elif HAVE___SETFPUCW && defined(_FPU_IEEE)
135 __setfpucw (_FPU_IEEE);
137 _control87 (0xffff, 0x137f);
141 default_dict = dict_create ();
143 last_vfm_invocation = time (NULL);
146 ds_init (&tokstr, 64);
155 cp = strchr (pgmname, DIR_SEPARATOR);
169 logfn = xstrdup ("pspp.log");
178 cancel_transformations ();
179 dict_destroy (default_dict);
183 ds_destroy (&tokstr);
195 if ((time_t) -1 == time (&t))
197 strcpy (curdate, "?? ??? 2???");
200 tmp = localtime (&t);
202 strftime (curdate, 12, "%d %b %Y",tmp);
207 _RTLENTRY _EXPFUNC _matherr (struct exception _FAR *__e)
213 _RTLENTRY _EXPFUNC _matherrl (struct _exceptionl _FAR *__e)