RTEMS: cpukit/include/rtems/dosfs.h File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
dosfs.h File Reference
IO Library » File System Types and Mount » FAT Filesystem Support

Application Interface to FAT Filesystem. More...

`#include <rtems.h>`
`#include <rtems/libio.h>`

Go to the source code of this file.

## Data Structures
struct | rtems_dosfs_convert_handler
| FAT filesystem convert handler. More...
struct | rtems_dosfs_buffer
struct | rtems_dosfs_convert_control
| FAT filesystem convert control. More...
struct | rtems_dosfs_mount_options
| FAT filesystem mount options. More...
struct | msdos_format_request_param_t
| FAT file system format request parameters. More...

## Macros
#define | RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE 1
| Semaphore count per FAT filesystem instance.
#define | MSDOS_FMT_INFO_LEVEL_NONE (0)
#define | MSDOS_FMT_INFO_LEVEL_INFO (1)
#define | MSDOS_FMT_INFO_LEVEL_DETAIL (2)
#define | MSDOS_FMT_INFO_LEVEL_DEBUG (3)

## Typedefs
typedef struct rtems_dosfs_convert_control | rtems_dosfs_convert_control
typedef int(* | rtems_dosfs_utf8_to_codepage) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, char *dst, size_t *dst_size)
| Converts from UTF-8 into a specific code page.
typedef int(* | rtems_dosfs_codepage_to_utf8) (rtems_dosfs_convert_control *self, const char *src, size_t src_size, uint8_t *dst, size_t *dst_size)
| Converts from a specific code page into UTF-8.
typedef int(* | rtems_dosfs_utf8_to_utf16) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, uint16_t *dst, size_t *dst_size)
| Converts from UTF-8 to UTF-16.
typedef int(* | rtems_dosfs_utf16_to_utf8) (rtems_dosfs_convert_control *self, const uint16_t *src, size_t src_size, uint8_t *dst, size_t *dst_size)
| Converts from UTF-16 to UTF-8.
typedef int(* | rtems_dosfs_utf8_normalize_and_fold) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, uint8_t *dst, size_t *dst_size)
| Converts from UTF-8 to Normalized Form Canonical Decomposition.
typedef void(* | rtems_dosfs_convert_destroy) (rtems_dosfs_convert_control *self)
| Destroys a convert control structure.

## Functions
rtems_dosfs_convert_control * | rtems_dosfs_create_default_converter (void)
| Allocates and initializes a default converter.
rtems_dosfs_convert_control * | rtems_dosfs_create_utf8_converter (const char *codepage)
| Allocates and initializes a UTF-8 converter.
int | msdos_format (const char *devname, const msdos_format_request_param_t *rqdata)
| Formats a block device with a FAT file system.
int | rtems_dosfs_initialize (rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)

## Detailed Description

Application Interface to FAT Filesystem.

## Typedef Documentation

## ◆ rtems_dosfs_codepage_to_utf8

typedef int(* rtems_dosfs_codepage_to_utf8) (rtems_dosfs_convert_control *self, const char *src, size_t src_size, uint8_t *dst, size_t *dst_size)

Converts from a specific code page into UTF-8.

Parameters

  [in,out] | self | The convert control.
  [in] | src | A well-formed string in code page format.
  [in] | src_size | The size of the string in bytes (inludes '\0' if any).
  [out] | dst | The address the converted string will get copied to.
  [in,out] | dst_size | The size of the buffer in bytes respectively the number of bytes written to the buffer.

Return values

  0 | Successful operation.
  EINVAL | Conversion was successful, but is not reversible.
  ENOMEM | Conversion failed (possibly due to insufficient buffer size).

## ◆ rtems_dosfs_convert_destroy

typedef void(* rtems_dosfs_convert_destroy) (rtems_dosfs_convert_control *self)

Destroys a convert control structure.

Parameters

  [in,out] | self | The convert control for destruction.

## ◆ rtems_dosfs_utf16_to_utf8

typedef int(* rtems_dosfs_utf16_to_utf8) (rtems_dosfs_convert_control *self, const uint16_t *src, size_t src_size, uint8_t *dst, size_t *dst_size)

Converts from UTF-16 to UTF-8.

Parameters

  [in,out] | self | The convert control.
  [in] | src | A well-formed UTF-16 string to be converted.
  [in] | src_size | The size of the string in bytes (inludes '\0' if any).
  [out] | dst | The address the converted string will get copied to.
  [in,out] | dst_size | The size of the buffer in bytes respectively the number of bytes written to the buffer

Return values

  0 | Successful operation.
  EINVAL | Conversion was successful, but is not reversible.
  ENOMEM | Conversion failed (possibly due to insufficient buffer size).

## ◆ rtems_dosfs_utf8_normalize_and_fold

typedef int(* rtems_dosfs_utf8_normalize_and_fold) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, uint8_t *dst, size_t *dst_size)

Converts from UTF-8 to Normalized Form Canonical Decomposition.

Does canonical decomposition of the UTF-8 string and in addition also converts upper case alphabetic characters to lower case characters

Parameters

  [in,out] | self | The convert control.
  [in] | src | A well-formed UTF-8 string to be normalized and fold.
  [in] | src_size | The size of the string in bytes (inludes '\0' if any).
  [out] | dst | The address the normalized and fold string will get copied to.
  [in,out] | dst_size | The size of the buffer in bytes respectively the number of bytes written to the buffer.

Return values

  0 | Successful operation.
  EINVAL | Conversion failed.
  ENOMEM | Conversion failed (possibly due to insufficient buffer size).
  EOVERFLOW | Conversion failed.
  ENOENT | Conversion failed.

## ◆ rtems_dosfs_utf8_to_codepage

typedef int(* rtems_dosfs_utf8_to_codepage) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, char *dst, size_t *dst_size)

Converts from UTF-8 into a specific code page.

Parameters

  [in,out] | self | The convert control.
  [in] | src | A well-formed UTF-8 string to be converted.
  [in] | src_size | The size of the string in bytes (inludes '\0' if any).
  [out] | dst | The address the converted string will get copied to.
  [in,out] | dst_size | The size of the buffer in bytes respectively the number of bytes written to the buffer.

Return values

  0 | Successful operation.
  EINVAL | Conversion was successful, but is not reversible.
  ENOMEM | Conversion failed (possibly due to insufficient buffer size).

## ◆ rtems_dosfs_utf8_to_utf16

typedef int(* rtems_dosfs_utf8_to_utf16) (rtems_dosfs_convert_control *self, const uint8_t *src, size_t src_size, uint16_t *dst, size_t *dst_size)

Converts from UTF-8 to UTF-16.

Parameters

  [in,out] | self | The convert control.
  [in] | src | A well-formed UTF-8 string to be converted.
  [in] | src_size | The size of the string in bytes (inludes '\0' if any).
  [out] | dst | The address the converted string will get copied to
  [in,out] | dst_size | The size of the buffer in bytes respectively the number of bytes written to the buffer.

Return values

  0 | Successful operation.
  EINVAL | Conversion was successful, but is not reversible.
  ENOMEM | Conversion failed (possibly due to insufficient buffer size).