qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fraser Adams <fraser.ad...@blueyonder.co.uk>
Subject What do pn_data_narrow/pn_data_widen do
Date Wed, 21 May 2014 17:49:43 GMT
I was looking at these the other day and left scratching my head, I saw 
them in the "lookup" unit test for codec but TBH I'm really none the 
wiser, except to note that the test fails if I don't use them :-).


TBH codec could do with some API documentation, to be fair many of the 
methods are fairly obvious, but there are a few less obvious ones.

I also came across quite a subtle difference between codec and message:

PN_EXTERN ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size);
PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t 
*size);

The former return the actual size but the latter returns an error code 
with the size updated in a reference parameter. That's a fairly easy one 
to miss.

Frase


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message