In the process of trying to deal with the vls regression failure on
32-bit *nix systems I see the need for some hackery for an old type
specifier. The hack involves creating a tmp bu_vls as a copy of the
current format string and modifying it.
I see no function to deal with changing individual bu_vls characters.
Have I just missed them or should I just access the bu_vls string
directly?
Maybe we need a function like bu_vls_readc (for reading) and
bu_vls_exchc (for substituting).
(Note there is an existing appending bu_vls_putc function.)
I envision them like this:
int
bu_vls_readc(struct bu_vls *vp, const size_t pos)
{
BU_CK_VLS(vp);
/* error to request past end char */
if (pos >= vp->vls_len)
return -1;
else
return vp->vls_str[vp->vls_offset + pos];
}
int
bu_vls_exchc(struct bu_vls *vp, const size_t pos, const int c)
{
BU_CK_VLS(vp);
/* error to request past ending char */
if (pos >= vp->vls_len)
return -1;
else {
vp->vls_str[vp->vls_offset + vp->pos] = (char)c;
/* allow the caller to check for proper handling */
return vp->vls_str[vp->vls_offset + vp->pos];
}
}
Best regards,
-Tom
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel