Added <stdbool.h> for standard bool definitions
[dockapps/wmnotify.git] / src / options.c
index 1d3e066..58bd08b 100644 (file)
@@ -75,12 +75,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 +90,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 +98,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 +135,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 +155,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 );
   }
 }