src/events/SDL_quit.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 01 May 2015 01:12:48 -0400
changeset 9580 d37ef6990bf9
parent 9436 0af69dab9bb6
child 9619 b94b6d0bff0f
permissions -rw-r--r--
checkkeys: Readded the KEYUP event test.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
     2
  Simple DirectMedia Layer
8149
681eb46b8ac4 Fixed bug 2374 - Update copyright for 2014...
Sam Lantinga <slouken@libsdl.org>
parents: 8093
diff changeset
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
     7
  arising from the use of this software.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    11
  freely, subject to the following restrictions:
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5501
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    20
*/
8093
b43765095a6f Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents: 7190
diff changeset
    21
#include "../SDL_internal.h"
9434
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    22
#include "SDL_hints.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    23
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    24
/* General quit handling code for SDL */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    25
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
    26
#ifdef HAVE_SIGNAL_H
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    27
#include <signal.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    28
#endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    29
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    30
#include "SDL_events.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    31
#include "SDL_events_c.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    32
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    33
9434
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    34
static SDL_bool disable_signals = SDL_FALSE;
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    35
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
    36
#ifdef HAVE_SIGNAL_H
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    37
static void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    38
SDL_HandleSIG(int sig)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    39
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    40
    /* Reset the signal handler */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    41
    signal(sig, SDL_HandleSIG);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    42
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    43
    /* Signal a quit interrupt */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    44
    SDL_SendQuit();
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    45
}
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
    46
#endif /* HAVE_SIGNAL_H */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    47
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    48
/* Public functions */
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    49
static int
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    50
SDL_QuitInit_Internal(void)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    51
{
5493
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    52
#ifdef HAVE_SIGACTION
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    53
    struct sigaction action;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    54
    sigaction(SIGINT, NULL, &action);
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    55
#ifdef HAVE_SA_SIGACTION
5501
f48c1e0ca9ae Fixed compiler warning
Sam Lantinga <slouken@libsdl.org>
parents: 5493
diff changeset
    56
    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    57
#else
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    58
    if ( action.sa_handler == SIG_DFL ) {
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    59
#endif
5493
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    60
        action.sa_handler = SDL_HandleSIG;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    61
        sigaction(SIGINT, &action, NULL);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    62
    }
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    63
    sigaction(SIGTERM, NULL, &action);
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    64
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    65
#ifdef HAVE_SA_SIGACTION
5501
f48c1e0ca9ae Fixed compiler warning
Sam Lantinga <slouken@libsdl.org>
parents: 5493
diff changeset
    66
    if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
5577
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    67
#else
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    68
    if ( action.sa_handler == SIG_DFL ) {
ced8a6788629 Work on systems without sa_sigaction.
Ryan C. Gordon <icculus@icculus.org>
parents: 5535
diff changeset
    69
#endif
5493
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    70
        action.sa_handler = SDL_HandleSIG;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    71
        sigaction(SIGTERM, &action, NULL);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    72
    }
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    73
#elif HAVE_SIGNAL_H
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    74
    void (*ohandler) (int);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    75
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    76
    /* Both SIGINT and SIGTERM are translated into quit interrupts */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    77
    ohandler = signal(SIGINT, SDL_HandleSIG);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    78
    if (ohandler != SIG_DFL)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    79
        signal(SIGINT, ohandler);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    80
    ohandler = signal(SIGTERM, SDL_HandleSIG);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    81
    if (ohandler != SIG_DFL)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    82
        signal(SIGTERM, ohandler);
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
    83
#endif /* HAVE_SIGNAL_H */
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    84
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    85
    /* That's it! */
9434
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    86
    return 0;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
    87
}
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
    88
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    89
int
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    90
SDL_QuitInit(void)
1123
28ac87a38c17 Date: Fri, 08 Jul 2005 22:43:48 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
    91
{
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    92
    const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    93
    disable_signals = hint && (SDL_atoi(hint) == 1);
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    94
    if (!disable_signals) {
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    95
        return SDL_QuitInit_Internal();
9434
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    96
    }
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    97
    return 0;
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
    98
}
9434
0a695c9c3c71 Added a hint to prevent SDL from installing signal handlers.
Ryan C. Gordon <icculus@icculus.org>
parents: 8149
diff changeset
    99
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   100
static void
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   101
SDL_QuitQuit_Internal(void)
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   102
{
5493
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   103
#ifdef HAVE_SIGACTION
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   104
    struct sigaction action;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   105
    sigaction(SIGINT, NULL, &action);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   106
    if ( action.sa_handler == SDL_HandleSIG ) {
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   107
        action.sa_handler = SIG_DFL;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   108
        sigaction(SIGINT, &action, NULL);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   109
    }
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   110
    sigaction(SIGTERM, NULL, &action);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   111
    if ( action.sa_handler == SDL_HandleSIG ) {
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   112
        action.sa_handler = SIG_DFL;
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   113
        sigaction(SIGTERM, &action, NULL);
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   114
    }
a8849b1193c3 Do not break application's signal handler installed with SA_SIGINFO
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   115
#elif HAVE_SIGNAL_H
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   116
    void (*ohandler) (int);
1123
28ac87a38c17 Date: Fri, 08 Jul 2005 22:43:48 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   117
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   118
    ohandler = signal(SIGINT, SIG_DFL);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   119
    if (ohandler != SDL_HandleSIG)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   120
        signal(SIGINT, ohandler);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   121
    ohandler = signal(SIGTERM, SIG_DFL);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   122
    if (ohandler != SDL_HandleSIG)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   123
        signal(SIGTERM, ohandler);
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents: 1312
diff changeset
   124
#endif /* HAVE_SIGNAL_H */
1123
28ac87a38c17 Date: Fri, 08 Jul 2005 22:43:48 +0200 (CEST)
Sam Lantinga <slouken@libsdl.org>
parents: 769
diff changeset
   125
}
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   126
9436
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   127
void
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   128
SDL_QuitQuit(void)
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   129
{
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   130
    if (!disable_signals) {
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   131
        SDL_QuitQuit_Internal();
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   132
    }
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   133
}
0af69dab9bb6 Patched to compile on C89 compilers.
Ryan C. Gordon <icculus@icculus.org>
parents: 9435
diff changeset
   134
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   135
/* This function returns 1 if it's okay to close the application window */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   136
int
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   137
SDL_SendQuit(void)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   138
{
7190
11612d544fcd Added mobile application events, with implementations for iOS and Android
Sam Lantinga <slouken@libsdl.org>
parents: 6885
diff changeset
   139
    return SDL_SendAppEvent(SDL_QUIT);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
   140
}
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   141
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   142
/* vi: set ts=4 sw=4 expandtab: */