ObjFW  Check-in [e3e464fc6e]

Overview
Comment:OFApplication: Only handle defined signals
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e3e464fc6efd7a1e572abf37d69b40f162a9d80aed2178e2b208fb0db368ad66
User & Date: js on 2017-05-06 21:31:03
Other Links: manifest | tags
Context
2017-05-06
22:06
configure: Check for wchar_t and wchar.h check-in: 13768d7743 user: js tags: trunk
21:31
OFApplication: Only handle defined signals check-in: e3e464fc6e user: js tags: trunk
19:43
Clean up a few includes check-in: cca678886f user: js tags: trunk
Changes

Modified Doxyfile from [2f9386cc09] to [711a52b3dd].

19
20
21
22
23
24
25
26



27
28
29
	     OF_NULL_RESETTABLE_PROPERTY	\
	     OF_REQUIRES_SUPER			\
	     OF_RETURNS_INNER_POINTER		\
	     OF_RETURNS_NOT_RETAINED		\
	     OF_RETURNS_RETAINED		\
	     OF_ROOT_CLASS			\
	     OF_SENTINEL			\
	     OF_WEAK_UNAVAILABLE



MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
IGNORE_PREFIX = OF of_







|
>
>
>



19
20
21
22
23
24
25
26
27
28
29
30
31
32
	     OF_NULL_RESETTABLE_PROPERTY	\
	     OF_REQUIRES_SUPER			\
	     OF_RETURNS_INNER_POINTER		\
	     OF_RETURNS_NOT_RETAINED		\
	     OF_RETURNS_RETAINED		\
	     OF_ROOT_CLASS			\
	     OF_SENTINEL			\
	     OF_WEAK_UNAVAILABLE		\
	     SIGHUP				\
	     SIGUSR1				\
	     SIGUSR2
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
IGNORE_PREFIX = OF of_

Modified src/OFApplication.h from [ce51a82a57] to [7c21208134].

9
10
11
12
13
14
15


16
17
18
19
20
21
22
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */



#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN







>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include <signal.h>

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;
#ifndef DOXYGEN
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

81

82
83
84
85
86
87
88
89
90
91
92

93

94
95
96
97
98
99
100
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGINT;

#ifndef OF_WINDOWS
/*!
 * @brief A method which is called when the application received a SIGHUP.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGHUP;



/*!
 * @brief A method which is called when the application received a SIGUSR1.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR1;



/*!
 * @brief A method which is called when the application received a SIGUSR2.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do







|











>

>











>

>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGINT;

#ifdef SIGHUP
/*!
 * @brief A method which is called when the application received a SIGHUP.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGHUP;
#endif

#ifdef SIGUSR1
/*!
 * @brief A method which is called when the application received a SIGUSR1.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do
 *	    signal-safe operations like setting a variable or calling a
 *	    signal-safe function!
 */
- (void)applicationDidReceiveSIGUSR1;
#endif

#ifdef SIGUSR2
/*!
 * @brief A method which is called when the application received a SIGUSR2.
 *
 * This signal is not available on Windows.
 *
 * @warning You are not allowed to send any messages inside this method, as
 *	    message dispatching is not signal-safe! You are only allowed to do

Modified src/OFApplication.m from [905d16d4dd] to [788679a7cf].

94
95
96
97
98
99
100
101
102


103


104
105
106
107
108
109
110
	static void						\
	handle##sig(int signal)					\
	{							\
		app->_##sig##Handler(app->_delegate,		\
		    @selector(applicationDidReceive##sig));	\
	}
SIGNAL_HANDLER(SIGINT)
#ifndef OF_WINDOWS
SIGNAL_HANDLER(SIGHUP)


SIGNAL_HANDLER(SIGUSR1)


SIGNAL_HANDLER(SIGUSR2)
#endif
#undef SIGNAL_HANDLER

int
of_application_main(int *argc, char **argv[], Class cls)
{







|

>
>

>
>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
	static void						\
	handle##sig(int signal)					\
	{							\
		app->_##sig##Handler(app->_delegate,		\
		    @selector(applicationDidReceive##sig));	\
	}
SIGNAL_HANDLER(SIGINT)
#ifdef SIGHUP
SIGNAL_HANDLER(SIGHUP)
#endif
#ifdef SIGUSR1
SIGNAL_HANDLER(SIGUSR1)
#endif
#ifdef SIGUSR2
SIGNAL_HANDLER(SIGUSR2)
#endif
#undef SIGNAL_HANDLER

int
of_application_main(int *argc, char **argv[], Class cls)
{
458
459
460
461
462
463
464
465
466


467


468
469
470
471
472
473
474
	} else								\
		signal(sig, SIG_DFL);
#endif

	_delegate = delegate;

	REGISTER_SIGNAL(SIGINT)
#ifndef OF_WINDOWS
	REGISTER_SIGNAL(SIGHUP)


	REGISTER_SIGNAL(SIGUSR1)


	REGISTER_SIGNAL(SIGUSR2)
#endif

#undef REGISTER_SIGNAL
}

- (void)OF_run







|

>
>

>
>







462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
	} else								\
		signal(sig, SIG_DFL);
#endif

	_delegate = delegate;

	REGISTER_SIGNAL(SIGINT)
#ifdef SIGHUP
	REGISTER_SIGNAL(SIGHUP)
#endif
#ifdef SIGUSR1
	REGISTER_SIGNAL(SIGUSR1)
#endif
#ifdef SIGUSR2
	REGISTER_SIGNAL(SIGUSR2)
#endif

#undef REGISTER_SIGNAL
}

- (void)OF_run