After reading the recent post re: Ruby's DL functions I decided to see if I
could come up with a Tidy binding. So far I have it setting/getting options,
doing CleanAndRepair and optionally saving to a file. However I'm not sure
how to get it to save to a string to be returned. The function in question
is tidyStringSave:

http://tidy.sourceforge.net/docs/api/group__Save.html#a3
int tidySaveString(TidyDoc tdoc, tmbstr buffer, uint * buflen)

I had envisioned it originally working like this:

output = String.new
Tidylib.tidySaveString(@tdoc, output)

But it's looking for a buffer object not a regular string. It's the last 2
parameters that I'm unsure of. What Ruby objects would I need to create/pass
to make this work?