From e3f4f84c02fe55b03c53402d8f91b03b56d60f86 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Tue, 16 Mar 2021 01:42:38 +0200 Subject: [PATCH] erlang port API is done; (mostly) --- include/eport.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/eport.h b/include/eport.h index 7754f15..e6d26f9 100644 --- a/include/eport.h +++ b/include/eport.h @@ -23,10 +23,20 @@ #include -size_t eport_read(FILE *, char *, size_t); +/* returns -1 in case of error, see errno than, or bytes ridden otherwise */ +ssize_t eport_read(FILE *, char *, size_t); -size_t eport_write(FILE *, char *, size_t); +/* returns -1 in case of error, see errno than, or bytes written otherwise */ +ssize_t eport_write(FILE *, char *, size_t); +/* returns -1 in case of error, otherwise returns a number of + * elements ridden from the message data + * message structure shall be preallocated, but pointers within it are not, + * e.g. all contents are set by this function. + * pointer is a message data content with size. + * NOTE: this function modifies the message data content, however freeing and + * allocation shall be done outside of this function. + */ int eport_ejabberd_msgread(char *, size_t, struct ejabber_msg *); #endif /* __EPORT_H__ */