Japanese
PROGRAMMER'S GUIDEFile system library
BackForward
file system library

7.Data specifications


7.1 Basic data


 one
View
table
 Title

data specifications

 Data

basic data

 Data Name

 No

1.0

(1) Basic data type
Below 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)Boolean constant
Used as a logical type (Bool) value.

 constant name
 value
 explanation
 FALSE
 0
 boolean false
 TRUE
 1
 logical truth

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

7.2 Constants


 one
View
table
 Title

data specifications

 Data

file attributes

 Data Name

GFS_ATR_~

 No

2.1

The constants listed below represent the presence or absence of each attribute. These constants can be used for attributes in the directory information read with GFS_Init, GFS_LoadDir, and output with GFS_GetFileInfo.
The contents of bits not shown here are undefined.

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 sectors
    |   |   |   +-------------------- GFS_ATR_FORM2    1:Includes Form2 sectors
    |   |   +------------------------ GFS_ATR_INTLV    1:Includes interleaved sectors
    |   +---------------------------- GFS_ATR_CDDA     1:CDDA file
    +-------------------------------- GFS_ATR_DIR      1:Directory file


 one
View
table
 Title

data specifications

 Data

access status

 Data Name

GFS_NWSTAT_~

 No

2.2

The constants listed below represent the access state of the server. Output by GFS_NwGetStat.

 constant name
 explanation
 GFS_NWSTAT_NOACT
 haven't done anything
 GFS_NWSTAT_FREAD
 GFS_NwFread running
 GFS_NWSTAT_CDREAD
 GFS_NwCdRead in progress 


 one
View
table
 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 CD buffer full
 GFS_SVR_ERROR
 An error occurred while accessing 


 one
View
table
 Title

data specifications

 Data

seek mode

 Data Name

GFS_SEEK_〜

 No

2.4

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

 constant name
 explanation
 GFS_SEEK_SET
 beginning of file
 GFS_SEEK_CUR
 Current position
 GFS_SEEK_END
 end of file 


 one
View
table
 Title

data specifications

 Data

Eject mode

 Data Name

GFS_GMODE_〜

 No

2.5

The following constants represent the method for extracting from the CD buffer. Used as argument to GFS_SetGmode.

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


 one
View
table
 Title

data specifications

 Data

Transfer mode

 Data Name

GFS_TMODE_~

 No

2.6

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

 constant name
 explanation
 GFS_TMODE_SCU
 DMA transfer (level 0) by SCU
*If the transfer destination is WORKRAM-L,
This 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 


 one
View
table
 Title

data specifications

 Data

Error code

 Data Name

GFS_ERR_~

 No

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 disk other than CD-ROM is set.
 GFS_ERR_DIRTBL
 The contents of the directory management table are invalid.
 GFS_ERR_OPENMAX
 Invalid maximum open count value
 GFS_ERR_DIR
 The specified file is not a directory
 GFS_ERR_CDBFS
 CD block file system error
 GFS_ERR_NONAME
 Cannot handle file name in current directory
 GFS_ERR_NEXIST
 non-existent file name
 GFS_ERR_FID
 Bad file identifier
 GFS_ERR_HNDL
 invalid file handle
 GFS_ERR_SEEK
 Invalid seek position
 GFS_ERR_ORG
 Invalid reference position
 GFS_ERR_NUM
 negative number of bytes
 GFS_ERR_OFS
 Offset fraud
 GFS_ERR_FBUSY
 Processing remains for the specified file handle
 GFS_ERR_PARA
 Invalid parameter
 GFS_ERR_BUSY
 Library function in progress
 GFS_ERR_NOHNDL
 There is no free space on the file handle
 GFS_ERR_PUINUSE
 Pickup in operation
 GFS_ERR_ALIGN
 Data read amount area is not on 4-byte boundary
 GFS_ERR_TMOUT
 A timeout occurred in internal processing.
 GFS_ERR_CDOPEN
 tray is open
 GFS_ERR_BFUL
 Loading stopped due to buffer full
 GFS_ERR_FATAL
 CD drive〈 FATAL〉 situation 


 one
View
table
 Title

data specifications

 Data

others

 Data Name

 No

2.8

Other constants used in this library are listed below.

 constant name
 explanation
 GFS_RPARA_DFL
 Initial values of read parameters
 GFS_BUFSIZ_INF
 Specify to read regardless of the size of the read area with GFS_Load

7.3 Data types


 one
View
table
 Title

data specifications

 Data

file handle

 Data Name

GfsHn

 No

3.1

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


 one
View
table
 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 using the following constant.

 constant name
 explanation
 GFS_DIR_ID
 Does not have file name information
 GFS_DIR_NAME
 Contains 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 directory information table
 GFS_DIRTBL_DIRID(dirtbl)
 GfsDirId*
 Filenameless directory information table
pointer to
 GFS_DIR_NAME(dirtbl)
 GfsDirName*
 Directory information table with file name
pointer to

(3) Setting method

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

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

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

GFS_DIRTBL_TYPE(&dirtbl) = GFS_DIR_NAME; /* Directory information specification 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 */


 one
View
table
 Title

data specifications

 Data

Filenameless directory information

 Data Name

GfsDirId

 No

3.3

A directory information structure that does not contain file names.
Specify GFS_DIR_ID for the directory information table type (GFS_DIRTBL_TYPE).

GfsDirId *dir
 access macro
 mold
 explanation
 GFS_DIR_FAD(dir)
 Sint32
 Start of file FAD
 GFS_DIR_SIZE(dir)
 Sint32
 File size (unit: bytes)
 GFS_DIR_FN(dir)
 Uint8
 file number
 GFS_DIR_ATR(dir)
 Uint8
 file attributes
 GFS_DIR_UNIT(dir)
 Uint8
 File unit size (unit: sector)
 GFS_DIR_GAP(dir)
 Uint8
 File gap size (in sectors) 


 one
View
table
 Title

data specifications

 Data

Directory information with file name

 Data Name

GfsDirName

 No

3.4

A directory information structure containing file names.
Specify GFS_DIR_NAME for the directory information table type (GFS_DIRTBL_TYPE).

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


 one
View
table
 Title

data specifications

 Data

error handling function

 Data Name

GfsErrFunc

 No

3.5

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

 one
View
table
 Title

data specifications

 Data

error condition

 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
 Pointer to 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