# modules/dosfs/dosfs.h File Reference

`#include <stdint.h>`

## Data Structures
struct | _tagDIRENT
struct | _tagPTINFO
struct | _tagMBR
struct | _tagBPB
struct | _tagEBPB
struct | _tagEBPB32
struct | _tagLBR
struct | _tagVOLINFO
struct | _tagDIRINFO
struct | _tagFILEINFO
## Defines
#define | MAX_PATH 64
#define | DIR_SEPARATOR '/'
#define | DFS_OK 0
#define | DFS_EOF 1
#define | DFS_WRITEPROT 2
#define | DFS_NOTFOUND 3
#define | DFS_PATHLEN 4
#define | DFS_ALLOCNEW 5
#define | DFS_ERRMISC 0xffffffff
#define | DFS_READ 1
#define | DFS_WRITE 2
#define | SECTOR_SIZE 512
#define | FAT12 0
#define | FAT16 1
#define | FAT32 2
#define | ATTR_READ_ONLY 0x01
#define | ATTR_HIDDEN 0x02
#define | ATTR_SYSTEM 0x04
#define | ATTR_VOLUME_ID 0x08
#define | ATTR_DIRECTORY 0x10
#define | ATTR_ARCHIVE 0x20
#define | ATTR_LONG_NAME (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID)
#define | DFS_DI_BLANKENT 0x01
## Typedefs
typedef struct _tagDIRENT | DIRENT
typedef struct _tagDIRENT * | PDIRENT
typedef struct _tagPTINFO | PTINFO
typedef struct _tagPTINFO * | PPTINFO
typedef struct _tagMBR | MBR
typedef struct _tagMBR * | PMBR
typedef struct _tagBPB | BPB
typedef struct _tagBPB * | PBPB
typedef struct _tagEBPB | EBPB
typedef struct _tagEBPB * | PEBPB
typedef struct _tagEBPB32 | EBPB32
typedef struct _tagEBPB32 * | PEBPB32
typedef struct _tagLBR | LBR
typedef struct _tagLBR * | PLBR
typedef struct _tagVOLINFO | VOLINFO
typedef struct _tagVOLINFO * | PVOLINFO
typedef struct _tagDIRINFO | DIRINFO
typedef struct _tagDIRINFO * | PDIRINFO
typedef struct _tagFILEINFO | FILEINFO
typedef struct _tagFILEINFO * | PFILEINFO
## Functions
uint32_t | DFS_ReadSector (uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count)
uint32_t | DFS_WriteSector (uint8_t unit, uint8_t *buffer, uint32_t sector, uint32_t count)
uint32_t | DFS_GetPtnStart (uint8_t unit, uint8_t *scratchsector, uint8_t pnum, uint8_t *pactive, uint8_t *pptype, uint32_t *psize)
uint32_t | DFS_GetVolInfo (uint8_t unit, uint8_t *scratchsector, uint32_t startsector, PVOLINFO volinfo)
uint32_t | DFS_OpenDir (PVOLINFO volinfo, uint8_t *dirname, PDIRINFO dirinfo)
uint32_t | DFS_GetNext (PVOLINFO volinfo, PDIRINFO dirinfo, PDIRENT dirent)
uint32_t | DFS_OpenFile (PVOLINFO volinfo, uint8_t *path, uint8_t mode, uint8_t *scratch, PFILEINFO fileinfo)
uint32_t | DFS_ReadFile (PFILEINFO fileinfo, uint8_t *scratch, uint8_t *buffer, uint32_t *successcount, uint32_t len)
uint32_t | DFS_WriteFile (PFILEINFO fileinfo, uint8_t *scratch, uint8_t *buffer, uint32_t *successcount, uint32_t len)
void | DFS_Seek (PFILEINFO fileinfo, uint32_t offset, uint8_t *scratch)
uint32_t | DFS_UnlinkFile (PVOLINFO volinfo, uint8_t *path, uint8_t *scratch)
uint32_t | DFS_Close (PFILEINFO fileinfo)
void | DFS_CachingEnabledSet (uint8_t enable)
char * | DFS_DirToCanonical (char *dest, char *src)

## Define Documentation

#define ATTR_ARCHIVE 0x20

#define ATTR_DIRECTORY 0x10

