PROGRAMMER'S GUIDEFile system library
BackForward
File system library

7. Data specifications


7.1 Basic data


 List
 Title

Data specifications

 Data

Basic data

 Data Name

 No

1.0

(1) Basic data type
The following is a list of basic data structures.

 Model name
 explanation
 Uint8
 Unsigned 1-byte integer
 Sint8
 Signed 1-byte integer
 Uint16
 Unsigned 2-byte integer
 Sint16
 Signed 2-byte integer
 Uint32
 Unsigned 4-byte integer
 Sint32
 Signed 4-byte integer
 Bool
 Logical 4-byte integer

(2) Logical type constant
Used as a Boolean value.

 Constant name
 value
 explanation
 FALSE
 0
 False logical value
 TRUE
 1
 True value of logical value

(3) Null pointer
 Constant name
 value
 explanation
 NULL
 (void *) 0
 Null pointer

7.2 Constant


 List
 Title

Data specifications

 Data

File attributes

 Data Name

GFS_ATR_ ~

 No

2.1

The constants shown below indicate the presence or absence of each attribute. These constants can be used for GFS_Init, attributes in directory information loaded by GFS_LoadDir, and attributes output by GFS_GetFileInfo.
The contents of the bits not shown here are indefinite.

bit 7 6 5 4 3 2 1 0
   [] [] [] [] [] [-] [-] [] 
    | | | | | |
    | | | | | |
    | | | | | + ---- GFS_ATR_END_TBL 1: End of directory information table 
    | | | | |
    | | | | + ---------------- GFS_ATR_FORM1 1: Includes Form1 sector | | | + ------------------ --GFS_ATR_FORM2 1: Includes Form2 sector | | + ------------------------ GFS_ATR_INTLV 1: Includes interleaved sector | + ---- ------------------------ GFS_ATR_CDDA 1: CDDA file + -------------------- ------------ GFS_ATR_DIR 1: Directory file 


 List
 Title

Data specifications

 Data

Access status

 Data Name

GFS_NWSTAT_ ~

 No

2.2

The constants shown below represent the access status of the server. It is output by GFS_NwGetStat.

 Constant name
 explanation
 GFS_NWSTAT_NOACT
 Do nothing
 GFS_NWSTAT_FREAD
 GFS_NwFread running
 GFS_NWSTAT_CDREAD
 GFS_NwCdRead running 


 List
 Title

Data specifications

 Data

Access server status

 Data Name

GFS_SVR_ ~

 No

2.3

The constants shown below are the function values of GFS_NwExecOne and GFS_NwExecServer. Represents its execution status.

 Constant name
 explanation
 GFS_SVR_COMPLETED
 Processing Exit
 GFS_SVR_BUSY
 processing
 GFS_SVR_CDPAUSE
 Pause due to full CD buffer
 GFS_SVR_ERROR
 An error occurred during access 


 List
 Title

Data specifications

 Data

Seek mode

 Data Name

GFS_SEEK_ ~

 No

2.4

The constants shown below represent the criteria for moving the access pointer. Used as an argument to GFS_Seek.

 Constant name
 explanation
 GFS_SEEK_SET
 Top of file
 GFS_SEEK_CUR
 Current position
 GFS_SEEK_END
 End of file 


 List
 Title

Data specifications

 Data

Eject mode

 Data Name

GFS_GMODE_ ~

 No

2.5

The following constants represent the retrieval method from the CD buffer. Used as an argument to GFS_SetGmode.

 Constant name
 explanation
 GFS_GMODE_ERASE
 Delete from buffer after transfer
 GFS_GMODE_RESIDENT
 Leave in CD buffer after transfer 


 List
 Title

Data specifications

 Data

Transfer mode

 Data Name

GFS_TMODE_ ~

 No

2.6

The following constants represent the devices that perform the transfer from the CD buffer. Used as an argument to GFS_SetTmode.

 Constant name
 explanation
 GFS_TMODE_SCU
 DMA transfer by SCU (level 0)
* When the transfer destination is WORKRAM-L
It will be a software transfer.
 GFS_TMODE_SDMA0
 DMA cycle steal transfer channel 0
 GFS_TMODE_SDMA1
 DMA cycle steal transfer channel 1
 GFS_TMODE_CPU
 Software transfer 


 List
 Title

Data specifications

 Data

Error code

 Data Name

GFS_ERR_ ~

 No

2.7 2.7

The value of GFS_ERR_OK is 0. Other error codes have negative values.

 Constant name
 explanation
 GFS_ERR_OK
 normal termination
 GFS_ERR_CDRD
 CD read error
 GFS_ERR_CDNODISC
 CD is not set
 GFS_ERR_CDROM
 A disc that is not a CD-ROM is set
 GFS_ERR_DIRTBL
 The contents of the directory management table are invalid
 GFS_ERR_OPENMAX
 The value of the maximum number of open is invalid
 GFS_ERR_DIR
 The specified file is not a directory
 GFS_ERR_CDBFS
 CD block file system error
 GFS_ERR_NONAME
 Filenames cannot be handled in the current directory
 GFS_ERR_NEXIST
 File name that does not exist
 GFS_ERR_FID
 Illegal file identifier
 GFS_ERR_HNDL
 File handle is invalid
 GFS_ERR_SEEK
 Incorrect seek position
 GFS_ERR_ORG
 The reference position is incorrect
 GFS_ERR_NUM
 Negative number of bytes
 GFS_ERR_OFS
 Offset incorrect
 GFS_ERR_FBUSY
 Processing for the specified file handle remains
 GFS_ERR_PARA
 Invalid parameter
 GFS_ERR_BUSY
 Library function running
 GFS_ERR_NOHNDL
 File handle is full
 GFS_ERR_PUINUSE
 Pickup is in operation
 GFS_ERR_ALIGN
 Data read area is not on 4-byte boundary
 GFS_ERR_TMOUT
 A timeout occurred in internal processing
 GFS_ERR_CDOPEN
 The tray is open
 GFS_ERR_BFUL
 Stop reading due to buffer full
 GFS_ERR_FATAL
 CD drive is in <FATAL> state 


 List
 Title

