Index: include/libroar/buffer.h
===================================================================
--- include/libroar/buffer.h	(revision 5011)
+++ include/libroar/buffer.h	(revision 5109)
@@ -51,4 +51,6 @@
 #define ROAR_BUFFER_RESET                   1
 
+#define _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL_ALL
+
 struct roar_buffer;
 
@@ -65,48 +67,48 @@
 #define roar_buffer_free(x)    roar_buffer_unref(x)
 
-int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data); // no internal malloc
-int roar_buffer_delete   (struct roar_buffer *  buf, struct roar_buffer ** next);
-int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next);
+int roar_buffer_new_no_ma(struct roar_buffer ** buf, size_t len, void * data) _LIBROAR_BUFFER_STDATTRS; // no internal malloc
+int roar_buffer_delete   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ref      (struct roar_buffer *  buf);
-int roar_buffer_unref    (struct roar_buffer *  buf);
+int roar_buffer_ref      (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL;
+int roar_buffer_unref    (struct roar_buffer *  buf) _LIBROAR_ATTR_NONNULL_ALL;
 
-int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data);
+int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1);
 
-int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running);
+int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_clear_next (struct roar_buffer *  buf);
-int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next);
+int roar_buffer_clear_next (struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS _LIBROAR_ATTR_DEPRECATED;
+int roar_buffer_get_next   (struct roar_buffer *  buf, struct roar_buffer ** next) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data);
+int roar_buffer_get_data (struct roar_buffer *  buf, void   ** data) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off);
+int roar_buffer_set_offset (struct roar_buffer *  buf, size_t off) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len);
+int roar_buffer_shift_out (struct roar_buffer ** buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_meta    (struct roar_buffer *  buf, void    *  meta);
-int roar_buffer_get_meta    (struct roar_buffer *  buf, void    ** meta);
-int roar_buffer_set_meta_i32(struct roar_buffer *  buf, int32_t    meta);
-int roar_buffer_get_meta_i32(struct roar_buffer *  buf, int32_t *  meta);
+int roar_buffer_set_meta    (struct roar_buffer *  buf, void    *  meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_meta    (struct roar_buffer *  buf, void    ** meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_set_meta_i32(struct roar_buffer *  buf, int32_t    meta) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_meta_i32(struct roar_buffer *  buf, int32_t *  meta) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_type    (struct roar_buffer *  buf, int        type);
-int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type);
+int roar_buffer_set_type    (struct roar_buffer *  buf, int        type) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_type    (struct roar_buffer *  buf, int     *  type) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_len  (struct roar_buffer *  buf, size_t    len);
-int roar_buffer_get_len  (struct roar_buffer *  buf, size_t *  len);
+int roar_buffer_set_len  (struct roar_buffer *  buf, size_t    len) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_len  (struct roar_buffer *  buf, size_t *  len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_set_flag (struct roar_buffer *  buf, int flag, int reset);
-int roar_buffer_get_flag (struct roar_buffer *  buf, int flag);
+int roar_buffer_set_flag (struct roar_buffer *  buf, int flag, int reset) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_get_flag (struct roar_buffer *  buf, int flag) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy);
+int roar_buffer_duplicate (struct roar_buffer *  buf, struct roar_buffer ** copy) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats);
+int roar_buffer_ring_stats (struct roar_buffer *  buf, struct roar_buffer_stats * stats) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_read  (struct roar_buffer *  buf, void * data, size_t * len);
-int roar_buffer_ring_write (struct roar_buffer *  buf, void * data, size_t * len);
+int roar_buffer_ring_read  (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
+int roar_buffer_ring_write (struct roar_buffer *  buf, void * data, size_t * len) _LIBROAR_BUFFER_STDATTRS;
 
-int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen);
+int roar_buffer_ring_avail(struct roar_buffer *  buf, size_t * readlen, size_t * writelen) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1);
 
-int roar_buffer_ring_reset(struct roar_buffer *  buf);
+int roar_buffer_ring_reset(struct roar_buffer *  buf) _LIBROAR_BUFFER_STDATTRS;
 
 #endif
