On Tue, Oct 05, 2010 at 09:59:48PM -0700, David MacMahon wrote: > > On Oct 5, 2010, at 21:42 , Alan W. Irwin wrote: > > > On 2010-10-05 22:19-0400 Schwab,Wilhelm K wrote: > > > >> I was interested in building it (5.9.7) to try the legend code. > >> Is there a reason for the double pointer? It seems that > >> > >> this part\0that part\0...\0and the last part\0\0 > >> > >> would do the job just as easily?? > > > > I am willing to keep an open mind about changing the > > present approach if we run into trouble interfacing const char ** > > text to > > other languages. > > FWIW, I vote for keeping it as char**. For the smallish amounts of > legend text it probably doesn't matter that much either way, but with > more and/or larger strings that might come from different locations, > the cost of copying into one buffer can become significant. Creating > an array of char* and populating with pointers into a long buffer > containing back-to-back strings is not nearly so onerous (presuming > you know how many strings you have to begin with so you can allocate > a big enough char* array). > > Does the library strdup the passed in strings, render them before > returning, or just copy the pointers for later rendering?
I second keeping it as char **. I think David has made some good points. Also, the char ** is a far more standard way of dealing with strings. It is easy to split into individual strings without having to search through the whole array of characters. It is also much more standard and hence easier to interfaces with other code and also to link in with our many language bindings. Andrew ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel