diff options
-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); +%} + + /** @} */ |