?? fx_api.h
字號:
/* Define the next and previous link pointers for the open media list. */
struct FX_MEDIA_STRUCT
*fx_media_opened_next,
*fx_media_opened_previous;
#ifdef FILEX_ENABLE_WRITE
/* Define FAT entry cache and the variable used to index the cache. */
FX_FAT_ENTRY fx_media_fat_cache[FX_MAX_CACHED_FAT_ENTRY];
UINT fx_media_fat_cache_index;
/* Define the FAT secondary update map. This will be used on flush and
close to update sectors of any secondary FATs in the media. */
#ifndef FILEX_REMOVE_SECOND_FAT_MAP
UCHAR fx_media_fat_secondary_update_map[FX_FAT_MAP_SIZE];
#endif
//#ifndef FILEX_NO_DEFAULT_PATH_STRING
// CHAR fx_default_path_name[FX_MAX_LONG_NAME_LEN];
//#endif
//CHAR fx_default_path_name[2];
//change FileX to use unicode
WCHAR fx_default_path_name[2];
#endif
/* Define an area to allocate long file names so that local storage on
calling thread's stack is not used for long file names. This helps
reduce the amount of thread stack space needed when using FileX. */
//CHAR fx_media_name_buffer[4*FX_MAX_LONG_NAME_LEN];
//change FileX to use unicode
WCHAR fx_media_name_buffer[4*FX_MAX_LONG_NAME_LEN];
/* Define a variable for the application's use. */
// ULONG fx_media_reserved_for_user;
/* Media geometry structure */
FX_GEOMETRY fx_geometry;
CHAR ucForceCheckPartition;
} FX_MEDIA;
typedef FX_MEDIA* FX_MEDIA_PTR;
/* Define the FileX file control block. All information about open
files are found in this data type. */
typedef struct FX_FORMAT_PARAMS_STRUCT
{
// Volume ID.
ULONG ulVolumeId;
// Volume Label. Up to 11 are used, padded with ' '.
PCHAR szVolumeLabel;
// OEM name. Up to 8 are used, padded with ' '.
PCHAR szOemName;
// Specify number of FATs requested.
BYTE byNumOfFats;
// Number of sectors per cluster (0 means it will be chosen automatically).
BYTE bySectorsPerCluster;
// Points to 3 bytes to be placed at the beginning of the boot sector.
PBYTE pbyJumpInstruction;
// Format partition as a new device with an MBR.
BOOL bFormatAsNewDevice;
// Create volume Label
BOOL bCreateVolumeLabel;
} FX_FORMAT_PARAMS, *FX_FORMAT_PARAMS_PTR;
typedef struct FX_FILE_STRUCT
{
/* Define the file ID used for error checking. */
ULONG fx_file_id;
/* Define the file's name. */
//CHAR_PTR fx_file_name;
//change FileX to use unicode
WCHAR* fx_file_name;
/* Define the open mode request. */
UCHAR fx_file_open_mode;
/* Define the file modified field. */
UCHAR fx_file_modified;
/* Define the complete directory entry structure. */
FX_DIR_ENTRY fx_file_dir_entry;
/* Define the data storage parameters. */
ULONG fx_file_total_clusters;
ULONG fx_file_first_physical_cluster;
ULONG fx_file_consecutive_cluster;
ULONG fx_file_last_physical_cluster;
ULONG fx_file_current_physical_cluster;
ULONG fx_file_current_logical_sector;
ULONG fx_file_current_logical_offset;
ULONG fx_file_current_relative_cluster;
ULONG fx_file_current_relative_sector;
ULONG fx_file_current_file_offset;
ULONG fx_file_current_file_size;
ULONG fx_file_current_available_size;
/* Remember the media that is associated with this file. */
FX_MEDIA *fx_file_media_ptr;
/* Define the pointers necessary to maintain the open file on
the list of open files. */
struct FX_FILE_STRUCT
*fx_file_opened_next,
*fx_file_opened_previous;
#ifdef FILEX_ENABLE_WRITE
/* A pointer to a sector-sized buffer holding partial sector
information */
// PBYTE fx_file_burst_cache;
/* The basic burst size in burst-mode (defined when opening the file) */
// UINT fx_file_burst_basic_size;
/* The size of the current active burst in burst-mode */
// UINT fx_file_burst_current_size;
/* The current position in the burst (in sectors) */
// UINT fx_file_burst_current_offset;
// CHAR fx_file_name_buffer[FX_MAX_LONG_NAME_LEN];
#endif
} FX_FILE;
typedef struct FX_MASS_STORAGE_STRUCT
{
// Handles to Usb Host Pipes (HPIPE) for use of mass-storage
HANDLE hBulkOut;
HANDLE hBulkIn;
HANDLE hCtrl;
HANDLE hInterrupt;
// Endpoint numbers
BYTE byBulkOutEpAddr;
BYTE byBulkInEpAddr;
BYTE byCtrlEpAddr;
BYTE byInterruptEpAddr;
// Command set - Only MASS_STORAGE_BULK_ONLY currently supported
UINT uiCommandSet;
// Protocol - Only MASS_STORAGE_SFF_8070 currently supported
UINT uiProtocol;
} FX_MASS_STORAGE;
/* Define the FileX API mappings based on the error checking
selected by the user. Note: this section is only applicable to
application source code, hence the conditional that turns off this
stuff when the include file is processed by the FileX source. */
#ifndef FX_SOURCE_CODE
/* Determine if error checking is desired. If so, map API functions
to the appropriate error checking front-ends. Otherwise, map API
functions to the core functions that actually perform the work.
Note: error checking is enabled by default. */
#ifdef FX_DISABLE_ERROR_CHECKING
/* Services without error checking. */
#define fx_system_initialize _fx_system_initialize
#define fx_system_date_set _fx_system_date_set
#define fx_system_time_set _fx_system_time_set
#define fx_system_date_get _fx_system_date_get
#define fx_system_time_get _fx_system_time_get
#define fx_partition_create _fx_partition_create
#define fx_partition_format _fx_partition_format
#define fx_media_open _fx_media_open
#define fx_media_invalidate _fx_media_invalidate
#define fx_media_close _fx_media_close
#define fx_media_full_format _fx_media_full_format
#define fx_media_quick_format _fx_media_quick_format
#define fx_media_flush _fx_media_flush
#define fx_media_space_available _fx_media_space_available
#define fx_media_read _fx_media_read
#define fx_media_write _fx_media_write
#define fx_media_erase _fx_media_erase
#define fx_media_abort _fx_media_abort
#define fx_media_ioconfig _fx_media_ioconfig
#define fx_directory_create _fx_directory_create
#define fx_directory_delete _fx_directory_delete
#define fx_directory_rename _fx_directory_rename
#define fx_directory_first_entry_find _fx_directory_first_entry_find
#define fx_directory_next_entry_find _fx_directory_next_entry_find
#define fx_directory_first_full_entry_find _fx_directory_first_full_entry_find
#define fx_directory_next_full_entry_find _fx_directory_next_full_entry_find
#define fx_directory_name_test _fx_directory_name_test
#define fx_directory_information_get _fx_directory_information_get
#define fx_directory_default_set _fx_directory_default_set
#define fx_directory_default_get _fx_directory_default_get
#define fx_directory_local_path_clear _fx_directory_local_path_clear
#define fx_directory_local_path_get _fx_directory_local_path_get
#define fx_directory_local_path_set _fx_directory_local_path_set
#define fx_directory_local_path_restore _fx_directory_local_path_restore
#define fx_directory_attribute_read _fx_directory_attributes_read
#ifdef FILEX_ENABLE_WRITE
#define fx_directory_attribute_set _fx_directory_attributes_set
#endif
#define fx_directory_default_set_by_address _fx_directory_default_set_by_address
#define fx_file_create _fx_file_create
#define fx_file_delete _fx_file_delete
#define fx_file_rename _fx_file_rename
#define fx_file_attributes_set _fx_file_attributes_set
#define fx_file_attributes_read _fx_file_attributes_read
#define fx_file_open _fx_file_open
#define fx_file_close _fx_file_close
#define fx_file_read _fx_file_read
#define fx_file_write _fx_file_write
#define fx_file_allocate _fx_file_allocate
#define fx_file_best_effort_allocate _fx_file_best_effort_allocate
#define fx_file_seek _fx_file_seek
#define fx_file_relative_seek _fx_file_relative_seek
#define fx_file_truncate _fx_file_truncate
#define fx_file_open_by_addr _fx_file_open_by_addr
#else
/* Services with error checking. */
#define fx_system_initialize _fx_system_initialize
#define fx_system_date_set _fxe_system_date_set
#define fx_system_time_set _fxe_system_time_set
#define fx_system_date_get _fxe_system_date_get
#define fx_system_time_get _fxe_system_time_get
#define fx_partition_create _fxe_partition_create
#define fx_partition_format _fxe_partition_format
#define fx_media_open _fxe_media_open
#define fx_media_invalidate _fxe_media_invalidate
#define fx_media_close _fxe_media_close
#define fx_media_full_format _fxe_media_full_format
#define fx_media_quick_format _fxe_media_quick_format
#define fx_media_flush _fxe_media_flush
#define fx_media_space_available _fxe_media_space_available
#define fx_media_read _fxe_media_read
#define fx_media_write _fxe_media_write
#define fx_media_erase _fxe_media_erase
#define fx_media_abort _fxe_media_abort
#define fx_directory_create _fxe_directory_create
#define fx_directory_delete _fxe_directory_delete
#define fx_directory_rename _fxe_directory_rename
#define fx_directory_first_entry_find _fxe_directory_first_entry_find
#define fx_directory_next_entry_find _fxe_directory_next_entry_find
#define fx_directory_first_full_entry_find _fxe_directory_first_full_entry_find
#define fx_directory_next_full_entry_find _fxe_directory_next_full_entry_find
#define fx_directory_name_test _fxe_directory_name_test
#define fx_directory_information_get _fxe_directory_information_get
#define fx_directory_default_set _fxe_directory_default_set
#define fx_directory_default_get _fxe_directory_default_get
#define fx_directory_local_path_clear _fxe_directory_local_path_clear
#define fx_directory_local_path_get _fxe_directory_local_path_get
#define fx_directory_local_path_set _fxe_directory_local_path_set
#define fx_directory_local_path_restore _fxe_directory_local_path_restore
#define fx_file_create _fxe_file_create
#define fx_file_delete _fxe_file_delete
#define fx_file_rename _fxe_file_rename
#define fx_file_attributes_set _fxe_file_attributes_set
#define fx_file_attributes_read _fxe_file_attributes_read
#define fx_file_open _fxe_file_open
#define fx_file_close _fxe_file_close
#define fx_file_read _fxe_file_read
#define fx_file_write _fxe_file_write
#define fx_file_allocate _fxe_file_allocate
#define fx_file_best_effort_allocate _fxe_file_best_effort_allocate
#define fx_file_seek _fxe_file_seek
#define fx_file_relative_seek _fxe_file_relative_seek
#define fx_file_truncate _fxe_file_truncate
#endif
/* Define prototype for utility services commonly used by FileX I/O Drivers. This eliminates the
need to include internal FileX component files in I/O drivers. */
UINT _fx_partition_offset_calculate( VOID *part_sector,
UINT partition,
ULONG *partition_start,
ULONG *partition_size );
UINT _fx_media_open(FX_MEDIA *media_ptr, WCHAR *media_name,
VOID (*media_driver)(FX_MEDIA *), VOID *driver_info_ptr,
VOID *memory_ptr, ULONG memory_size, UINT partition);
#ifdef FILEX_ENABLE_WRITE //simon.huang_0831_2004 add for merging the writing functions of FILEX
UINT _fx_media_flush(FX_MEDIA *media_ptr);
#endif
UINT _fx_media_close(FX_MEDIA *media_ptr);
VOID _fx_utility_memory_set(UCHAR_PTR dest_ptr, BYTE value, ULONG size);
VOID _fx_utility_memory_copy(UCHAR_PTR source_ptr, UCHAR_PTR dest_ptr, ULONG size);
#endif
/* Determine if a C++ compiler is being used. If so, complete the standard
C conditional started above. */
#ifdef __cplusplus
}
#endif
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -