src/events/SDL_quit.c
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1402 d910939febfa
child 1668 4da1ee79c9af
--- 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: */