This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: String parsing in stap script


On Thu, 2006-11-09 at 11:25, Mike Mason wrote:
> I'm trying to figure out how to parse a string in a stap script.  Ideally,
> I'd like a function like strsep() where I pass in a string and delimiter
> and get back a token and a pointer to the string past the token. Given
> that a stap function can only pass back one value, I don't see how to
> accomplish this.  Any suggestions or is this just not possible?

Have you considered storing the parsing context in a struct (created via
embedded C) and passing around a pointer to that?

Jim

> 
> BTW, my initial reason for wanting this is to pass an array from a shell
> script to a stap script.  I figure I can just pass it as one long
> delimited string, then parse it on the stap side to get it back in array
> form.
> 
> - Mike
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]