Mode details about nodes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15119 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
1968d8b0bd
commit
6a9ebbeb62
|
@ -32,6 +32,17 @@
|
|||
/* Module constants. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @name Node attributes.
|
||||
* @{
|
||||
*/
|
||||
#define VFS_NODE_ATTR_READONLY 1U
|
||||
#define VFS_NODE_ATTR_RESERVED2 2U
|
||||
#define VFS_NODE_ATTR_SYSTEM 4U
|
||||
#define VFS_NODE_ATTR_RESERVED8 8U
|
||||
#define VFS_NODE_ATTR_ISDIR 16U
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module pre-compile time settings. */
|
||||
/*===========================================================================*/
|
||||
|
@ -47,6 +58,35 @@
|
|||
/* Forward declaration because nodes holds references to drivers.*/
|
||||
typedef struct vfs_driver vfs_driver_t;
|
||||
|
||||
/**
|
||||
* @brief Type of a file offset.
|
||||
*/
|
||||
typedef uint32_t vfs_fileoffset_t;
|
||||
|
||||
/**
|
||||
* @brief Type of a node attributes.
|
||||
*/
|
||||
typedef uint32_t vfs_nodeattr_t;
|
||||
|
||||
/**
|
||||
* @brief Type of a node information structure.
|
||||
* @todo Add attributes, permissions etc.
|
||||
*/
|
||||
typedef struct vfs_node_info {
|
||||
/**
|
||||
* @brief Size of the node.
|
||||
*/
|
||||
vfs_nodeattr_t attr;
|
||||
/**
|
||||
* @brief Size of the node.
|
||||
*/
|
||||
vfs_fileoffset_t size;
|
||||
/**
|
||||
* @brief Name of the node.
|
||||
*/
|
||||
char name[VFS_CFG_MAX_NAMELEN + 1];
|
||||
} vfs_node_info_t;
|
||||
|
||||
/**
|
||||
* @brief @p vfs_node_t specific methods.
|
||||
*/
|
||||
|
@ -54,7 +94,7 @@ typedef struct vfs_driver vfs_driver_t;
|
|||
/* Instance offset, used for multiple inheritance, normally zero. It
|
||||
represents the offset between the current object and the container
|
||||
object*/ \
|
||||
size_t instance_offset; \
|
||||
size_t instance_offset; \
|
||||
/* Node release, the object is disposed when the counter reaches zero.*/ \
|
||||
void (*release)(void *instance);
|
||||
|
||||
|
@ -119,7 +159,9 @@ typedef struct vfs_directory_node {
|
|||
* @brief @p vfs_file_node_t specific methods.
|
||||
*/
|
||||
#define __vfs_file_node_methods \
|
||||
__vfs_node_methods
|
||||
__vfs_node_methods \
|
||||
bool (*first)(vfs_node_info_t *nif); \
|
||||
bool (*next)(vfs_node_info_t *nif);
|
||||
|
||||
/**
|
||||
* @brief @p vfs_file_node_t specific data.
|
||||
|
|
Loading…
Reference in New Issue