- set_ccx (cmd.s_cce, &set_cc[4], 'E');
- if (cmd.dec != -1)
- {
- set_decimal = cmd.dec == STC_DOT ? '.' : ',';
- set_grouping = cmd.dec == STC_DOT ? ',' : '.';
- }
- if (cmd.errors != -1)
- set_routing (cmd.errors, &set_errors);
- if (cmd.headers != -1)
- set_headers = cmd.headers == STC_NO ? 0 : (cmd.headers == STC_YES ? 1 : 2);
- if (cmd.messages != -1)
- set_routing (cmd.messages, &set_messages);
- if (cmd.mexp != -1)
- set_mexpand = cmd.mexp == STC_OFF ? 0 : 1;
- if (cmd.n_miterate != NOT_LONG)
- {
- if (cmd.n_miterate > 0)
- set_miterate = cmd.n_miterate;
- else
- msg (SE, _("Value for MITERATE (%ld) must be greater than 0."),
- cmd.n_miterate);
- }
- if (cmd.n_mnest != NOT_LONG)
- {
- if (cmd.n_mnest > 0)
- set_mnest = cmd.n_mnest;
- else
- msg (SE, _("Value for MNEST (%ld) must be greater than 0."),
- cmd.n_mnest);
- }
- if (cmd.mprint != -1)
- set_mprint = cmd.mprint == STC_OFF ? 0 : 1;
- if (cmd.n_mxerrs != NOT_LONG)
- {
- if (set_mxerrs < 1)
- msg (SE, _("MXERRS must be at least 1."));
- else
- set_mxerrs = cmd.n_mxerrs;
- }
- if (cmd.n_mxloops != NOT_LONG)
- {
- if (set_mxloops < 1)
- msg (SE, _("MXLOOPS must be at least 1."));
- else
- set_mxloops = cmd.n_mxloops;
- }
- if (cmd.n_mxmemory != NOT_LONG)
- msg (SE, _("MXMEMORY is obsolete."));
- if (cmd.n_mxwarns != NOT_LONG)
- set_mxwarns = cmd.n_mxwarns;
- if (cmd.prtbck != -1)
- set_printback = cmd.prtbck == STC_OFF ? 0 : 1;
- if (cmd.s_scripttab)
- msg (SE, _("SCRIPTTAB is obsolete."));
- if (cmd.s_tbfonts)
- msg (SW, _("TBFONTS not implemented."));
- if (cmd.s_tb1)
- msg (SW, _("TB1 not implemented."));
- if (cmd.undef != -1)
- set_undefined = cmd.undef == STC_NOWARN ? 0 : 1;
- if (cmd.n_workspace != NOT_LONG)
- msg (SE, _("WORKSPACE is obsolete."));
-
- /* PC+ compatible syntax. */
- if (cmd.scrn != -1)
- outp_enable_device (cmd.scrn == STC_OFF ? 0 : 1, OUTP_DEV_SCREEN);
-
- if (cmd.automenu != -1)
- msg (SW, _("AUTOMENU is obsolete."));
- if (cmd.beep != -1)
- msg (SW, _("BEEP is obsolete."));
-
- if (cmd.s_cprompt)
+ ok = ok && do_cc (cmd.s_cce, 4);
+
+ if (cmd.sbc_prompt)
+ set_prompt (cmd.s_prompt);
+ if (cmd.sbc_cprompt)
+ set_prompt (cmd.s_cprompt);
+ if (cmd.sbc_dprompt)
+ set_prompt (cmd.s_dprompt);
+
+ if (cmd.sbc_decimal)
+ set_decimal (cmd.dec == STC_DOT ? '.' : ',');
+ if (cmd.sbc_echo)
+ set_echo (cmd.echo == STC_ON);
+ if (cmd.sbc_endcmd)
+ set_endcmd (cmd.s_endcmd[0]);
+ if (cmd.sbc_errorbreak)
+ set_errorbreak (cmd.errbrk == STC_ON);
+ if (cmd.sbc_include)
+ set_include (cmd.inc == STC_ON);
+ if (cmd.sbc_mxerrs)
+ set_mxerrs (cmd.n_mxerrs[0]);
+ if (cmd.sbc_mxwarns)
+ set_mxwarns (cmd.n_mxwarns[0]);
+ if (cmd.sbc_nulline)
+ set_nulline (cmd.null == STC_ON);
+ if (cmd.sbc_safer)
+ set_safer_mode ();
+ if (cmd.sbc_scompression)
+ set_scompression (cmd.scompress == STC_ON);
+ if (cmd.sbc_undefined)
+ set_undefined (cmd.undef == STC_WARN);
+ if (cmd.sbc_workspace)
+ set_workspace (cmd.n_workspace[0] * 1024L);
+
+ if (cmd.sbc_block)
+ msg (SW, _("%s is obsolete."),"BLOCK");
+ if (cmd.sbc_boxstring)
+ msg (SW, _("%s is obsolete."),"BOXSTRING");
+ if (cmd.sbc_histogram)
+ msg (MW, _("%s is obsolete."),"HISTOGRAM");
+ if (cmd.sbc_menus )
+ msg (MW, _("%s is obsolete."),"MENUS");
+ if (cmd.sbc_xsort )
+ msg (SW, _("%s is obsolete."),"XSORT");
+ if (cmd.sbc_mxmemory )
+ msg (SE, _("%s is obsolete."),"MXMEMORY");
+ if (cmd.sbc_scripttab)
+ msg (SE, _("%s is obsolete."),"SCRIPTTAB");
+ if (cmd.sbc_tbfonts)
+ msg (SW, _("%s is obsolete."),"TBFONTS");
+ if (cmd.sbc_tb1 && cmd.s_tb1)
+ msg (SW, _("%s is obsolete."),"TB1");
+
+ if (cmd.sbc_case)
+ msg (SW, _("%s is not implemented."), "CASE");
+
+ if (cmd.sbc_compression)
+ msg (MW, _("Active file compression is not implemented."));
+
+ return CMD_SUCCESS;
+}
+
+/* Find the grouping characters in CC_STRING and set CC's
+ grouping and decimal members appropriately. Returns true if
+ successful, false otherwise. */
+static bool
+find_cc_separators (const char *cc_string, struct custom_currency *cc)
+{
+ const char *sp;
+ int comma_cnt, dot_cnt;
+
+ /* Count commas and periods. There must be exactly three of
+ one or the other, except that an apostrophe acts escapes a
+ following comma or period. */
+ comma_cnt = dot_cnt = 0;
+ for (sp = cc_string; *sp; sp++)
+ if (*sp == ',')
+ comma_cnt++;
+ else if (*sp == '.')
+ dot_cnt++;
+ else if (*sp == '\'' && (sp[1] == '.' || sp[1] == ',' || sp[1] == '\''))
+ sp++;
+
+ if ((comma_cnt == 3) == (dot_cnt == 3))
+ return false;
+
+ if (comma_cnt == 3)