diff options
author | hunt <hunt> | 2006-05-30 15:50:27 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-05-30 15:50:27 +0000 |
commit | 54232a922f4441e2fe1f84df6a2c6aa67ba5d107 (patch) | |
tree | c099f2ff80354b5582acf1cefe1c5a6c8a0cb8fc | |
parent | 3a4677f9c7ca40eafc379e829f0f2a86eae7b661 (diff) | |
download | systemtap-steved-54232a922f4441e2fe1f84df6a2c6aa67ba5d107.tar.gz systemtap-steved-54232a922f4441e2fe1f84df6a2c6aa67ba5d107.tar.xz systemtap-steved-54232a922f4441e2fe1f84df6a2c6aa67ba5d107.zip |
2006-05-30 Martin Hunt <hunt@redhat.com>
* string.stp (text_str): New.
(text_strn): New.
-rw-r--r-- | tapset/ChangeLog | 5 | ||||
-rw-r--r-- | tapset/string.stp | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index fb25fd77..3b376b0d 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2006-05-30 Martin Hunt <hunt@redhat.com> + + * string.stp (text_str): New. + (text_strn): New. + 2006-05-26 Martin Hunt <hunt@redhat.com> * errno.stp: Add octal option for returnstr. diff --git a/tapset/string.stp b/tapset/string.stp index 19b8f81f..a4cff3e4 100644 --- a/tapset/string.stp +++ b/tapset/string.stp @@ -45,4 +45,23 @@ function isinstr:long(s1:string,s2:string) %{ /* pure */ else THIS->__retvalue = 0; %} + +/* + * text_str() + * + * Takes a string, and any ASCII characters that are not printable are + * replaced by the corresponding escape sequence in the returned + * string. + */ +function text_str:string(input:string) +%{ /* pure */ + _stp_text_str(THIS->__retvalue, THIS->input, 0, 0); +%} + +function text_strn:string(input:string, len:long, quoted:long) +%{ /* pure */ + _stp_text_str(THIS->__retvalue, THIS->input, THIS->len, THIS->quoted); +%} + + /** @} */ |