164566Sgshapiro/* $NetBSD: sig.h,v 1.7 2009/02/15 21:25:01 christos Exp $ */ 264566Sgshapiro 390800Sgshapiro/*- 464566Sgshapiro * Copyright (c) 1992, 1993 564566Sgshapiro * The Regents of the University of California. All rights reserved. 664566Sgshapiro * 764566Sgshapiro * This code is derived from software contributed to Berkeley by 871349Sgshapiro * Christos Zoulas of Cornell University. 971349Sgshapiro * 1090800Sgshapiro * Redistribution and use in source and binary forms, with or without 1164566Sgshapiro * modification, are permitted provided that the following conditions 1264566Sgshapiro * are met: 1390800Sgshapiro * 1. Redistributions of source code must retain the above copyright 1490800Sgshapiro * notice, this list of conditions and the following disclaimer. 1571349Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright 1664566Sgshapiro * notice, this list of conditions and the following disclaimer in the 1764566Sgshapiro * documentation and/or other materials provided with the distribution. 1864566Sgshapiro * 3. Neither the name of the University nor the names of its contributors 1964566Sgshapiro * may be used to endorse or promote products derived from this software 2064566Sgshapiro * without specific prior written permission. 2164566Sgshapiro * 2264566Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2364566Sgshapiro * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2490800Sgshapiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2590800Sgshapiro * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2664566Sgshapiro * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2764566Sgshapiro * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2864566Sgshapiro * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2964566Sgshapiro * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3064566Sgshapiro * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3164566Sgshapiro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3264566Sgshapiro * SUCH DAMAGE. 3364566Sgshapiro * 3464566Sgshapiro * @(#)sig.h 8.1 (Berkeley) 6/4/93 3593857Sgshapiro */ 3693857Sgshapiro 3793857Sgshapiro/* 3893857Sgshapiro * el.sig.h: Signal handling functions 3993857Sgshapiro */ 4093857Sgshapiro#ifndef _h_el_sig 4193857Sgshapiro#define _h_el_sig 4293857Sgshapiro 4393857Sgshapiro#include <signal.h> 4493857Sgshapiro 4593857Sgshapiro#include "histedit.h" 4693857Sgshapiro 4793857Sgshapiro/* 4893857Sgshapiro * Define here all the signals we are going to handle 4993857Sgshapiro * The _DO macro is used to iterate in the source code 5093857Sgshapiro */ 5193857Sgshapiro#define ALLSIGS \ 5293857Sgshapiro _DO(SIGINT) \ 5393857Sgshapiro _DO(SIGTSTP) \ 5493857Sgshapiro _DO(SIGQUIT) \ 5593857Sgshapiro _DO(SIGHUP) \ 5693857Sgshapiro _DO(SIGTERM) \ 5793857Sgshapiro _DO(SIGCONT) \ 5893857Sgshapiro _DO(SIGWINCH) 5993857Sgshapiro#define ALLSIGSNO 7 6093857Sgshapiro 6193857Sgshapirotypedef struct { 6293857Sgshapiro struct sigaction sig_action[ALLSIGSNO]; 6393857Sgshapiro sigset_t sig_set; 6493857Sgshapiro volatile sig_atomic_t sig_no; 6593857Sgshapiro} *el_signal_t; 6693857Sgshapiro 6793857Sgshapiroprotected void sig_end(EditLine*); 6893857Sgshapiroprotected int sig_init(EditLine*); 6993857Sgshapiroprotected void sig_set(EditLine*); 7093857Sgshapiroprotected void sig_clr(EditLine*); 7193857Sgshapiro 7293857Sgshapiro#endif /* _h_el_sig */ 7393857Sgshapiro