On Thu, Jun 1, 2017 at 1:32 AM, Daniel Roßberg <danielmrossb...@gmail.com>
wrote:
> Shubham,
>
> > The struct bu_vls defines the char * before the string length. While
> writing
> > the import function for the annotation primitive, one has to
> > initialize(calloc) the char array to a corresponding size but the size is
> > defined later. I checked out the case for other primitives for other
> structs
> > as well. In every case the length is defined before the array, hence the
> > exact space is alloted(malloc or calloc). How to deal with this ? Can the
> > organisation of the vls_struct be changed?
>
> I don't get it. The order of members in a struct is usually
> unimportant. Do you have a code example?
>
> However, what i can say is that you should deal with a bu_vls only via
> the bu_vls_~() functions. Never touch the member variables directly.
> E.g. use bu_vls_cstr() to retrieve the string.
> And, as an example of how to import and export strings you could look
> at extrude's sketch_name.
>
> I already had a look at other primitives import functions, the "char *" is
allocated memory of length equal to NAMESIZE, i.e. 16 . but the annotation
label can have a length that the user desires. This is what I was trying to
do :
>
> https://docs.google.com/document/d/1UaDU9o9G98_qGDLMe2wenU3MPL5WxBs00niFZT6Bk_I/edit?usp=sharing
>
Regarding the dev logs, I updated them on
https://brlcad.org/wiki/Google_Summer_of_Code/2017 . I'll be updating the
progress in the previous 2-3 days soon.
Regards,
Shubham Rathore(:gabbar1947)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel