Added GPL license header to all source files
[dockapps/wmnotify.git] / src / options.c
index 1d3e066..d56f2ba 100644 (file)
@@ -1,6 +1,22 @@
-/* options.c -- functions for processing command-line options and arguments
-   Copyright (C) 2003 Hugo Villeneuve */
-
+/*
+ * options.c -- functions for processing command-line options and arguments
+ *
+ * Copyright (C) 2003 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
 
 #if HAVE_CONFIG_H
 #  include "config.h"
@@ -75,12 +91,12 @@ ParseCommandLineOptions( int argc, char *argv[] )
 {
   int i;
   char *token;
-  bool config_file_on = FALSE;
-  bool display_on     = FALSE;
-  bool geometry_on    = FALSE;
+  bool config_file_on = false;
+  bool display_on     = false;
+  bool geometry_on    = false;
 
   /* Default values. */
-  wmnotify_infos.debug = FALSE;
+  wmnotify_infos.debug = false;
   
   for( i = 1; i < argc; i++ ) {
     token = argv[i];
@@ -90,7 +106,7 @@ ParseCommandLineOptions( int argc, char *argv[] )
       switch( token[1] ) {
       case 'c':
        if( strlen( &token[1] ) == 1 ) {
-         config_file_on = TRUE;
+         config_file_on = true;
        }
        else {
          InvalidOption( "invalid option", token );
@@ -98,15 +114,15 @@ ParseCommandLineOptions( int argc, char *argv[] )
        break;
       case 'd':
        if( STREQ( "display", &token[1] ) ) {
-         display_on = TRUE;
+         display_on = true;
        }
        else if( strlen( &token[1] ) == 1 ) {
-         wmnotify_infos.debug = TRUE;
+         wmnotify_infos.debug = true;
        }
        break;
       case 'g':
        if( STREQ( "geometry", &token[1] ) ) {
-         geometry_on = TRUE;
+         geometry_on = true;
        }
        else {
          InvalidOption( "invalid option", token );
@@ -135,17 +151,17 @@ ParseCommandLineOptions( int argc, char *argv[] )
       break;
     default:
       /* Processing options arguments */
-      if( config_file_on != FALSE ) {
+      if( config_file_on != false ) {
        wmnotify_infos.optional_config_file = token;
        /*strcpy( config_file_name, token );*/
-       config_file_on = FALSE;
+       config_file_on = false;
       }
-      else if( display_on != FALSE ) {
-       display_on = FALSE;
+      else if( display_on != false ) {
+       display_on = false;
        wmnotify_infos.display_arg = token;
       }
-      else if( geometry_on != FALSE ) {
-       geometry_on = FALSE;
+      else if( geometry_on != false ) {
+       geometry_on = false;
        wmnotify_infos.geometry_arg = token;
       }
       else {
@@ -155,13 +171,13 @@ ParseCommandLineOptions( int argc, char *argv[] )
     } /* end switch( token[0] ) */
   } /* end for */
 
-  if( config_file_on != FALSE ) {
+  if( config_file_on != false ) {
     InvalidOption( "missing configuration file parameter", NULL );
   }
-  else if( display_on != FALSE ) {
+  else if( display_on != false ) {
     InvalidOption( "missing display parameter", NULL );
   }
-  else if( geometry_on != FALSE ) {
+  else if( geometry_on != false ) {
     InvalidOption( "missing geometry parameter", NULL );
   }
 }