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 API Documentation for Proton message, codec etc.would be useful.
Date Sat, 22 Mar 2014 12:44:07 GMT
Hey all,
There doesn't seem to be any useful API documentation for Message. 
Things like pn_message_set_address are fairly obvious to be fair, but 
there are a few methods that leave me scratching my head:

PN_EXTERN pn_format_t pn_message_get_format(pn_message_t *message);
PN_EXTERN int pn_message_set_format(pn_message_t *message, pn_format_t 
format);

PN_EXTERN int pn_message_load(pn_message_t *message, const char *data, 
size_t size);
PN_EXTERN int pn_message_load_data(pn_message_t *message, const char 
*data, size_t size);
PN_EXTERN int pn_message_load_text(pn_message_t *message, const char 
*data, size_t size);
PN_EXTERN int pn_message_load_amqp(pn_message_t *message, const char 
*data, size_t size);
PN_EXTERN int pn_message_load_json(pn_message_t *message, const char 
*data, size_t size);

PN_EXTERN int pn_message_save(pn_message_t *message, char *data, size_t 
*size);
PN_EXTERN int pn_message_save_data(pn_message_t *message, char *data, 
size_t *size);
PN_EXTERN int pn_message_save_text(pn_message_t *message, char *data, 
size_t *size);
PN_EXTERN int pn_message_save_amqp(pn_message_t *message, char *data, 
size_t *size);
PN_EXTERN int pn_message_save_json(pn_message_t *message, char *data, 
size_t *size);

PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes, 
size_t size);
PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t 
*size);

PN_EXTERN ssize_t pn_message_data(char *dst, size_t available, const 
char *src, size_t size);


What's the intent of the load/save/encode/decode/data methods - the load 
and save look like "convenience" methods for the C API and don't seem to 
be used on the Python API which does its own introspection but I'm 
really not sure.

Similarly codec/data could do with some API documentation, again some 
methods are fairly obvious but others are quite cryptic:

PN_EXTERN int pn_data_copy(pn_data_t *data, pn_data_t *src);
PN_EXTERN int pn_data_append(pn_data_t *data, pn_data_t *src);
PN_EXTERN int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit);
PN_EXTERN void pn_data_narrow(pn_data_t *data);
PN_EXTERN void pn_data_widen(pn_data_t *data);
PN_EXTERN pn_handle_t pn_data_point(pn_data_t *data);
PN_EXTERN bool pn_data_restore(pn_data_t *data, pn_handle_t point);


Regards,
Frase



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


Mime
View raw message