/*
- Bacula® - The Network Backup Solution
-
- Copyright (C) 1981-2012 Free Software Foundation Europe e.V.
- Yes, that is 1981 no error.
-
- The main author of Bacula is Kern Sibbald, with contributions from
- many others, a complete list can be found in the file AUTHORS.
- This program is Free Software; you can redistribute it and/or
- modify it under the terms of version three of the GNU Affero General Public
- License as published by the Free Software Foundation and included
- in the file LICENSE.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
- Bacula® is a registered trademark of Kern Sibbald.
- The licensor of Bacula is the Free Software Foundation Europe
- (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
- Switzerland, email:ftf@fsfeurope.org.
+ Bacula(R) - The Network Backup Solution
+
+
+ The original author of Bacula is Kern Sibbald, with contributions
+ from many others, a complete list can be found in the file AUTHORS.
+
+ You may use this file and others of this release according to the
+ license defined in the LICENSE file, which includes the Affero General
+ Public License, v3.0 ("AGPLv3") and some additional permissions and
+ terms pursuant to its AGPLv3 Section 7.
+
+ This notice must be preserved when any source code is
+ conveyed and/or propagated.
+
+ Bacula(R) is a registered trademark of Kern Sibbald.
*/
/*
Generalized console input/output handler
#include <curses.h>
#include <term.h>
-#if defined(HAVE_SUN_OS)
-#if !defined(_TERM_H)
+#ifdef HAVE_SUN_OS
+#ifndef _TERM_H
extern "C" int tgetent(void *, const char *);
extern "C" int tgetnum(const char *);
extern "C" char *tgetstr (const char*, char**);
-# Note: the following on older (Solaris 10) systems
+# Note: the following on older (Solaris 10) systems
# may need to be moved to after the #endif
extern "C" char *tgoto (const char *, int, int);
#endif
extern char *UP;
#endif
-/* Forward referenced functions */
-extern "C" {
-static void sigintcatcher(int);
-}
-
static void add_smap(char *str, int func);
static void asdell();
int input_line(char *string, int length);
-extern "C" {
void con_term();
-}
void trapctlc();
int usrbrk();
void clrbrk();
/* Defaults, the main program can override these */
signal(SIGQUIT, SIG_IGN);
signal(SIGHUP, SIG_IGN);
- signal(SIGINT, sigintcatcher);
+ trapctlc();
signal(SIGWINCH, SIG_IGN);
if (!termtype) {
(void)write(1, &c, 1);
}
-
-static int brkflg = 0; /* set on user break */
-
-/* Routine to return true if user types break */
-int usrbrk()
-{
- return brkflg;
-}
-
-/* Clear break flag */
-void clrbrk()
-{
- brkflg = 0;
-
-}
-
-/* Interrupt caught here */
-static void sigintcatcher(int sig)
-{
- brkflg++;
- if (brkflg > 3) {
- normode();
- exit(1);
- }
- signal(SIGINT, sigintcatcher);
-}
-
-
-/* Trap Ctl-C */
-void trapctlc()
-{
- signal(SIGINT, sigintcatcher);
-}
-
-
/* ASCLRL() -- Clear to end of line from current position */
static void asclrl(int pos, int width)
{