MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/systemtap/tapset/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/systemtap/tapset/string.stp
/** @addtogroup library
* The library tapset is a collection of standard functions.
* @{
*/

/** @addtogroup library
* @code function strlen:long(s:string) @endcode
* @param s string
* @return Returns the length of the string.
*/
function strlen:long(s:string) %{ /* pure */
        THIS->__retvalue = strlen(THIS->s);
%}

/** @addtogroup library
* @code function substr:string(str:string,start:long,length:long) @endcode
* @param str string
* @param start Starting position. 0 = start of the string
* @param length Length of string to return.
* @return Returns the substring.
*/
function substr:string(str:string,start:long, length:long) %{ /* pure */
	int length = THIS->length + 1 > MAXSTRINGLEN ? MAXSTRINGLEN : THIS->length + 1;
	if (THIS->start < 0   || length < 1) {
		return;
	} else
		strlcpy(THIS->__retvalue, THIS->str + THIS->start, length);
%}


/** @addtogroup library
* @code isinstr:long(s1:string,s2:string) @endcode
* @param s1 string
* @param s2 string
* @return Returns 1 if s2 is in s1. Otherwise 0.
*/
function isinstr:long(s1:string,s2:string) %{ /* pure */
	if (strstr(THIS->s1,THIS->s2) != NULL)
		THIS->__retvalue = 1;
	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, 0);
%}

function text_strn:string(input:string, len:long, quoted:long)
%{ /* pure */
	_stp_text_str(THIS->__retvalue, THIS->input, THIS->len, THIS->quoted, 0);
%}


/** @} */

Anon7 - 2021