Rename macro to more appropiate name.
[bertos.git] / bertos / io / kblock.h
index 8bfe384fb3b6cc076e715f217bb99db362f2366a..f3542947c308c1453a4e44527a8a5ebcb93d3bde 100644 (file)
@@ -69,6 +69,9 @@
  * }
  * \endcode
  *
+ * \note The KBlock interface is optimized for block reads. If you need a
+ * file-like access, you can use \ref kfile_block.
+ *
  * \author Francesco Sacchi <batt@develer.com>
  *
  * $WIZ$ module_name = "kblock"
@@ -192,13 +195,9 @@ typedef struct KBlock
  * \param start The index of the start block for the limiting window in logical addressing units.
  * \param count The number of blocks to be used.
  *
+ * \return 0 if all is OK, EOF on errors.
  */
-INLINE void kblock_trim(struct KBlock *b, block_idx_t start, block_idx_t count)
-{
-       ASSERT(start + count <= b->blk_cnt);
-       b->priv.blk_start += start;
-       b->blk_cnt = count;
-}
+int kblock_trim(struct KBlock *b, block_idx_t start, block_idx_t count);
 
 
 #define KB_ASSERT_METHOD(b, method) \