Skip to content
Snippets Groups Projects
Verified Commit 03994ea7 authored by rahix's avatar rahix
Browse files

chore(api): Fixup file docs


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 9b106d2c
No related branches found
No related tags found
No related merge requests found
...@@ -451,26 +451,50 @@ API(API_LIGHT_SENSOR_STOP, int epic_light_sensor_stop()); ...@@ -451,26 +451,50 @@ API(API_LIGHT_SENSOR_STOP, int epic_light_sensor_stop());
/** /**
* File * File
* ==== * ====
* * Except for :c:func:`epic_open`, which models C stdio's ``fopen`` function,
* Except for epic_open, which models C stdio's fopen function, close, read and write * ``close``, ``read`` and ``write`` model `close(2)`_, `read(2)`_ and
* model close (3), read (3) and write(3) * `write(2)`_. All file-related functions return >= ``0`` on success and
* All file-related functions return >= 0 on success and -Exyz on failure, with error * ``-Exyz`` on failure, with error codes from errno.h (``EIO``, ``EINVAL``
* codes from errno.h (EIO, EINVAL etc.) * etc.)
* *
*/ * .. _close(2): http://man7.org/linux/man-pages/man2/close.2.html
API(API_FILE_OPEN, int32_t epic_open(const char* filename, const char* modeString)); * .. _read(2): http://man7.org/linux/man-pages/man2/read.2.html
* .. _write(2): http://man7.org/linux/man-pages/man2/write.2.html
*/
/** */
API(
API_FILE_OPEN,
int32_t epic_open(const char* filename, const char* modeString)
);
/** */
API(API_FILE_CLOSE, int32_t epic_close(int32_t fd)); API(API_FILE_CLOSE, int32_t epic_close(int32_t fd));
/** */
API(API_FILE_READ, int32_t epic_read(int32_t fd, void* buf, uint32_t nbytes)); API(API_FILE_READ, int32_t epic_read(int32_t fd, void* buf, uint32_t nbytes));
API(API_FILE_WRITE, int32_t epic_write(int32_t fd, const void* buf, uint32_t nbytes));
/** */
API(
API_FILE_WRITE,
int32_t epic_write(int32_t fd, const void* buf, uint32_t nbytes)
);
/** */
API(API_FILE_FLUSH, int32_t epic_flush(int32_t fd)); API(API_FILE_FLUSH, int32_t epic_flush(int32_t fd));
/** */
enum epic_stat_type { enum epic_stat_type {
EPICSTAT_FILE, /** */
EPICSTAT_DIR, EPICSTAT_FILE,
/** */
EPICSTAT_DIR,
}; };
/** */
typedef struct epic_stat_t { typedef struct epic_stat_t {
enum epic_stat_type type; /** */
enum epic_stat_type type;
} epic_stat_t; } epic_stat_t;
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment