annotate msdos/sigaction.c @ 28269:fd13be8ae190
Changes towards better type safety regarding intervals, primarily
regarding the "parent" handle. These just separate out the different
usages based on the type of parent (interval vs lisp object); later
changes will do type checking and enforcement.
* intervals.h (NULL_INTERVAL): Cast to INTERVAL type.
(INT_LISPLIKE): New macro.
(NULL_INTERVAL_P): Use it.
(INTERVAL_HAS_PARENT, INTERVAL_HAS_OBJECT, SET_INTERVAL_PARENT,
SET_INTERVAL_OBJECT, INTERVAL_PARENT, COPY_INTERVAL_PARENT,
GET_INTERVAL_OBJECT, INTERVAL_PARENT_OR_NULL): New macros.
* alloc.c (make_interval, gc_sweep): Use new macros; eliminate all
explicit references to "parent" field of struct interval and
associated unclean type conversions.
* intervals.c (create_root_interval, root_interval, rotate_right,
rotate_left, balance_possible_root_interval, split_interval_right,
split_interval_left, interval_start_pos, find_interval,
next_interval, previous_interval, update_interval,
adjust_intervals_for_insertion, delete_node, delete_interval,
adjust_intervals_for_deletion, merge_interval_right,
merge_interval_left, reproduce_tree, graft_intervals_into_buffer,
copy_intervals_to_string): Likewise.
* intervals.h (AM_LEFT_CHILD, AM_RIGHT_CHILD, RESET_INTERVAL):
Likewise.
* syntax.c (update_syntax_table): Likewise.
* intervals.c (reproduce_tree_obj): New function, like
reproduce_tree but takes a Lisp_Object for the parent. Declare
with prototype.
(graft_intervals_into_buffer): Use it when appropriate.
(reproduce_tree): Declare with prototype.
(balance_possible_root_interval): Check that the parent is a lisp
object before trying to examine its type.
author |
Ken Raeburn <raeburn@raeburn.org> |
date |
Wed, 22 Mar 2000 21:44:05 +0000 |
parents |
354e0c45cedf |
children |
695cf19ef79e |
rev |
line source |
25856
|
1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
|
|
2 #include <signal.h>
|
|
3 #include <errno.h>
|
|
4
|
|
5 int
|
|
6 sigaction(int _sig, const struct sigaction *_act, struct sigaction *_oact)
|
|
7 {
|
|
8 int retval = 0;
|
|
9
|
|
10 if (_oact)
|
|
11 {
|
|
12 void (*installed_sig)(int) = signal (_sig, SIG_IGN);
|
|
13
|
|
14 /* FIXME */
|
|
15 if (installed_sig == SIG_ERR)
|
|
16 {
|
|
17 retval = -1;
|
|
18 errno = EINVAL;
|
|
19 }
|
|
20 else
|
|
21 signal (_sig, installed_sig);
|
|
22 _oact->sa_handler = installed_sig;
|
|
23 retval = sigemptyset (&_oact->sa_mask);
|
|
24 _oact->sa_flags = 0;
|
|
25 }
|
|
26 if (_act)
|
|
27 {
|
|
28 if (signal (_sig, _act->sa_handler) == SIG_ERR)
|
|
29 {
|
|
30 retval = -1;
|
|
31 errno = EINVAL;
|
|
32 }
|
|
33 }
|
|
34 return 0;
|
|
35 }
|
|
36
|
|
37
|
|
38
|