FAT16 directory functions
[FAT16 support]

Collaboration diagram for FAT16 directory functions:

Functions

struct fat16_dir_structfat16_open_dir (struct fat16_fs_struct *fs, const struct fat16_dir_entry_struct *dir_entry)
void fat16_close_dir (struct fat16_dir_struct *dd)
uint8_t fat16_read_dir (struct fat16_dir_struct *dd, struct fat16_dir_entry_struct *dir_entry)
uint8_t fat16_reset_dir (struct fat16_dir_struct *dd)
uint8_t fat16_create_dir (struct fat16_dir_struct *parent, const char *dir, struct fat16_dir_entry_struct *dir_entry)

Detailed Description

Functions for managing directories.

Function Documentation

void fat16_close_dir ( struct fat16_dir_struct dd  ) 

Closes a directory descriptor.

This function destroys a directory descriptor which was previously obtained by calling fat16_open_dir(). When this function returns, the given descriptor will be invalid.

Parameters:
[in] dd The directory descriptor to close.
See also:
fat16_open_dir

Definition at line 1231 of file fat16.c.

References fat16_dir_struct::fs.

Referenced by fat16_get_dir_entry_of_path().

uint8_t fat16_create_dir ( struct fat16_dir_struct parent,
const char *  dir,
struct fat16_dir_entry_struct dir_entry 
)

Creates a directory.

Creates a directory and obtains its directory entry. If the directory to create already exists, its directory entry will be returned within the dir_entry parameter.

Note:
The notes which apply to fat16_create_file also apply to this function.
Parameters:
[in] parent The handle of the parent directory of the new directory.
[in] dir The name of the directory to create.
[out] dir_entry The directory entry to fill for the new directory.
Returns:
0 on failure, 1 on success.
See also:
fat16_delete_dir

Definition at line 1888 of file fat16.c.

References fat16_dir_entry_struct::attributes, fat16_dir_entry_struct::cluster, fat16_header_struct::cluster_size, fat16_header_struct::cluster_zero_offset, fat16_dir_struct::dir_entry, fat16_dir_entry_struct::entry_offset, fat16_append_clusters(), FAT16_ATTRIB_DIR, fat16_clear_cluster(), fat16_find_offset_for_dir_entry(), fat16_free_clusters(), fat16_read_dir(), fat16_reset_dir(), fat16_write_dir_entry(), fat16_dir_struct::fs, fat16_fs_struct::header, and fat16_dir_entry_struct::long_name.

struct fat16_dir_struct* fat16_open_dir ( struct fat16_fs_struct fs,
const struct fat16_dir_entry_struct dir_entry 
) [read]

Opens a directory.

Parameters:
[in] fs The filesystem on which the directory to open resides.
[in] dir_entry The directory entry which stands for the directory to open.
Returns:
An opaque directory descriptor on success, 0 on failure.
See also:
fat16_close_dir

Definition at line 1189 of file fat16.c.

References fat16_dir_entry_struct::attributes, fat16_dir_entry_struct::cluster, fat16_dir_struct::dir_entry, fat16_dir_struct::entry_cluster, fat16_dir_struct::entry_offset, FAT16_ATTRIB_DIR, FAT16_DIR_COUNT, fat16_dir_handles, and fat16_dir_struct::fs.

Referenced by fat16_get_dir_entry_of_path(), and main().

uint8_t fat16_read_dir ( struct fat16_dir_struct dd,
struct fat16_dir_entry_struct dir_entry 
)

uint8_t fat16_reset_dir ( struct fat16_dir_struct dd  ) 

Resets a directory handle.

Resets the directory handle such that reading restarts with the first directory entry.

Parameters:
[in] dd The directory handle to reset.
Returns:
0 on failure, 1 on success.
See also:
fat16_read_dir

Definition at line 1329 of file fat16.c.

References fat16_dir_entry_struct::cluster, fat16_dir_struct::dir_entry, fat16_dir_struct::entry_cluster, and fat16_dir_struct::entry_offset.

Referenced by fat16_create_dir(), fat16_create_file(), and find_file_in_dir().


Generated on Wed Sep 17 19:31:52 2008 for mptry by  doxygen 1.5.5