19#ifndef __DOSFS_FAT_FILE_H__
20#define __DOSFS_FAT_FILE_H__
85 fat_file_type_t fat_file_type;
87 uint32_t fat_file_size;
97#define FAT_FILE_REMOVED 0x01
99#define FAT_FILE_META_DATA_CHANGED 0x02
101static inline bool FAT_FILE_IS_REMOVED(
const fat_file_fd_t *fat_fd)
103 return (fat_fd->flags & FAT_FILE_REMOVED) != 0;
106static inline bool FAT_FILE_HAS_META_DATA_CHANGED(
const fat_file_fd_t *fat_fd)
108 return (fat_fd->flags & FAT_FILE_META_DATA_CHANGED) != 0;
112#define F_CLU_NUM 0x01
123#define FAT_ROOTDIR_CLUSTER_NUM 0x01
125#define FAT_FD_OF_ROOT_DIR(fat_fd) \
126 ((fat_fd->dir_pos.sname.cln == FAT_ROOTDIR_CLUSTER_NUM) && \
127 (fat_fd->dir_pos.sname.ofs == 0))
143static inline uint32_t
148 return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
149 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
150 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
154fat_file_set_first_cluster_num(
fat_file_fd_t *fat_fd, uint32_t cln)
157 fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
160static inline void fat_file_set_file_size(
fat_file_fd_t *fat_fd, uint32_t s)
162 fat_fd->fat_file_size = s;
163 fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
166static inline void fat_file_set_ctime(
fat_file_fd_t *fat_fd, time_t t)
169 fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
172static inline void fat_file_set_mtime(
fat_file_fd_t *fat_fd, time_t t)
175 fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
178static inline void fat_file_set_ctime_mtime(
fat_file_fd_t *fat_fd, time_t t)
182 fat_fd->flags |= FAT_FILE_META_DATA_CHANGED;
222 uint32_t new_length);
Constants/Data Structures/Prototypes on a Volume with FAT Filesystem.
struct fat_file_fd_s fat_file_fd_t
Descriptor of a fat-file.
struct fat_file_map_s fat_file_map_t
The "fat-file" representation.
LibIO Internal Interface.
This header file defines the RTEMS Classic API.
This structure represents a chain node.
Definition: chain.h:78
Descriptor of a fat-file.
Definition: fat_file.h:74
The "fat-file" representation.
Definition: fat_file.h:62