view src/syssignal.h @ 96975:60149c696033

2008-07-24 Carsten Dominik <dominik@science.uva.nl> * org-exp.el (org-export-region-as-html, org-export-as-html): Make sure that calls from `org-export-region-as-html' do not do the special check for a subtree. * org-agenda.el (org-batch-store-agenda-views): Fix parsing bug. * org.el (org-open-file): Use `org-open-directory-means-index-dot-org'. (org-open-directory-means-index-dot-org): New option. * org.el (org-make-link-string): Remove link attributes from description. (org-open-at-point): Remove link attributes bevore using the path. * org-exp.el (org-export-as-html): Handle link attributes. * org.el (org-extract-attributes, org-attributes-to-string): New functions. * org-table.el (org-table-to-lisp): New function. * org.el (org-narrow-to-subtree): Do not include the final newline into the narrowed region. * org-agenda.el (org-agenda-custom-commands-local-options): Fixed bug with user-define skipping condition. * org-agenda.el (org-agenda-get-restriction-and-command): Fixed typo. * org-exp.el (org-export-html-style-default): Automatic overflow handling for pre fields. (org-export-as-ascii, org-export-as-html): Change default format for time stamp. * org-table.el (org-table-export): Offer completion for translator functions, and do not require a heading above the table. * org.el (org-renumber-ordered-list, org-beginning-of-item-list): Cater for the case of a list starting in the first line of the buffer. * org-publish.el (org-publish-find-title): Bug fix. (org-publish-org-index): Implement new :index-style option. * org-publish.el (org-publish-timestamp-filename): Use SHA1-encoded file names in the timestamp directory. * org-publish.el (org-publish-needed-p): Be verbose about files published and files skipped. * org-exp.el (org-export-preprocess-string): Swap link normalization and inernal link targeting. * org-publish.el (org-publish-needed-p): Create timestamp directory when it does not exist. * org-clock.el (org-clock-out-when-done): Doc fix. * org.el (org-agenda-skip-unavailable-files): Doc fix. * org-exp.el (org-export-remove-comment-blocks-and-subtrees): Ignore case when searching for the COMMENT cookie at export time. * org-exp.el (org-get-file-contents) (org-get-and-remove-property): New functions. (org-export-handle-include-files): Handle the new prefix options. (org-export-as-html): Fix the verse environment. * org.el (org-time=, org-time<, org-time<=, org-time>) (org-time>=, org-time<>, org-2ft): New functions. (org-op-to-function): Also provide for the time testing fucntions. * org-exp.el (org-export-html-style-default): New constant. * org-exp.el (org-export-html-style-extra): New variable. (org-export-splice-style): New function. * org-exp.el (org-export-plist-vars, org-export-as-html): Implement `org-export-creator-info'. (org-export-creator-info): New option. * org.el (org-clock-drawer-start-re, org-clock-drawer-end-re) (org-property-drawer-re, org-clock-drawer-re): New constants. * org-exp.el (org-icalendar-use-deadline) (org-icalendar-use-scheduled): New options. (org-icalendar-include-todo): Default changed to t. (org-print-icalendar-entries): Implement better utilization of scheduling and deadline time stamps. (org-export-target-internal-links, org-export-as-html): Allow file lines without the "file:" prefix if the file path is an absolute path or starts with ".". * org-clock.el (org-clocktable-shift): Also undertand yesterday, lastweek etc. (org-clock-special-range): Also undertand yesterday, lastweek etc. * org.el (org-agenda-skip-archived-trees): Docstring now discourages using this. (org-scan-tags): Check for org-agenda-archives-mode. (org-map-entries): Make sure org-agenda-archives-mode is nil. (org-agenda-files): Functionality of second arg changed. * org-agenda.el (org-agenda-archives-mode): New variable (org-write-agenda, org-prepare-agenda, org-agenda-list) (org-search-view, org-todo-list, org-tags-view) (org-agenda-list-stuck-projects): Call `org-agenda-files' with `ifmode' argument. (org-agenda-quit): Reset the archives mode. (org-agenda-archives-mode): New command. (org-agenda-set-mode-name): Include archives info. * org.el (org-paste-subtree): Make sure the yanked headline is visible if it was yanked at a visible point. (org-move-item-up): Fix the bug with moving white space at the end of the item. (org-show-empty-lines-in-parent): New function.
author Carsten Dominik <dominik@science.uva.nl>
date Thu, 24 Jul 2008 13:59:56 +0000
parents ddedcecb18ef
children 9592c50233ab
line wrap: on
line source

