Re: plugins and strings
jon klein <[email protected]>
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
On Apr 5, 2004, at 2:36 PM, Marcin Pilat wrote: > I’m working on a plugin to add some string functionality to breve. > > My question is regarding strings. How can I return strings using the > return variable? What I actually want to do is given a string, I want > to return a list of substrings of that string. What do I need to do > in order to return strings in such a way? I can already return a > list, but appending to a list requires a stEval. Do I need to create > a new stEval and how? Can somebody provide me with a code snippet? You can pass in an stEval and it will be copied to the list: // stringEval is a local variable stEval stringEval; // set the type and value of the stEval stringEval.type = ST_STRING; STSTRING(stringEval) = "some text"; // set retain to 1, unless the memory for the text has // been allocated by "slMalloc" stringEval.retain = 1; // add the string to the list. the list will COPY the // string, so we can now reuse, or disregard stringEval stEvalListAppend(list, &stringEval); - jon klein _______________________________________________ breve mailing list [email protected] http://www.spiderland.org/mailman/listinfo/breve