#define ATTR_HIDDEN 0x02

#define ATTR_LONG_NAME (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID)

#define ATTR_READ_ONLY 0x01

#define ATTR_SYSTEM 0x04

#define ATTR_VOLUME_ID 0x08

#define DFS_ALLOCNEW 5

#define DFS_DI_BLANKENT 0x01

#define DFS_EOF 1

#define DFS_ERRMISC 0xffffffff

#define DFS_NOTFOUND 3

#define DFS_OK 0

#define DFS_PATHLEN 4

#define DFS_READ 1

#define DFS_WRITE 2

#define DFS_WRITEPROT 2

#define DIR_SEPARATOR '/'

#define FAT12 0

#define FAT16 1

#define FAT32 2

#define MAX_PATH 64

#define SECTOR_SIZE 512

## Typedef Documentation

typedef struct _tagBPB BPB

typedef struct _tagDIRENT DIRENT

typedef struct _tagDIRINFO DIRINFO

typedef struct _tagEBPB EBPB

typedef struct _tagEBPB32 EBPB32

typedef struct _tagFILEINFO FILEINFO

typedef struct _tagLBR LBR

typedef struct _tagMBR MBR

typedef struct _tagBPB * PBPB

typedef struct _tagDIRENT * PDIRENT

typedef struct _tagDIRINFO * PDIRINFO

typedef struct _tagEBPB * PEBPB

typedef struct _tagEBPB32 * PEBPB32

typedef struct _tagFILEINFO * PFILEINFO

typedef struct _tagLBR * PLBR

typedef struct _tagMBR * PMBR

typedef struct _tagPTINFO * PPTINFO

typedef struct _tagPTINFO PTINFO

typedef struct _tagVOLINFO * PVOLINFO

typedef struct _tagVOLINFO VOLINFO

## Function Documentation

void DFS_CachingEnabledSet | ( | uint8_t | enable | ) |

uint32_t DFS_Close | ( | PFILEINFO | fileinfo | ) |

char* DFS_DirToCanonical | ( | char * | dest,
|  | char * | src |
| ) |  |  |

uint32_t DFS_GetNext | ( | PVOLINFO | volinfo,
|  | PDIRINFO | dirinfo,
|  | PDIRENT | dirent |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_GetPtnStart | ( | uint8_t | unit,
|  | uint8_t * | scratchsector,
|  | uint8_t | pnum,
|  | uint8_t * | pactive,
|  | uint8_t * | pptype,
|  | uint32_t * | psize |
| ) |  |  |

uint32_t DFS_GetVolInfo | ( | uint8_t | unit,
|  | uint8_t * | scratchsector,
|  | uint32_t | startsector,
|  | PVOLINFO | volinfo |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_OpenDir | ( | PVOLINFO | volinfo,
|  | uint8_t * | dirname,
|  | PDIRINFO | dirinfo |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_OpenFile | ( | PVOLINFO | volinfo,
|  | uint8_t * | path,
|  | uint8_t | mode,
|  | uint8_t * | scratch,
|  | PFILEINFO | fileinfo |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_ReadFile | ( | PFILEINFO | fileinfo,
|  | uint8_t * | scratch,
|  | uint8_t * | buffer,
|  | uint32_t * | successcount,
|  | uint32_t | len |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_ReadSector | ( | uint8_t | unit,
|  | uint8_t * | buffer,
|  | uint32_t | sector,
|  | uint32_t | count |
| ) |  |  |

Here is the call graph for this function:

void DFS_Seek | ( | PFILEINFO | fileinfo,
|  | uint32_t | offset,
|  | uint8_t * | scratch |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_UnlinkFile | ( | PVOLINFO | volinfo,
|  | uint8_t * | path,
|  | uint8_t * | scratch |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_WriteFile | ( | PFILEINFO | fileinfo,
|  | uint8_t * | scratch,
|  | uint8_t * | buffer,
|  | uint32_t * | successcount,
|  | uint32_t | len |
| ) |  |  |

Here is the call graph for this function:

uint32_t DFS_WriteSector | ( | uint8_t | unit,
|  | uint8_t * | buffer,
|  | uint32_t | sector,
|  | uint32_t | count |
| ) |  |  |

Here is the call graph for this function: