diff options
author | Martin Holzer <mholzer@gentoo.org> | 2003-09-24 17:42:43 +0000 |
---|---|---|
committer | Martin Holzer <mholzer@gentoo.org> | 2003-09-24 17:42:43 +0000 |
commit | 1e1521e843eaa05ae4b1fd1210eacfa33f227633 (patch) | |
tree | 3bdb266fabe757fd588753875a7c51baadd49f16 /net-analyzer/slurm/files | |
parent | Version bumped. (diff) | |
download | historical-1e1521e843eaa05ae4b1fd1210eacfa33f227633.tar.gz historical-1e1521e843eaa05ae4b1fd1210eacfa33f227633.tar.bz2 historical-1e1521e843eaa05ae4b1fd1210eacfa33f227633.zip |
Version bumped.
Diffstat (limited to 'net-analyzer/slurm/files')
-rw-r--r-- | net-analyzer/slurm/files/digest-slurm-0.2.3 | 1 | ||||
-rw-r--r-- | net-analyzer/slurm/files/slurm-0.2.3-theme.patch | 288 |
2 files changed, 289 insertions, 0 deletions
diff --git a/net-analyzer/slurm/files/digest-slurm-0.2.3 b/net-analyzer/slurm/files/digest-slurm-0.2.3 new file mode 100644 index 000000000000..82d18090ff45 --- /dev/null +++ b/net-analyzer/slurm/files/digest-slurm-0.2.3 @@ -0,0 +1 @@ +MD5 26c8fa23f40db3ecf641ce2e48c8857e slurm-0.2.3.tar.gz 50776 diff --git a/net-analyzer/slurm/files/slurm-0.2.3-theme.patch b/net-analyzer/slurm/files/slurm-0.2.3-theme.patch new file mode 100644 index 000000000000..0db48ceb407d --- /dev/null +++ b/net-analyzer/slurm/files/slurm-0.2.3-theme.patch @@ -0,0 +1,288 @@ +diff -uNr slurm-0.2.3/slurm.c slurm-0.2.3-theme/slurm.c +--- slurm-0.2.3/slurm.c 2003-04-27 19:11:55.000000000 +0300 ++++ slurm-0.2.3-theme/slurm.c 2003-05-26 18:22:08.000000000 +0300 +@@ -217,6 +217,10 @@ + #include "src/if_media.h" + #include "src/if_media.c" + ++/* theme support */ ++#include "src/theme.h" ++#include "src/theme.c" ++ + #ifdef __HPUX__ + #include "src/hpux.h" + #include "src/hpux.c" +@@ -673,7 +677,7 @@ + /* TX graph */ + if (tx_graph[x][y] == 1) + { +- chcolor(COLOR_YELLOW, colors.ingoing[1]); ++ chcolor(colors.outgoing[0], colors.outgoing[1]); + mvprintw(10+y, x+1, "x"); + } + else +@@ -979,7 +983,7 @@ + /* TX graph */ + if (tx_graph[x][y] == 1) + { +- chcolor(COLOR_YELLOW, colors.ingoing[1]); ++ chcolor(colors.outgoing[0], colors.outgoing[1]); + mvprintw(6+y, x+1, "x"); + } + else +@@ -1234,7 +1238,8 @@ + " -c old classic/combined view\n" + " -s split window mode with stats\n" + " -l large split window mode\n" +- " -i interface select network interface\n\n", ++ " -i interface select network interface\n" ++ " -t themefile use colors from themefile\n\n", + REFRESH_MIN, REFRESH_MAX); + _exit(code); + } +@@ -1295,16 +1300,16 @@ + { + mvprintw(20, 9, "Received Packets:"); + mvprintw(22, 6, "Errors on Receiving:"); +- mvprintw(20, 45,"Transmited Packets:"); ++ mvprintw(20, 44,"Transmitted Packets:"); + switch(data_type) + { + case TYPE_MEGA: + mvprintw(21,10, "MBytes Received:"); +- mvprintw(21,46, "MBytes Transmited:"); ++ mvprintw(21,45, "MBytes Transmitted:"); + break; + case TYPE_GIGA: + mvprintw(21,10, "GBytes Received:"); +- mvprintw(21,46, "GBytes Transmited:"); ++ mvprintw(21,45, "GBytes Transmitted:"); + break; + } + } +@@ -1385,30 +1390,21 @@ + unsigned short int first = 1; + unsigned short int disconnected = 0; + char hostname[MAXHOSTNAMELEN+1]; ++ char themefile[MAX_PATH_LEN+1]; + long refreshdelay = REFRESH_DEFAULT; + float tmpdelay; + int op; + int z_option = FALSE; + hostname[0] = '\0'; ++ themefile[0] = '\0'; + + /* HP-UX related as of now but could become standard */ + ifdata.if_valid = 0; + ifdata.if_id = 0; + ifdata.if_amount = 0; + +- colors.ingoing[0] = 2; colors.ingoing[1] = 1; +- colors.outgoing[0] = 3; colors.outgoing[1] = 1; +- colors.intersection[0] = 2; colors.intersection[1] = 1; +- colors.background = 0; +- colors.data[0] = 6; colors.data[1] = 1; +- colors.border[0] = 7; colors.border[1] = 1; +- colors.labels[0] = 7; colors.labels[1] = 1; +- colors.power_led[0] = 2; colors.power_led[1] = 1; +- colors.power_led[2] = 1; colors.power_led[3] = 1; +- colors.version[0] = 7; colors.version[1] = 1; +- + /* handle command line options */ +- while ((op = getopt(argc, argv, "Hhzd:clsi:")) != EOF) ++ while ((op = getopt(argc, argv, "Hhzd:clsi:t:")) != EOF) + { + switch (op) + { +@@ -1462,12 +1458,17 @@ + /* use default split window mode */ + displaymode = MODE_SPLIT; + break; ++ case 't': ++ /* theme file to read */ ++ strncpy(themefile, optarg, MAX_PATH_LEN); ++ themefile[MAX_PATH_LEN] = '\0'; ++ break; + default: + usage(1, argv); + break; + } + } +- ++ + if (!validinterface) + { + fprintf(stderr, "specified device does not exist or cannot " +@@ -1476,6 +1477,9 @@ + usage(1, argv); + } + ++ /* read theme file or use defaults */ ++ read_theme(themefile); ++ + /* Initialize some info variables */ + stats.tx_packets = 0; stats.tx_bytes = 0; stats.tx_errors = 0; + stats.rx_packets = 0; stats.rx_bytes = 0; stats.rx_errors = 0; +diff -uNr slurm-0.2.3/src/theme.c slurm-0.2.3-theme/src/theme.c +--- slurm-0.2.3/src/theme.c 1970-01-01 02:00:00.000000000 +0200 ++++ slurm-0.2.3-theme/src/theme.c 2003-05-26 18:21:54.000000000 +0300 +@@ -0,0 +1,103 @@ ++ ++void read_theme(char *theme_file) { ++ FILE *theme_ptr; ++ char current_line[MAX_LINE_LEN]; ++ char *iterator; ++ ++ /* set defaults colors. structure colors defined in slurm.h */ ++ colors.background = DEFAULT_BACKGROUND; ++ colors.ingoing[0] = DEFAULT_INGOING_COLOR; ++ colors.ingoing[1] = DEFAULT_INGOING_BOLD; ++ colors.outgoing[0] = DEFAULT_OUTGOING_COLOR; ++ colors.outgoing[1] = DEFAULT_OUTGOING_BOLD; ++ colors.intersection[0] = DEFAULT_INTERSECTION_COLOR; ++ colors.intersection[1] = DEFAULT_INTERSECTION_BOLD; ++ colors.data[0] = DEFAULT_DATA_COLOR; ++ colors.data[1] = DEFAULT_DATA_BOLD; ++ colors.border[0] = DEFAULT_BORDER_COLOR; ++ colors.border[1] = DEFAULT_BORDER_BOLD; ++ colors.labels[0] = DEFAULT_LABELS_COLOR; ++ colors.labels[1] = DEFAULT_LABELS_BOLD; ++ colors.power_led[0] = DEFAULT_POWER_LED_1_COLOR; ++ colors.power_led[1] = DEFAULT_POWER_LED_1_BOLD; ++ colors.power_led[2] = DEFAULT_POWER_LED_2_COLOR; ++ colors.power_led[3] = DEFAULT_POWER_LED_2_BOLD; ++ colors.version[0] = DEFAULT_VERSION_COLOR; ++ colors.version[1] = DEFAULT_VERSION_BOLD; ++ ++ /* no theme file given, just setting the defaults */ ++ if(strlen(theme_file) == 0) ++ return; ++ ++ /* try to open the file */ ++ if((theme_ptr = fopen(theme_file, "r")) == NULL) { ++ perror("can't open theme file"); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* read every line of config file */ ++ while((fgets(current_line, MAX_LINE_LEN, theme_ptr)) != NULL) { ++ iterator = current_line; ++ ++ /* skip whitespace */ ++ while(*iterator == ' ' || *iterator == '\t') ++ iterator++; ++ ++ /* skip comments and empty lines */ ++ if(*iterator == '#' || *iterator == '\n' || iterator == NULL) ++ continue; ++ ++ /* search for settings */ ++ search_value(iterator, "background", &colors.background); ++ ++ search_value(iterator, "data_color", &colors.data[0]); ++ search_value(iterator, "data_bold", &colors.data[1]); ++ ++ search_value(iterator, "ingoing_color", &colors.ingoing[0]); ++ search_value(iterator, "ingoing_bold", &colors.ingoing[1]); ++ search_value(iterator, "outgoing_color", &colors.outgoing[0]); ++ search_value(iterator, "outgoing_bold", &colors.outgoing[1]); ++ search_value(iterator, "intersection_color", &colors.intersection[0]); ++ search_value(iterator, "intersection_bold", &colors.intersection[1]); ++ ++ search_value(iterator, "power_led_1_color", &colors.power_led[0]); ++ search_value(iterator, "power_led_1_bold", &colors.power_led[1]); ++ search_value(iterator, "power_led_2_color", &colors.power_led[2]); ++ search_value(iterator, "power_led_2_bold", &colors.power_led[3]); ++ ++ search_value(iterator, "version_color", &colors.version[0]); ++ search_value(iterator, "version_bold", &colors.version[1]); ++ search_value(iterator, "labels_color", &colors.labels[0]); ++ search_value(iterator, "labels_bold", &colors.labels[1]); ++ search_value(iterator, "border_color", &colors.border[0]); ++ search_value(iterator, "border_bold", &colors.border[1]); ++ ++ } ++ ++ /* close file */ ++ fclose(theme_ptr); ++} ++ ++void search_value(char *line, char *setting, int *dest) { ++ char *tmp; ++ ++ tmp = line; ++ ++ /* check for setting */ ++ if(strstr(line, setting) == NULL) ++ return; ++ ++ /* read variable name */ ++ while(*tmp != ' ' && *tmp != '\t' && *tmp != '\n' && *tmp != '\0') ++ tmp++; ++ ++ /* read whitespace */ ++ while(*tmp == ' ' || *tmp == '\t') ++ tmp++; ++ ++ /* set value */ ++ *dest = atoi(tmp); ++ ++ return; ++} ++ +diff -uNr slurm-0.2.3/src/theme.h slurm-0.2.3-theme/src/theme.h +--- slurm-0.2.3/src/theme.h 1970-01-01 02:00:00.000000000 +0200 ++++ slurm-0.2.3-theme/src/theme.h 2003-05-26 18:21:54.000000000 +0300 +@@ -0,0 +1,28 @@ ++ ++/* default colors and bolding settings */ ++#define DEFAULT_BACKGROUND 0 ++#define DEFAULT_INGOING_COLOR 2 ++#define DEFAULT_INGOING_BOLD 1 ++#define DEFAULT_OUTGOING_COLOR 3 ++#define DEFAULT_OUTGOING_BOLD 1 ++#define DEFAULT_INTERSECTION_COLOR 2 ++#define DEFAULT_INTERSECTION_BOLD 1 ++#define DEFAULT_DATA_COLOR 6 ++#define DEFAULT_DATA_BOLD 1 ++#define DEFAULT_BORDER_COLOR 7 ++#define DEFAULT_BORDER_BOLD 1 ++#define DEFAULT_LABELS_COLOR 7 ++#define DEFAULT_LABELS_BOLD 1 ++#define DEFAULT_POWER_LED_1_COLOR 2 ++#define DEFAULT_POWER_LED_1_BOLD 1 ++#define DEFAULT_POWER_LED_2_COLOR 1 ++#define DEFAULT_POWER_LED_2_BOLD 1 ++#define DEFAULT_VERSION_COLOR 7 ++#define DEFAULT_VERSION_BOLD 1 ++ ++#define MAX_PATH_LEN 256 ++#define MAX_LINE_LEN 256 ++ ++void read_theme(char *theme_file); ++void search_value(char *line, char *setting, int *dest); ++ +diff -uNr slurm-0.2.3/theme.sample slurm-0.2.3-theme/theme.sample +--- slurm-0.2.3/theme.sample 1970-01-01 02:00:00.000000000 +0200 ++++ slurm-0.2.3-theme/theme.sample 2003-05-26 17:59:13.000000000 +0300 +@@ -0,0 +1,20 @@ ++# colors: -1 default, 0 black, 1 red, 2 green, 3 yellow, 4 blue, 5 magenta, ++# 6 cyan, 7 white ++# bold: 0 off, 1 on (default) ++ ++background 0 ++data_color 1 ++labels_color 7 ++border_color 7 ++version_color 7 ++ ++outgoing_color -1 ++outgoing_bold 0 ++ingoing_color 7 ++# intersection_color not used ++#intersection_color 7 ++ ++power_led_1_color 2 ++power_led_2_color 1 ++ ++# eof |