ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/saidar/saidar.c
(Generate patch)

Comparing projects/libstatgrab/src/saidar/saidar.c (file contents):
Revision 1.37 by tdb, Fri Dec 1 00:38:39 2006 UTC vs.
Revision 1.38 by tdb, Fri Dec 1 01:03:59 2006 UTC

# Line 40 | Line 40
40  
41   #ifdef HAVE_NCURSES_H
42   #include <ncurses.h>
43 + #define COLOR_SUPPORT
44   #else
45   #include <curses.h>
46   #endif
# Line 562 | Line 563 | void version_num(char *progname){
563   }
564  
565   void usage(char *progname){
566 + #ifdef COLOR_SUPPORT
567          fprintf(stderr, "Usage: %s [-d delay] [-c] [-v] [-h]\n\n", progname);
568 + #else
569 +        fprintf(stderr, "Usage: %s [-d delay] [-v] [-h]\n\n", progname);
570 + #endif
571          fprintf(stderr, "  -d    Sets the update time in seconds\n");
572 + #ifdef COLOR_SUPPORT
573          fprintf(stderr, "  -c    Enables coloured output\n");
574 + #endif
575          fprintf(stderr, "  -v    Prints version number\n");
576          fprintf(stderr, "  -h    Displays this help information.\n");
577          fprintf(stderr, "\nReport bugs to <%s>.\n", PACKAGE_BUGREPORT);
# Line 590 | Line 597 | int main(int argc, char **argv){
597                  return 1;
598          }
599  
600 + #ifdef COLOR_SUPPORT
601          while ((c = getopt(argc, argv, "d:cvh")) != -1){
602 + #else
603 +        while ((c = getopt(argc, argv, "d:vh")) != -1){
604 + #endif
605                  switch (c){
606                          case 'd':
607                                  delay = atoi(optarg);
# Line 599 | Line 610 | int main(int argc, char **argv){
610                                          exit(1);
611                                  }
612                                  break;
613 + #ifdef COLOR_SUPPORT
614                          case 'c':
615                                  colouron = 1;
616                                  break;
617 + #endif
618                          case 'v':
619                                  version_num(argv[0]);
620                                  break;
# Line 615 | Line 628 | int main(int argc, char **argv){
628  
629          signal(SIGWINCH, sig_winch_handler);
630          initscr();
631 + #ifdef COLOR_SUPPORT
632          /* turn on colour */
633          if (colouron) {
634                  if (has_colors()) {
# Line 631 | Line 645 | int main(int argc, char **argv){
645                          colouron = 0;
646                  }
647          }
648 + #endif
649          nonl();
650          cbreak();
651          noecho();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines