CRI ADX  Last Updated: 2024-07-17 10:47 p
cri_le_file_system.h File Reference
#include "cri_le_xpt.h"
#include "cri_le_error.h"

Data Structures

struct  CriFsConfigTag
 Configuration. More...
 
struct  CriFsIoInterfaceTag
 I/O Interface. More...
 

Macros

#define CRIFS_CONFIG_DEFAULT_THREAD_MODEL   CRIFS_THREAD_MODEL_MULTI
 Configuration defaults.
 
#define CRIFS_DEVICE_DEFAULT   (CRIFS_DEVICE_00)
 Default device ID.
 
#define CRIFS_DEFAULT_DEVICE   (CRIFS_DEVICE_DEFAULT)
 Memory file system device ID. More...
 
#define criFs_SetUserAllocator(p_malloc_func, p_free_func, p_obj)
 Maximum length of the memory file path. More...
 

Typedefs

typedef enum CriFsThreadModelTag CriFsThreadModel
 Thread model. More...
 
typedef struct CriFsConfigTag CriFsConfig
 Configuration. More...
 
typedef enum CriFsDeviceIdTag CriFsDeviceId
 Device ID.
 
typedef void * CriFsFileHn
 File Handle.
 
typedef struct CriFsIoInterfaceTag CriFsIoInterface
 I/O Interface.
 

Enumerations

enum  CriFsThreadModelTag { CRIFS_THREAD_MODEL_MULTI = 0 , CRIFS_THREAD_MODEL_MULTI_USER_DRIVEN = 3 , CRIFS_THREAD_MODEL_USER_MULTI = 1 , CRIFS_THREAD_MODEL_SINGLE = 2 , CRIFS_THREAD_MODEL_ENUM_BE_SINT32 = 0x7FFFFFFF }
 Thread model. More...
 
enum  CriFsDeviceIdTag
 Device ID.
 
enum  CriFsFileMode {
  CRIFS_FILE_MODE_APPEND = 0 , CRIFS_FILE_MODE_CREATE = 1 , CRIFS_FILE_MODE_CREATE_NEW = 2 , CRIFS_FILE_MODE_OPEN = 3 ,
  CRIFS_FILE_MODE_OPEN_OR_CREATE = 4 , CRIFS_FILE_MODE_TRUNCATE = 5 , CRIFS_FILE_MODE_ENUM_BE_SINT32 = 0x7FFFFFFF
}
 File Opening Mode. More...
 
enum  CriFsFileAccess { CRIFS_FILE_ACCESS_READ = 0 , CRIFS_FILE_ACCESS_WRITE = 1 , CRIFS_FILE_ACCESS_READ_WRITE = 2 , CRIFS_FILE_ACCESS_ENUM_BE_SINT32 = 0x7FFFFFFF }
 Kind of File Access. More...
 
enum  CriFsLoaderPriority {
  CRIFSLOADER_PRIORITY_HIGHEST = 2 , CRIFSLOADER_PRIORITY_ABOVE_NORMAL = 1 , CRIFSLOADER_PRIORITY_NORMAL = 0 , CRIFSLOADER_PRIORITY_BELOW_NORMAL = -1 ,
  CRIFSLOADER_PRIORITY_LOWEST = -2 , CRIFSLOADER_PRIORITY_ENUM_BE_SINT32 = 0x7FFFFFFF
}
 Loading Status. More...
 

Macro Definition Documentation

◆ CRIFS_DEFAULT_DEVICE

#define CRIFS_DEFAULT_DEVICE   (CRIFS_DEVICE_DEFAULT)

Memory file system device ID.

Old definition of default device ID

Note:
This definition is deprecated. Use CRIFS_DEVICE_DEFAULT instead.
See also
CRIFS_DEVICE_DEFAULT

◆ criFs_SetUserAllocator

#define criFs_SetUserAllocator (   p_malloc_func,
  p_free_func,
  p_obj 
)
Value:
{\
criFs_SetUserMallocFunction(p_malloc_func, p_obj);\
criFs_SetUserFreeFunction(p_free_func, p_obj);\
}

Maximum length of the memory file path.

Description:
Maximum length of the memory file path. This includes the number of NULL characters.
The length of the memory file path does not exceed this value. br>
Attention
This value may be larger in the future. br>
See also
criFs_AddressToPath

Invalid bind ID

Description:
This is the ID to be given to an unused binder. The value may be returned when binding fails.
See also
CriFsBindId, criFsBinder_BindCpk, criFsBinder_BindFile, criFsBinder_BindFiles, criFsBinder_BindDirectory

Start number of valid bind ID

Description:
This is the start number of a valid bind ID.
IDs returned in the bind functions are valid if they are larger than this ID. br>
See also
CriFsBindId, criFsBinder_BindCpk, criFsBinder_BindFile, criFsBinder_BindFiles, criFsBinder_BindDirectory

Register user's allocator

Parameters
[in]p_malloc_funcMemory allocation function
[in]p_free_funcMemory release function
[in]p_objUser-specified object
Description:
This function registers the memory allocator (memory allocation/release function) in the CRI File System library.
Use these functions to replace the memory release processing that the CRI File System library performs in the library with user's own memory release processing.

Typedef Documentation

◆ CriFsThreadModel

Thread model.

Description:
This function shows the thread model in which the CRI File System library operates.
Specify this in the CriFsConfig structure when initializing the library (::criFs_InitializeLibrary function).
See also
CriFsConfig
criFs_InitializeLibrary

◆ CriFsConfig

typedef struct CriFsConfigTag CriFsConfig

Configuration.

Description:
This is a structure to specify the specifications of the CRI File System library.
When initializing the library (::criFs_InitializeLibrary function), specify this structure as an argument.
The CRI File System library allocates the necessary number of internal sources according to the configuration specified at the time of initialization.
The smaller a value you specify in the configuration, the smaller the memory size the library requires.
Note that because the number of handles cannot be more than the number specified in the configuration, if a value specified is too small, allocation of handles may fail.
Note:
When using the default settings, set the default parameter using the ::criFs_SetDefaultConfig function, and specify it in the ::criFs_InitializeLibrary function.
Attention
In consideration of future increases in the number of members, initialize the parameter using the :criFs_SetDefaultConfig function before making setting.
See also
criFs_InitializeLibrary, criFs_SetDefaultConfig

Enumeration Type Documentation

◆ CriFsThreadModelTag

Thread model.

Description:
This function shows the thread model in which the CRI File System library operates.
Specify this in the CriFsConfig structure when initializing the library (::criFs_InitializeLibrary function).
See also
CriFsConfig
criFs_InitializeLibrary
Enumerator
CRIFS_THREAD_MODEL_MULTI 

Multithread.

Description:
The library creates threads inside and operates in multithread environment.
A thread is created when the ::criFs_InitializeLibrary function is called.
CRIFS_THREAD_MODEL_MULTI_USER_DRIVEN 

Multithread (user-driven)

Description:
The library creates threads inside and operates in multithread environment.
A thread is created when the ::criFs_InitializeLibrary function is called.
The server processing is executed on the created thread; however, unlike CRIFS_THREAD_MODEL_MULTI, the processing is not automatically executed.
The user must explicitly execute the processing on the server using the ::criFs_ExecuteMain function.
(Executing the ::criFs_ExecuteMain function starts the thread to execute the processing on the server.)
CRIFS_THREAD_MODEL_USER_MULTI 

User multithread.

Description:
No thread is created but exclusion control is performed inside the library for the server processing functions (::criFs_ExecuteFileAccess, ::criFs_ExecuteDataDecompression) to be able to be called from a user-created thread.
CRIFS_THREAD_MODEL_SINGLE 

Single thread.

Description:
No thread is created inside the library. Exclusion control is not performed inside the library either.
When selecting this model, call the APIs and server processing functions (::criFs_ExecuteFileAccess, ::criFs_ExecuteDataDecompression) from the same thread.

◆ CriFsFileMode

File Opening Mode.

Enumerator
CRIFS_FILE_MODE_APPEND 

Appends to an existing file

CRIFS_FILE_MODE_CREATE 

Creates a new file always

CRIFS_FILE_MODE_CREATE_NEW 

Creates a new file (Can not overwrite)

CRIFS_FILE_MODE_OPEN 

Opens an existing file

CRIFS_FILE_MODE_OPEN_OR_CREATE 

Opens a file if available (Or creates new file)

CRIFS_FILE_MODE_TRUNCATE 

Opens a file and truncates it

◆ CriFsFileAccess

Kind of File Access.

Enumerator
CRIFS_FILE_ACCESS_READ 

Read Only

CRIFS_FILE_ACCESS_WRITE 

Write Only

CRIFS_FILE_ACCESS_READ_WRITE 

Read and Write

◆ CriFsLoaderPriority

Loading Status.

Priority

Enumerator
CRIFSLOADER_PRIORITY_HIGHEST 

Highest

CRIFSLOADER_PRIORITY_ABOVE_NORMAL 

Above normal

CRIFSLOADER_PRIORITY_NORMAL 

Normal

CRIFSLOADER_PRIORITY_BELOW_NORMAL 

Below normal

CRIFSLOADER_PRIORITY_LOWEST 

Lowest