/* syssignal.h - System-dependent definitions for signals.
   Copyright (C) 1993, 1999, 2001, 2002, 2003, 2004,
                 2005, 2006, 2007, 2008  Free Software Foundation, Inc.

This file is part of GNU Emacs.

GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

GNU Emacs 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 General Public License
along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */

extern void init_signals P_ ((void));

#if defined (HAVE_GTK_AND_PTHREAD) || (defined (HAVE_CARBON) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
#include <pthread.h>
/* If defined, asynchronous signals delivered to a non-main thread are
   forwarded to the main thread.  */
#define FORWARD_SIGNAL_TO_MAIN_THREAD
#endif

#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
extern pthread_t main_thread;
#endif

#ifdef POSIX_SIGNALS

/* Don't #include <signal.h>.  That header should always be #included
   before "config.h", because some configuration files (like s/hpux.h)
   indicate that SIGIO doesn't work by #undef-ing SIGIO.  If this file
   #includes <signal.h>, then that will re-#define SIGIO and confuse
   things.  */
/* XXX This is not correct anymore, there is a BROKEN_SIGIO macro. */

#define SIGMASKTYPE sigset_t

#define SIGEMPTYMASK (empty_mask)
#define SIGFULLMASK (full_mask)
extern sigset_t empty_mask, full_mask;

/* POSIX pretty much destroys any possibility of writing sigmask as a
   macro in standard C.  We always define our own version because the
   predefined macro in Glibc 2.1 is only provided for compatility for old
   programs that use int as signal mask type.  */
#undef sigmask
#ifdef __GNUC__
#define sigmask(SIG) 				\
  ({						\
    sigset_t _mask;				\
    sigemptyset (&_mask);			\
    sigaddset (&_mask, SIG);			\
    _mask;					\
  })
#else /* ! defined (__GNUC__) */
extern sigset_t sys_sigmask ();
#define sigmask(SIG) (sys_sigmask (SIG))
#endif /* ! defined (__GNUC__) */

#undef sigpause
#define sigpause(MASK)    sigsuspend (&(MASK))

#define sigblock(SIG)    sys_sigblock (SIG)
#define sigunblock(SIG)  sys_sigunblock (SIG)
#ifndef sigsetmask
#define sigsetmask(SIG)  sys_sigsetmask (SIG)
#endif
#define sighold(SIG)     ONLY_USED_IN_BSD_4_1
#define sigrelse(SIG)    ONLY_USED_IN_BSD_4_1
#undef signal
#define signal(SIG,ACT)      sys_signal(SIG,ACT)

/* Whether this is what all systems want or not, this is what
   appears to be assumed in the source, for example data.c:arith_error.  */
typedef RETSIGTYPE (*signal_handler_t) (/*int*/);

signal_handler_t sys_signal P_ ((int signal_number, signal_handler_t action));
sigset_t sys_sigblock   P_ ((sigset_t new_mask));
sigset_t sys_sigunblock P_ ((sigset_t new_mask));
sigset_t sys_sigsetmask P_ ((sigset_t new_mask));

#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)

#else /* ! defined (POSIX_SIGNALS) */
#ifdef USG5_4

extern SIGMASKTYPE sigprocmask_set;

#ifndef sigblock
#define sigblock(sig)					\
     (sigprocmask_set = SIGEMPTYMASK | (sig),		\
      sigprocmask (SIG_BLOCK, &sigprocmask_set, NULL))
#endif

