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., 59 Temple Place - Suite 330, 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) \
73 #include "dictionary.h"
77 #include "file-handle.h"
81 #include "julcal/julcal.h"
92 struct dictionary *default_dict;
93 struct expression *process_if_expr;
95 struct trns_header **t_trns;
100 int FILTER_before_TEMPORARY;
102 struct file_handle *default_handle;
104 struct ctl_stmt *ctl_stack;
113 static void get_date (void);
117 init_glob (int argc UNUSED, char **argv)
119 /* FIXME: Allow i18n of other locale items (besides LC_MESSAGES). */
122 setlocale (LC_MESSAGES, "");
124 setlocale (LC_MONETARY, "");
125 bindtextdomain (PACKAGE, locale_dir);
126 textdomain (PACKAGE);
127 #endif /* ENABLE_NLS */
132 /* PORTME: If your system/OS has the nasty tendency to halt with a
133 SIGFPE whenever there's a floating-point overflow (or other
134 exception), be sure to mask off those bits in the FPU here.
135 PSPP wants a guarantee that, no matter what boneheaded
136 floating-point operation it performs, the process will not halt. */
137 #if HAVE_FEHOLDEXCEPT
143 #elif HAVE___SETFPUCW && defined(_FPU_IEEE)
144 __setfpucw (_FPU_IEEE);
146 _control87 (0xffff, 0x137f);
150 default_dict = dict_create ();
152 last_vfm_invocation = time (NULL);
155 ds_init (&tokstr, 64);
164 cp = strchr (pgmname, DIR_SEPARATOR);
177 logfn = xstrdup ("pspp.log");
186 dict_destroy(default_dict);
189 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)