Data specifications

 Data

others

 Data Name

 No

2.8

Other constants used in this library are shown below.

 Constant name
 explanation
 GFS_RPARA_DFL
 Initial value of read parameter
 GFS_BUFSIZ_INF
 Specify to load regardless of the size of the loading area with GFS_Load

7.3 Data type


 List
 Title

Data specifications

 Data

File handle

 Data Name

GfsHn

 No

3.1 3.1

Holds per-file information about file access. Generated by GFS_Open. Most functions that access files refer to this data.


 List
 Title

Data specifications

 Data

Directory information management

 Data Name

GfsDirTbl

 No

3.2

(1) Directory information table type
The directory information management structure can manage directory information without a file name or directory information with a file name. Specify which one to manage with the following constants.

 Constant name
 explanation
 GFS_DIR_ID
 Does not have file name information
 GFS_DIR_NAME
 Have file name information

(2) Directory information management
A data type for managing directory information. Holds the type of directory information table, its size, and its substance.

GfsDirTbl * dirtbl
 Access macro
 Mold
 explanation
 GFS_DIRTBL_TYPE (dirtbl)
 Sint32
 Directory information table type
 GFS_DIRTBL_NDIR (dirtbl)
 Sint32
 Maximum number of elements in the directory information table
 GFS_DIRTBL_DIRID (dirtbl)
 GfsDirId *
 No file name Pointer to directory information table
 GFS_DIR_NAME (dirtbl)
 GfsDirName *
 Pointer to directory information table with file name

(3) Setting method

(a) When using directory information without a file name
GfsDirTbl dirtbl;
GfsDirId dir_id [MAX_DIR_ID]

GFS_DIRTBL_TYPE (& dirtbl) = GFS_DIR_ID; / * Specify directory information without file name * / GFS_DIRTBL_NDIR (& dirtbl) = MAX_DIR_ID; / * Maximum number of elements * / GFS_DIRTBL_DIRID (& dirtbl) = dir_id; / * Filenameless directory information table * /

(b) When using directory information with a file name
GfsDirTbl dirtbl;
GfsDirName dir_name [MAX_DIR_NAME];

GFS_DIRTBL_TYPE (& dirtbl) = GFS_DIR_NAME; / * Specify directory information with file name * / GFS_DIRTBL_NDIR (& dirtbl) = MAX_DIR_NAME; / * Maximum number of elements * / GFS_DIRTBL_DIRNAME (& dirtbl) = dir_name; / * Directory information table with file name * /


 List
 Title

Data specifications

 Data

Filenameless directory information

 Data Name

GfsDirId

 No

3.3

A directory information structure that does not include a file name.
For the directory information table type (GFS_DIRTBL_TYPE), specify GFS_DIR_ID.

GfsDirId * dir
 Access macro
 Mold
 explanation
 GFS_DIR_FAD (dir)
 Sint32
 FAD at the beginning of the file
 GFS_DIR_SIZE (dir)
 Sint32
 File size (unit is bytes)
 GFS_DIR_FN (dir)
 Uint8
 File number
 GFS_DIR_ATR (dir)
 Uint8
 File attributes
 GFS_DIR_UNIT (dir)
 Uint8
 File unit size (unit is sector)
 GFS_DIR_GAP (dir)
 Uint8
 File gap size (unit is sector) 


 List
 Title

Data specifications

 Data

Directory information with file name

 Data Name

GfsDirName

 No

3.4 3.4

A directory information structure that contains the file name.
Specify GFS_DIR_NAME for the directory information table type (GFS_DIRTBL_TYPE).

GfsDirName * dir
 Access macro
 Mold
 explanation
 GFS_DIR_FAD (dir)
 Sint32
 FAD at the beginning of the file
 GFS_DIR_SIZE (dir)
 Sint32
 File size (unit is bytes)
 GFS_DIR_FN (dir)
 Uint8
 File number
 GFS_DIR_ATR (dir)
 Uint8
 File attributes
 GFS_DIR_UNIT (dir)
 Uint8
 File unit size (unit is sector)
 GFS_DIR_GAP (dir)
 Uint8
 File gap size (unit is sector)
 GFS_DIR_FNAME (dir)
 Sint8 []
 File name * 1
* 1: The size of the area is 12 bytes. When the file name is 12 bytes long, the string does not end with'\ 0'.


 List
 Title

Data specifications

 Data

Error handling function

 Data Name

GfsErrFunc

 No

3.5

Form
void (* GFsErrFunc) (void * obj, Sint32 ec)
input
 obj
 : Objects required for error handling
 ec
 :Error code
output
none

 List
 Title

Data specifications

 Data

Error status

 Data Name

GfsErrStat

 No

3.6

This is the data output by GFS_GetErrStat.

GfsErrStat * stat
 Access macro
 Mold
 explanation
 GFS_ERR_FUNC (err)
 GfsErrFunc
 A pointer to an error handling function.
 GFS_ERR_OBJ (err)
 void *
 The first argument of the error handling function.
 GFS_ERR_CODE (err)
 Sint32
 Error code.


BackForward
PROGRAMMER'S GUIDEFile system library
Copyright SEGA ENTERPRISES, LTD., 1997