summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreteo <eteo>2006-04-23 03:28:45 +0000
committereteo <eteo>2006-04-23 03:28:45 +0000
commit83a89572bebe11ba5d11db01b1ded66560a4b8f7 (patch)
tree88c5c04ab4056adc8987330c08a0fbf86d07a0d2
parent79cd1b2795241e23c5950f6ec7a7fe666d25ad70 (diff)
downloadsystemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.tar.gz
systemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.tar.xz
systemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.zip
2006-04-23 Eugene Teo <eteo@redhat.com>
* small_demos/ansi_colors.stp: Add an example of using octal escape sequences to display all possible ansi colors.
-rw-r--r--ChangeLog5
-rwxr-xr-xexamples/small_demos/ansi_colors.stp21
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a2a5546..3e75c78c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-23 Eugene Teo <eteo@redhat.com>
+
+ * small_demos/ansi_colors.stp: Add an example of using octal
+ escape sequences to display all possible ansi colors.
+
2006-04-21 Eugene Teo <eteo@redhat.com>
PR 1326
diff --git a/examples/small_demos/ansi_colors.stp b/examples/small_demos/ansi_colors.stp
new file mode 100755
index 00000000..0d9d7c47
--- /dev/null
+++ b/examples/small_demos/ansi_colors.stp
@@ -0,0 +1,21 @@
+#! /usr/bin/env stap
+
+probe begin {
+ printf("a \\ b |");
+ for (c = 40; c < 48; c++)
+ printf(" %d ", c);
+ printf("\12");
+ for (l = 0; l < 71; l++)
+ printf("-");
+ printf("\12");
+
+ for (r = 30; r < 38; r++)
+ for (t = 0; t < 2; t++) {
+ printf("%d |", r);
+ for (c = 40; c < 48; c++)
+ printf("\033[%d;%d%s %s \033[0;0m",
+ r, c, !t ? "m" : ";1m", !t ? "Normal" : "Bold ");
+ printf("\12");
+ }
+ exit();
+}