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
26 #if TIME_WITH_SYS_TIME
38 #if HAVE_READLINE_HISTORY_H
39 #include <readline/history.h>
40 #else /* no readline/history.h */
41 extern void using_history ();
42 extern int read_history ();
43 extern void stifle_history ();
44 #endif /* no readline/history.h */
45 #endif /* -lhistory */
47 #if HAVE_FPU_CONTROL_H
48 #include <fpu_control.h>
56 #elif defined (__WIN32__) && defined (__BORLANDC__)
59 #define gettext(STRING) \
74 #include "dictionary.h"
77 #include "file-handle.h"
91 struct dictionary *default_dict;
92 struct expression *process_if_expr;
94 struct trns_header **t_trns;
101 int FILTER_before_TEMPORARY;
103 struct file_handle *default_handle;
105 struct ctl_stmt *ctl_stack;
114 static void get_date (void);
118 init_glob (int argc UNUSED, char **argv)
120 /* FIXME: Allow i18n of other locale items (besides LC_MESSAGES). */
123 setlocale (LC_MESSAGES, "");
125 setlocale (LC_MONETARY, "");
126 bindtextdomain (PACKAGE, locale_dir);
127 textdomain (PACKAGE);
128 #endif /* ENABLE_NLS */
134 /* PORTME: If your system/OS has the nasty tendency to halt with a
135 SIGFPE whenever there's a floating-point overflow (or other
136 exception), be sure to mask off those bits in the FPU here.
137 PSPP wants a guarantee that, no matter what boneheaded
138 floating-point operation it performs, the process will not halt. */
139 #if HAVE_FEHOLDEXCEPT
145 #elif HAVE___SETFPUCW && defined(_FPU_IEEE)
146 __setfpucw (_FPU_IEEE);
148 _control87 (0xffff, 0x137f);
152 default_dict = dict_create ();
154 last_vfm_invocation = time (NULL);
157 ds_init (&tokstr, 64);
166 cp = strchr (pgmname, DIR_SEPARATOR);
179 logfn = xstrdup ("pspp.log");
188 cancel_transformations ();
189 dict_destroy (default_dict);
192 ds_destroy (&tokstr);
204 if ((time_t) -1 == time (&t))
206 strcpy (curdate, "?? ??? 2???");
209 tmp = localtime (&t);
211 strftime (curdate, 12, "%d %b %Y",tmp);
216 _RTLENTRY _EXPFUNC _matherr (struct exception _FAR *__e)
222 _RTLENTRY _EXPFUNC _matherrl (struct _exceptionl _FAR *__e)