##### Shinobi Library - File System Function

# gdFsInit

Initializes the GD file system

### FORMAT

`

  Sint32 gdFsInit( max_open, *gdfs_work, max_dirent, *dirbuf )
  Sint32 max_open
  void *gdfs_work
  Sint32 max_dirent
  void *dirbuf

`

### PARAMETER

  `max_open` | Number of files that can be opened simultaneously
  `*gdfs_work` | Work area pointer (provided from user area)
  `max_dirent` | Number of entries in current directory
  `*dirbuf` | Current directory buffer (provided from user area)

### RETURN

  GDD_ERR_OK | Initialization completed |
  GDD_ERR_32ALIGN | "gdfs_work" does not coincide with a 32-byte boundary |
  GDD_ERR_RESET | Drive reset failed |
  GDD_ERR_TRAYOPEND | GD tray is open |
  GDD_ERR_DISC | Disc is unusable |
  GDD_ERR_MOUNT | Mount failed |
  GDD_ERR_DIROVER | Too many entries in the root directory |

### DESCRIPTION

  Initializes the GD file system.

### EXAMPLE

      Uint32 gdfswork[gdFsGetWorkSize(8)/4];
      Uint32 gdfscurdir[gdFsGetDirrecSize(64)/4];
      gdFsInit(8, gdfswork, 64, gdfscurdir);

### NOTE

  "gdfs_work" must be aligned with a 32-byte boundary. (dirbuf with a 4-byte boundary). Once initialization has been completed, re-initialization is not possible even if the `gdFsInit()` function is called unless the `gdFsFinish()` function has been called. The main processing that is performed by `gdFsInit()` is as follows:

  Device driver initialization
  Work area initialization
  Device initialization
  Mount processing

### REFERENCE

  `gdFsFinish()
  `

gdFsInit

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999