diff -r 118e2386d5b4 -r 063a9f29098c ucx/cx/buffer.h
--- a/ucx/cx/buffer.h	Sat Feb 22 18:10:36 2025 +0100
+++ b/ucx/cx/buffer.h	Sun Feb 23 14:28:47 2025 +0100
@@ -89,6 +89,17 @@
 #define CX_BUFFER_COPY_ON_EXTEND 0x08
 
 /**
+ * Function pointer for cxBufferWrite that is compatible with cx_write_func.
+ * @see cx_write_func
+ */
+#define cxBufferWriteFunc  ((cx_write_func) cxBufferWrite)
+/**
+ * Function pointer for cxBufferRead that is compatible with cx_read_func.
+ * @see cx_read_func
+ */
+#define cxBufferReadFunc  ((cx_read_func) cxBufferRead)
+
+/**
  * Configuration for automatic flushing.
  */
 struct cx_buffer_flush_config_s {
@@ -128,7 +139,7 @@
 };
 
 /**
- * Type alais for the flush configuration struct.
+ * Type alias for the flush configuration struct.
  *
  * @code
  * struct cx_buffer_flush_config_s {
@@ -162,7 +173,7 @@
      *
      * @see cxBufferEnableFlushing()
      */
-    CxBufferFlushConfig* flush;
+    CxBufferFlushConfig *flush;
     /** Current position of the buffer. */
     size_t pos;
     /** Current capacity (i.e. maximum size) of the buffer. */
@@ -216,6 +227,7 @@
  * @return zero on success, non-zero if a required allocation failed
  */
 cx_attr_nonnull_arg(1)
+cx_attr_export
 int cxBufferInit(
         CxBuffer *buffer,
         void *space,
@@ -239,6 +251,7 @@
  * @see cxBufferWrite()
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferEnableFlushing(
     CxBuffer *buffer,
     CxBufferFlushConfig config
@@ -254,6 +267,7 @@
  * @see cxBufferInit()
  */
 cx_attr_nonnull
+cx_attr_export
 void cxBufferDestroy(CxBuffer *buffer);
 
 /**
@@ -268,6 +282,7 @@
  * @param buffer the buffer to deallocate
  * @see cxBufferCreate()
  */
+cx_attr_export
 void cxBufferFree(CxBuffer *buffer);
 
 /**
@@ -297,6 +312,7 @@
 cx_attr_malloc
 cx_attr_dealloc(cxBufferFree, 1)
 cx_attr_nodiscard
+cx_attr_export
 CxBuffer *cxBufferCreate(
         void *space,
         size_t capacity,
@@ -341,6 +357,7 @@
  * @see cxBufferShiftRight()
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferShift(
         CxBuffer *buffer,
         off_t shift
@@ -357,6 +374,7 @@
  * @see cxBufferShift()
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferShiftRight(
         CxBuffer *buffer,
         size_t shift
@@ -373,6 +391,7 @@
  * @see cxBufferShift()
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferShiftLeft(
         CxBuffer *buffer,
         size_t shift
@@ -400,6 +419,7 @@
  *
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferSeek(
         CxBuffer *buffer,
         off_t offset,
@@ -419,6 +439,7 @@
  * @see cxBufferReset()
  */
 cx_attr_nonnull
+cx_attr_export
 void cxBufferClear(CxBuffer *buffer);
 
 /**
@@ -431,6 +452,7 @@
  * @see cxBufferClear()
  */
 cx_attr_nonnull
+cx_attr_export
 void cxBufferReset(CxBuffer *buffer);
 
 /**
@@ -443,6 +465,7 @@
  */
 cx_attr_nonnull
 cx_attr_nodiscard
+cx_attr_export
 bool cxBufferEof(const CxBuffer *buffer);
 
 
@@ -457,6 +480,7 @@
  * @retval non-zero on allocation failure
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferMinimumCapacity(
         CxBuffer *buffer,
         size_t capacity
@@ -473,14 +497,25 @@
  * the target until the target signals that it cannot take more data by
  * returning zero via the respective write function. In that case, the remaining
  * data in this buffer is shifted to the beginning of this buffer so that the
- * newly available space can be used to append as much data as possible. This
- * function only stops writing more elements, when the flush target and this
+ * newly available space can be used to append as much data as possible.
+ *
+ * This function only stops writing more elements, when the flush target and this
  * buffer are both incapable of taking more data or all data has been written.
- * If number of items that shall be written is larger than the buffer can hold,
- * the first items from @c ptr are directly relayed to the flush target, if
- * possible.
- * The number returned by this function is only the number of elements from
- * @c ptr that could be written to either the flush target or the buffer.
+ *
+ * If, after flushing, the number of items that shall be written still exceeds
+ * the capacity or flush threshold, this function tries to write all items directly
+ * to the flush target, if possible.
+ *
+ * The number returned by this function is the number of elements from
+ * @c ptr that could be written to either the flush target or the buffer
+ * (so it does not include the number of items that had been already in the buffer
+ * in were flushed during the process).
+ *
+ * @attention
+ * When @p size is larger than one and the contents of the buffer are not aligned
+ * with @p size, flushing stops after all complete items have been flushed, leaving
+ * the mis-aligned part in the buffer.
+ * Afterward, this function only writes as many items as possible to the buffer.
  *
  * @note The signature is compatible with the fwrite() family of functions.
  *
@@ -493,6 +528,7 @@
  * @see cxBufferRead()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cxBufferWrite(
         const void *ptr,
         size_t size,
@@ -520,6 +556,7 @@
  * @see cxBufferRead()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cxBufferAppend(
         const void *ptr,
         size_t size,
@@ -581,6 +618,7 @@
  * @see cxBufferEnableFlushing()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cxBufferFlush(CxBuffer *buffer);
 
 /**
@@ -599,6 +637,7 @@
  * @see cxBufferAppend()
  */
 cx_attr_nonnull
+cx_attr_export
 size_t cxBufferRead(
         void *ptr,
         size_t size,
@@ -626,6 +665,7 @@
  * @see cxBufferTerminate()
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferPut(
         CxBuffer *buffer,
         int c
@@ -644,6 +684,7 @@
  * @return zero, if the terminator could be written, non-zero otherwise
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferTerminate(CxBuffer *buffer);
 
 /**
@@ -657,6 +698,7 @@
  */
 cx_attr_nonnull
 cx_attr_cstr_arg(2)
+cx_attr_export
 size_t cxBufferPutString(
         CxBuffer *buffer,
         const char *str
@@ -671,6 +713,7 @@
  * @return the character or @c EOF, if the end of the buffer is reached
  */
 cx_attr_nonnull
+cx_attr_export
 int cxBufferGet(CxBuffer *buffer);
 
 #ifdef __cplusplus