--
You received this message because you are subscribed to the Google Groups "onion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onion-dev+...@coralbits.com.
To view this discussion on the web visit https://groups.google.com/a/coralbits.com/d/msgid/onion-dev/48d3601b-8074-4949-9338-5c97840ac612%40coralbits.com.
IMHO it's very reasonable to do. I do similar things sometimes.
It seems to me that the following trivial function is then lacking:
const char*
onion_response_raw_buffer (onion_response*resp) {
if (resp) return resp->buffer;
return NULL;
}
Can I suggest adding it?
--
Basile STARYNKEVITCH == http://starynkevitch.net/Basile opinions are mine only - les opinions sont seulement miennes Bourg La Reine, France; <bas...@starynkevitch.net> (mobile phone: cf my web page / voir ma page web...)
On 11/27/19 8:56 AM, David Moreno Montero wrote:
IMHO it's very reasonable to do. I do similar things sometimes.
It seems to me that the following trivial function is then lacking:
const char*onion_response_raw_buffer (onion_response*resp) {if (resp) return resp->buffer;return NULL;}
Can I suggest adding it?
An alternative might be to extend onion_response to accept an
abstract type, defined by a generic pointer and callbacks.
In my particular case, I would use a provided FILE*
pointer, all callbacks doing fprintf, fputs
etc... on it. That FILE* would be (in my case) obtained
on Linux with open_memstream.
But then the name onion_response is no more appropriate.
Actually, I am very tempted to use some other C "templated string" machinery. Does anyone know one here?
Cheers
On 11/27/19 2:58 PM, Basile Starynkevitch wrote:
On 11/27/19 8:56 AM, David Moreno Montero wrote:
IMHO it's very reasonable to do. I do similar things sometimes.
It seems to me that the following trivial function is then lacking:
const char*onion_response_raw_buffer (onion_response*resp) {if (resp) return resp->buffer;return NULL;}
Can I suggest adding it?
An alternative might be to extend onion_response to accept an abstract type, defined by a generic pointer and callbacks.
In my particular case, I would use a provided FILE* pointer, all callbacks doing fprintf, fputs etc... on it. That FILE* would be (in my case) obtained on Linux with open_memstream.
But then the name onion_response is no more appropriate.
Actually, I am very tempted to use some other C "templated string" machinery. Does anyone know one here?
I also asked on https://softwarerecs.stackexchange.com/q/70956/1877