aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-02-01 19:43:05 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-02-01 19:43:05 +0000
commitaef4a4f4a815b58aaf1ba4288d1e58aafc589500 (patch)
treea473efbe8a8946c50176415187c559482d9f07aa /os
parentfaeafd8a6c57ae830d2f30b601323ed0ad24ff6b (diff)
downloadChibiOS-aef4a4f4a815b58aaf1ba4288d1e58aafc589500.tar.gz
ChibiOS-aef4a4f4a815b58aaf1ba4288d1e58aafc589500.tar.bz2
ChibiOS-aef4a4f4a815b58aaf1ba4288d1e58aafc589500.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3902 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/kernel/include/chfiles.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/os/kernel/include/chfiles.h b/os/kernel/include/chfiles.h
index 25eaec5db..4c63690cc 100644
--- a/os/kernel/include/chfiles.h
+++ b/os/kernel/include/chfiles.h
@@ -40,9 +40,14 @@
#define _CHFILES_H_
/**
+ * @brief No error return code.
+ */
+#define FILE_OK 0
+
+/**
* @brief Error code from the file stream methods.
*/
-#define FILE_ERROR 0xFFFFFFFFUL
+#define FILE_ERROR 0xFFFFFFFFUL
/**
* @brief File offset type.
@@ -63,7 +68,7 @@ typedef uint32_t fileoffset_t;
/* File get current position method.*/ \
fileoffset_t (*getposition)(void *instance); \
/* File seek method.*/ \
- fileoffset_t (*lseek)(void *instance, fileoffset_t offset);
+ uint32_t (*lseek)(void *instance, fileoffset_t offset);
/**
* @brief @p BaseFileStream specific data.
@@ -103,6 +108,9 @@ typedef struct {
* @details The function closes a file stream.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ * @return The operation status.
+ * @retval FILE_OK no error.
+ * @retval FILE_ERROR operation failed.
*
* @api
*/
@@ -112,38 +120,44 @@ typedef struct {
* @brief Returns an implementation dependent error code.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ * @return Implementation dependent error code.
*
* @api
*/
-#define chFileStreamGetError ((ip)->vmt->geterror(ip))
+#define chFileStreamGetError(ip) ((ip)->vmt->geterror(ip))
/**
* @brief Returns the current file size.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ * @return The file size.
*
* @api
*/
-#define chFileStreamGetSize ((ip)->vmt->getposition(ip))
+#define chFileStreamGetSize(ip) ((ip)->vmt->getposition(ip))
/**
* @brief Returns the current file pointer position.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ * @return The current position inside the file.
*
* @api
*/
-#define chFileStreamGetPosition ((ip)->vmt->getposition(ip))
+#define chFileStreamGetPosition(ip) ((ip)->vmt->getposition(ip))
/**
* @brief Moves the file current pointer to an absolute position.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
* @param[in] offset new absolute position
+ * @return The operation status.
+ * @retval FILE_OK no error.
+ * @retval FILE_ERROR operation failed.
*
* @api
*/
-#define chFileStreamSeek ((ip)->vmt->lseek(ip, offset))
+#define chFileStreamSeek(ip) ((ip)->vmt->lseek(ip, offset))
/** @} */
#endif /* _CHFILES_H_ */