#ifndef sigunblock
#define sigunblock(sig)						\
     (sigprocmask_set = SIGFULLMASK & ~(sig),			\
      sigprocmask (SIG_SETMASK, &sigprocmask_set, NULL))
#endif

#else
#ifdef USG

#ifndef sigunblock
#define sigunblock(sig)
#endif

#else

#ifndef sigunblock
#define sigunblock(SIG) \
{ SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); }
#endif

#endif /* ! defined (USG) */
#endif /* ! defined (USG5_4) */
#endif /* ! defined (POSIX_SIGNALS) */

#ifndef SIGMASKTYPE
#define SIGMASKTYPE int
#endif

#ifndef SIGEMPTYMASK
#define SIGEMPTYMASK (0)
#endif

#ifndef SIGFULLMASK
#define SIGFULLMASK (0xffffffff)
#endif

#ifndef sigmask
#define sigmask(no) (1L << ((no) - 1))
#endif

#ifndef sigunblock
#define sigunblock(SIG) \
{ SIGMASKTYPE omask = sigblock (SIGFULLMASK); sigsetmask (omask & ~SIG); }
#endif

#define sigfree() sigsetmask (SIGEMPTYMASK)

#if defined (SIGINFO) && defined (BROKEN_SIGINFO)
#undef SIGINFO
#endif
#if defined (SIGIO) && defined (BROKEN_SIGIO)
# undef SIGIO
# if defined (__Lynx__)
# undef SIGPOLL /* Defined as SIGIO on LynxOS */
# endif
#endif
#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL)
#undef SIGPOLL
#endif
#if defined (SIGTSTP) && defined (BROKEN_SIGTSTP)
#undef SIGTSTP
#endif
#if defined (SIGURG) && defined (BROKEN_SIGURG)
#undef SIGURG
#endif
#if defined (SIGAIO) && defined (BROKEN_SIGAIO)
#undef SIGAIO
#endif
#if defined (SIGPTY) && defined (BROKEN_SIGPTY)
#undef SIGPTY
#endif


#if NSIG < NSIG_MINIMUM
# ifdef NSIG
#  undef NSIG
# endif
# define NSIG NSIG_MINIMUM
#endif

/* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
   Must do that using the killpg call.  */
#ifdef BSD_SYSTEM
#define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo)))
#else
#ifdef WINDOWSNT
#define EMACS_KILLPG(gid, signo) (kill (gid, signo))
#else
#define EMACS_KILLPG(gid, signo) (kill   (-(gid), (signo)))
#endif
#endif

/* Define SIGCHLD as an alias for SIGCLD.  There are many conditionals
   testing SIGCHLD.  */
#ifndef VMS
#ifdef SIGCLD
#ifndef SIGCHLD
#define SIGCHLD SIGCLD
#endif /* SIGCHLD */
#endif /* ! defined (SIGCLD) */
#endif /* VMS */

#ifndef HAVE_STRSIGNAL
/* strsignal is in sysdep.c */
char *strsignal ();
#endif

#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
#define SIGNAL_THREAD_CHECK(signo)                                      \
  do {                                                                  \
    if (!pthread_equal (pthread_self (), main_thread))			\
      {                                                                 \
        /* POSIX says any thread can receive the signal.  On GNU/Linux  \
           that is not true, but for other systems (FreeBSD at least)   \
           it is.  So direct the signal to the correct thread and block \
           it from this thread.  */                                     \
        sigset_t new_mask;                                              \
                                                                        \
        sigemptyset (&new_mask);                                        \
        sigaddset (&new_mask, signo);                                   \
        pthread_sigmask (SIG_BLOCK, &new_mask, 0);                      \
        pthread_kill (main_thread, signo);                              \
        return;                                                         \
      }                                                                 \
   } while (0)

#else /* not FORWARD_SIGNAL_TO_MAIN_THREAD */
#define SIGNAL_THREAD_CHECK(signo)
#endif /* not FORWARD_SIGNAL_TO_MAIN_THREAD */
/* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152
   (do not change this comment) */