On Thu, Apr 27, 2006 at 09:32:52PM -0700, Ben Pfaff wrote:
     John Darrington <[EMAIL PROTECTED]> writes:
     
     > Any objections if  we change the signature of data_out, so that the
     > first argument is char ** or struct string * , and have the function
     > allocate the required amount of storage?
     >
     >
     > Right now, we never know how big a string needs to be passed to it.
     
     We don't?  The string has to be as wide as the field width, fp->w.


I stand corrected.  We do know, but it's non constant. It might be 1
on the first call and 10000 the next.

Perhaps I should explain my motives. I want to append the result to a struct 
string.  The only way I can currently do that is to violate the encapsulation 
of struct string.

     {
       struct string s;
       ds_init(&s);
       
       .
       .
       .
       x = ds_length(&s);

       /* Somehow make sure that s has sufficient length */

       data_out (ds_c_str(&s)+x, &v->print, case_data (c, v->fv));
     }                                    


J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature

_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to