testsuite/systemtap.string/isinstr.stp
raw| 1 | probe begin |
| 2 | { |
| 3 | a = "foo" |
| 4 | str = "abcfoobad" |
| 5 | |
| 6 | if (isinstr(str,a)) |
| 7 | printf("\"%s\" is in \"%s\"\n", a, str) |
| 8 | else |
| 9 | printf("\"%s\" is NOT in \"%s\"\n", a, str) |
| 10 | |
| 11 | str = "abcdefg" |
| 12 | if (isinstr(str,a)) |
| 13 | printf("\"%s\" is in \"%s\"\n", a, str) |
| 14 | else |
| 15 | printf("\"%s\" is NOT in \"%s\"\n", a, str) |
| 16 | |
| 17 | a = "" |
| 18 | str = "" |
| 19 | if (isinstr(str,a)) |
| 20 | printf("\"%s\" is in \"%s\"\n", a, str) |
| 21 | else |
| 22 | printf("\"%s\" is NOT in \"%s\"\n", a, str) |
| 23 | |
| 24 | exit() |
| 25 | } |