diff src/events/SDL_quit.c @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents d910939febfa
children 4da1ee79c9af
line wrap: on
line diff
--- a/src/events/SDL_quit.c	Sun May 21 17:27:13 2006 +0000
+++ b/src/events/SDL_quit.c	Sun May 28 13:04:16 2006 +0000
@@ -32,61 +32,68 @@
 
 
 #ifdef HAVE_SIGNAL_H
-static void SDL_HandleSIG(int sig)
+static void
+SDL_HandleSIG (int sig)
 {
-	/* Reset the signal handler */
-	signal(sig, SDL_HandleSIG);
+    /* Reset the signal handler */
+    signal (sig, SDL_HandleSIG);
 
-	/* Signal a quit interrupt */
-	SDL_PrivateQuit();
+    /* Signal a quit interrupt */
+    SDL_PrivateQuit ();
 }
 #endif /* HAVE_SIGNAL_H */
 
 /* Public functions */
-int SDL_QuitInit(void)
+int
+SDL_QuitInit (void)
 {
 #ifdef HAVE_SIGNAL_H
-	void (*ohandler)(int);
+    void (*ohandler) (int);
 
-	/* Both SIGINT and SIGTERM are translated into quit interrupts */
-	ohandler = signal(SIGINT, SDL_HandleSIG);
-	if ( ohandler != SIG_DFL )
-		signal(SIGINT, ohandler);
-	ohandler = signal(SIGTERM, SDL_HandleSIG);
-	if ( ohandler != SIG_DFL )
-		signal(SIGTERM, ohandler);
+    /* Both SIGINT and SIGTERM are translated into quit interrupts */
+    ohandler = signal (SIGINT, SDL_HandleSIG);
+    if (ohandler != SIG_DFL)
+        signal (SIGINT, ohandler);
+    ohandler = signal (SIGTERM, SDL_HandleSIG);
+    if (ohandler != SIG_DFL)
+        signal (SIGTERM, ohandler);
 #endif /* HAVE_SIGNAL_H */
 
-	/* That's it! */
-	return(0);
+    /* That's it! */
+    return (0);
 }
-void SDL_QuitQuit(void)
+
+void
+SDL_QuitQuit (void)
 {
 #ifdef HAVE_SIGNAL_H
-	void (*ohandler)(int);
+    void (*ohandler) (int);
 
-	ohandler = signal(SIGINT, SIG_DFL);
-	if ( ohandler != SDL_HandleSIG )
-		signal(SIGINT, ohandler);
-	ohandler = signal(SIGTERM, SIG_DFL);
-	if ( ohandler != SDL_HandleSIG )
-		signal(SIGTERM, ohandler);
+    ohandler = signal (SIGINT, SIG_DFL);
+    if (ohandler != SDL_HandleSIG)
+        signal (SIGINT, ohandler);
+    ohandler = signal (SIGTERM, SIG_DFL);
+    if (ohandler != SDL_HandleSIG)
+        signal (SIGTERM, ohandler);
 #endif /* HAVE_SIGNAL_H */
 }
 
 /* This function returns 1 if it's okay to close the application window */
-int SDL_PrivateQuit(void)
+int
+SDL_PrivateQuit (void)
 {
-	int posted;
+    int posted;
 
-	posted = 0;
-	if ( SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE ) {
-		SDL_Event event;
-		event.type = SDL_QUIT;
-		if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
-			posted = 1;
-			SDL_PushEvent(&event);
-		}
-	}
-	return(posted);
+    posted = 0;
+    if (SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE) {
+        SDL_Event event;
+        event.type = SDL_QUIT;
+        if ((SDL_EventOK == NULL) || (*SDL_EventOK) (&event)) {
+            posted = 1;
+            SDL_PushEvent (&event);
+        }
+    }
+    return (posted);
 }
+
+/* vi: set ts=4 sw=4 expandtab: */