1
/* main.c: The main program for bc. */
3
1
/* This file is part of GNU bc.
4
Copyright (C) 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
3
Copyright (C) 1991-1994, 1997, 2006 Free Software Foundation, Inc.
6
5
This program is free software; you can redistribute it and/or modify
7
6
it under the terms of the GNU General Public License as published by
14
13
GNU General Public License for more details.
16
15
You should have received a copy of the GNU General Public License
17
along with this program; see the file COPYING. If not, write to
16
along with this program; see the file COPYING. If not, write to:
18
17
The Free Software Foundation, Inc.
19
59 Temple Place, Suite 330
18
Foundation, Inc. 51 Franklin Street, Fifth Floor,
19
Boston, MA 02110-1301 USA
22
21
You may contact the author by:
23
22
e-mail: philnelson@acm.org
44
45
/* long option support */
45
46
static struct option long_options[] =
47
{"compile", 0, &compile_only, TRUE},
49
{"interactive", 0, 0, 'i'},
50
{"mathlib", 0, &use_math, TRUE},
51
{"quiet", 0, &quiet, TRUE},
52
{"standard", 0, &std_only, TRUE},
53
{"version", 0, 0, 'v'},
54
{"warn", 0, &warn_not_std, TRUE},
48
{"compile", 0, &compile_only, TRUE},
50
{"interactive", 0, 0, 'i'},
51
{"mathlib", 0, &use_math, TRUE},
52
{"quiet", 0, &quiet, TRUE},
53
{"standard", 0, &std_only, TRUE},
54
{"version", 0, 0, 'v'},
55
{"warn", 0, &warn_not_std, TRUE},
63
64
printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname,
64
65
" -h --help print this usage and exit\n",
65
66
" -i --interactive force interactive mode\n",
66
" -l --mathlib use the predefined math routines\n",
67
" -l --mathlib use the predefined math routines\n",
67
68
" -q --quiet don't print initial banner\n",
68
69
" -s --standard non-standard bc constructs are errors\n",
69
70
" -w --warn warn about non-standard bc constructs\n",
353
printf ("\n(interrupt) use quit to exit.\n");
356
write (1, "\n(interrupt) use quit to exit.\n", 31);
358
rl_initialize (); /* Clear readline buffer */
361
el_reset (edit); /* Clear editline buffer */
354
363
signal (SIGINT, use_quit);
366
write (1, "\n(interrupt) Exiting bc.\n", 26);