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.40 by tdb, Sun Dec 17 01:06:16 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines