fx_api.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:31k
- /**************************************************************************/
- /* */
- /* Copyright (c) 1996-2002 by Express Logic Inc. */
- /* */
- /* This software is copyrighted by and is the sole property of Express */
- /* Logic, Inc. All rights, title, ownership, or other interests */
- /* in the software remain the property of Express Logic, Inc. This */
- /* software may only be used in accordance with the corresponding */
- /* license agreement. Any unauthorized use, duplication, transmission, */
- /* distribution, or disclosure of this software is expressly forbidden. */
- /* */
- /* This Copyright notice may not be removed or modified without prior */
- /* written consent of Express Logic, Inc. */
- /* */
- /* Express Logic, Inc. reserves the right to modify this software */
- /* without notice. */
- /* */
- /* Express Logic, Inc. info@expresslogic.com */
- /* 11423 West Bernardo Court http://www.expresslogic.com */
- /* San Diego, CA 92127 */
- /* */
- /**************************************************************************/
- /**************************************************************************/
- /**************************************************************************/
- /** */
- /** FileX Component */
- /** */
- /** Application Interface (API) */
- /** */
- /**************************************************************************/
- /**************************************************************************/
- /**************************************************************************/
- /* */
- /* APPLICATION INTERFACE DEFINITION RELEASE */
- /* */
- /* fx_api.h PORTABLE C */
- /* 3.0 */
- /* AUTHOR */
- /* */
- /* William E. Lamie, Express Logic, Inc. */
- /* */
- /* DESCRIPTION */
- /* */
- /* This file defines the basic Application Interface (API) to the */
- /* high-performance FileX MS-DOS compatible embedded file system. */
- /* All service prototypes and data structure definitions are defined */
- /* in this file. */
- /* */
- /* RELEASE HISTORY */
- /* */
- /* DATE NAME DESCRIPTION */
- /* */
- /* 01-01-1999 William E. Lamie Initial Version 1.0 */
- /* 03-01-2000 William E. Lamie Modified comment(s), added */
- /* FX_MAXIMUM_PATH constant, */
- /* added current path string, */
- /* added prototype for the */
- /* fx_system_time_get call, */
- /* and added prototypes for */
- /* utilities used by drivers, */
- /* resulting in version 1.0b. */
- /* 01-28-2001 William E. Lamie Modified comment(s), added */
- /* new constants, function */
- /* prototypes, local path */
- /* logic, smart FAT searching, */
- /* and support for logical */
- /* sector caching, resulting */
- /* in version 2.0. */
- /* 03-01-2002 Mohammad N. Minhaz Modified comment(s), */
- /* added FAT32 constants and */
- /* structure fields, changed */
- /* directory name size for */
- /* long file name support, */
- /* added write protect flag, */
- /* and added support for */
- /* notification of drive when */
- /* clusters are freed, */
- /* resulting in version 3.0. */
- /* */
- /**************************************************************************/
- #ifndef FX_API
- #define FX_API
- #define _fx_utility_16_unsigned_read(source_ptr)
- (((((UINT) *((source_ptr) + 1)) & 0xFF) << 8) |
- ((UINT) *(source_ptr) & 0xFF))
- #define _fx_utility_16_unsigned_write(dest_ptr, value)
- {*((dest_ptr)) = (UCHAR) ((value) & 0xFF);
- *((dest_ptr) + 1) = (UCHAR) (((value) >> 8) & 0xFF);}
- #define _fx_utility_32_unsigned_read(source_ptr)
- (((((ULONG) *((source_ptr)+3)) & 0xFF) << 24) |
- ((((ULONG) *((source_ptr)+2)) & 0xFF) << 16) |
- ((((ULONG) *((source_ptr)+1)) & 0xFF) << 8) |
- (((ULONG) *(source_ptr)) & 0xFF))
- #define _fx_utility_32_unsigned_write(dest_ptr,value)
- {*((UCHAR_PTR)(dest_ptr)) = (UCHAR) (((ULONG)(value)) & 0xFF);
- *(((UCHAR_PTR)(dest_ptr)) + 1) = (UCHAR) ((((ULONG)(value)) >> 8) & 0xFF);
- *(((UCHAR_PTR)(dest_ptr)) + 2) = (UCHAR) ((((ULONG)(value)) >> 16) & 0xFF);
- *(((UCHAR_PTR)(dest_ptr)) + 3) = (UCHAR) ((((ULONG)(value)) >> 24) & 0xFF);}
- /* Determine if a C++ compiler is being used. If so, ensure that standard
- C is used to process the API information. */
- #ifdef __cplusplus
- /* Yes, C++ compiler is present. Use standard C. */
- extern "C" {
- #endif
- // Remove checking
- #define FX_DISABLE_ERROR_CHECKING
- // Added by Ofir in order to avoid semaphores and timers
- #define FX_NO_TIMER
- #define FX_NO_LOCAL_PATH
- #define FX_SINGLE_THREAD
- #define TX_NO_LOCAL_PATH
- /* Include the FileX port-specific file. */
- #include "PlaycoreFileSysFileXHeaderfx_port.h"
- /* Define basic constants for FileX. */
- #define FX_MEDIA_ID 0x4D454449UL
- #define FX_MEDIA_DIRECT_ID 0x4D454448UL
- #define FX_MEDIA_CLOSED_ID 0x4D454443UL
- #define FX_MEDIA_ABORTED_ID 0x4D454441UL
- #define FX_DIRECT_SUCCESS 0x91
- #define FX_MEDIA_INVALID 0x02
- #define FX_BUFFER_ERROR 0x21
- #define FX_FREE_CLUSTER 0x0000
- #define FX_FILE_ID 0x46494C45UL
- #define FX_FILE_CLOSED_ID 0x46494C43UL
- #define FX_FILE_ABORTED_ID 0x46494C41UL
- #define FX_MAXIMUM_PATH 255
- #ifdef V882_FLASH_CARD
- #ifdef FILEX_READ_4_SECTORS
- #define FX_MAX_SECTOR_CACHE 2
- #else
- #define FX_MAX_SECTOR_CACHE 2
- #endif
- #else
- #ifdef FILEX_READ_4_SECTORS
- #define FX_MAX_SECTOR_CACHE 6
- #else
- #define FX_MAX_SECTOR_CACHE 1
- #endif
- #endif
- /* FileX API input parameters and general constants. */
- #define FX_FAIL 2 //XD_FAST_LOADING
- #define FX_TRUE 1
- #define FX_FALSE 0
- #define FX_NULL 0
- #define FX_OPEN_FOR_READ 0
- #define FX_OPEN_FOR_WRITE 1
- #define FX_NO_PARTITION 0xFFFFFFFFUL
- #define FX_FAT_ENTRY_START 2
- #define FX_DIR_ENTRY_SIZE 32UL
- #define FX_DIR_NAME_SIZE 8
- #define FX_DIR_EXT_SIZE 3
- #define FX_DIR_RESERVED 8
- #define FX_DIR_ENTRY_FREE 0xE5
- #define FX_DIR_ENTRY_DONE 0x00
- #define FX_READ_ONLY 0x01
- #define FX_HIDDEN 0x02
- #define FX_SYSTEM 0x04
- #define FX_VOLUME 0x08
- #define FX_DIRECTORY 0x10
- #define FX_ARCHIVE 0x20
- #define FX_LONG_NAME 0x0f
- #define FX_12_BIT_FAT_SIZE 4086
- #define FX_16_BIT_FAT_SIZE 65525
- /* Define MS-DOS FAT entry values. */
- #define FX_RESERVED_1 0xFFF0
- #define FX_LAST_CLUSTER_1 0xFFF8
- #define FX_RESERVED_1_32 0x0FFFFFF0UL
- #define FX_LAST_CLUSTER_1_32 0x0FFFFFF8UL
- /* Define time/date MS-DOS constants. */
- #define FX_YEAR_SHIFT 9
- #define FX_MONTH_SHIFT 5
- #define FX_HOUR_SHIFT 11
- #define FX_MINUTE_SHIFT 5
- #define FX_YEAR_MASK 0x7F
- #define FX_MONTH_MASK 0x0F
- #define FX_DAY_MASK 0x1F
- #define FX_HOUR_MASK 0x1F
- #define FX_MINUTE_MASK 0x3F
- #define FX_SECOND_MASK 0x1F
- #define FX_BASE_YEAR 1980
- #define FX_INITIAL_DATE 0x2C61 /* 3-1-2002 */
- #define FX_INITIAL_TIME 0x0000 /* 12:00 am */
- /* FileX API return values. */
- #define FX_SUCCESS 0x00
- #define FX_FAT_READ_ERROR 0x03
- #define FX_NOT_FOUND 0x04
- #define FX_NOT_A_FILE 0x05
- #define FX_ACCESS_ERROR 0x06
- #define FX_NOT_OPEN 0x07
- #define FX_FILE_CORRUPT 0x08
- #define FX_END_OF_FILE 0x09
- #define FX_INVALID_PATH 0x0D
- #define FX_NOT_DIRECTORY 0x0E
- #define FX_NO_MORE_ENTRIES 0x0F
- #define FX_MEDIA_NOT_OPEN 0x11
- #define FX_NOT_IMPLEMENTED 0x22
- #define FX_WRITE_PROTECT 0x23
- #define FX_SECTOR_INVALID 0x89
- #define FX_IO_ERROR 0x90
- //#define FX_DIRECT_SUCCESS 0xF1
- #define FX_GENERAL_ERROR 0xF2
- #define FX_READ_ONLY_ERROR 0xF3
- /* FileX driver interface constants. */
- #define FX_DRIVER_READ 0
- #define FX_DRIVER_WRITE 1
- #define FX_DRIVER_FLUSH 2
- #define FX_DRIVER_ABORT 3
- #define FX_DRIVER_INIT 4
- #define FX_DRIVER_BOOT_READ 5
- #define FX_DRIVER_RELEASE_SECTORS 6
- #define FX_DRIVER_ERASE 7
- #define FX_DRIVER_GET_MEDIA_GEOMETRY 8
- #define FX_DRIVER_GET_DEVICE_GEOMETRY 19 // new - NOTICE!
- #define FX_DRIVER_FORMAT_DEVICE 9
- #define FX_DRIVER_FORMAT_PARTITION 10
- #define FX_DRIVER_INIT_ON_FORMAT 11
- #define FX_DRIVER_OPEN_BURST 12
- #define FX_DRIVER_WRITE_BURST 13
- #define FX_DRIVER_CLOSE_BURST 14
- #define FX_DRIVER_CHECK_WP_STATUS 15
- /* Define the control block definitions for all system objects. */
- /* Define media geometry structure. This structure contains fields describing
- the media both physically and logically. It is initialized by calling
- _fx_utility_get_media_geometry for the specified media. The structure
- is divided into groups of related parameters. Changing this structure
- requires good understanding of its functionality. */
- // These are invalid values used to initialize the parameter groups of the
- // structure.
- #define FX_UNDEF_CYLINDERS 0
- #define FX_UNDEF_START_END 0xFFFF
- #define FX_UNDEF_CLUSTER_SIZE 0
- #define FX_UNDEF_ROOT_ENTRIES 0
- #define FX_UNDEF_SIZE_IN_SECTORS 0xFFFFFFFFUL
- #define FX_UNDEF_SECTORS_PER_FAT 0
- #define FX_UNDEF_HIDDEN_SECTORS 0xFFFFFFFFUL
- #define FX_UNDEF_FAT_TYPE 0xFF
- #define FX_UNDEF_PARTITION_ALIGNMENT 0
- #define FX_UNDEF_MBR_SECTOR 0xFFFFFFFFUL
- #define FX_BOOT_SECTOR_SIZE 512
- typedef struct FX_GEOMETRY_STRUCT {
- // Available CHS.
- USHORT uwCylinders;
- USHORT uwHeads;
- USHORT uwSectorsPerTrack;
- // Partition Start.
- USHORT uwStartHead;
- USHORT uwStartSector;
- USHORT uwStartCylinder;
- USHORT uwEndHead;
- USHORT uwEndSector;
- USHORT uwEndCylinder;
- ULONG ulPartitionStartSector;
- // Number of sectors in a cluster.
- BYTE bySectorsPerCluster;
- // Number of 32-byte entries in the root directory.
- USHORT uwRootEntries;
- // Total number of sectors in the media.
- ULONG ulSizeInSectors;
- // Number of sectors that make up one FAT.
- USHORT uwSectorsPerFAT;
- // Number of sectors from beginning of media to boot sector.
- ULONG ulHiddenSectors;
- // Type of FAT.
- // NOTE: This does not include FAT32, but rather FAT12, FAT16, and
- // a newer version of FAT16 when the number of clusters exceeds 16
- // bits (that is called here BIGDOS).
- BYTE byFatType;
- #define FX_FAT12 1
- #define FX_FAT16 4
- #define FX_BIGDOS 6
- // Alignment for a first sector of a partition.
- ULONG ulPartitionAlignment;
- // Number of sector on device, where MBR resides.
- ULONG ulMbrSector;
- // For NANDs and NORs, this is the number of sectors that each erasable
- // block contains.
- USHORT uwSectorsPerBlockBits;
- // This parameter refers only to NANDs. It states the type of the NAND,
- // according to 4 defined groups (see FCU documentation for details).
- UINT uiNandType;
- // This parameter refers only to NORs. It states the type of the NOR,
- // currently supporting Intel and Amd.
- UINT uiNorType;
- // This parameter refers only to NORs - it specifies if there is a special
- // boot block (a block which can be erased in a smaller resolution).
- BOOL bNorBlockMapKnown;
- // This parameter holds the speed of the specific media we are working
- // with, in case it affects calls to the FCU driver.
- // The different speed options are media type specific.
- UINT uiSpeed;
- // This parameter defines with which type of card we are working with -
- // SD(4bit) or MMC(1bit).
- UINT uiSdProtocol;
- } FX_GEOMETRY, *FX_GEOMETRY_PTR;
- /* Define directory entry type. Directory entries are found in the
- root directory and in directory files (sub-directories). Default
- the directory name length to 13 for 8.3 compatibility (the dot and
- a NULL at the end). The user may change this on the compilation
- command line. */
- #ifndef FX_MAX_LONG_NAME_LEN
- //#define FX_MAX_LONG_NAME_LEN 13
- #define FX_MAX_LONG_NAME_LEN 65
- #endif
- typedef struct FX_DIR_ENTRY_STRUCT
- {
- CHAR fx_dir_entry_name[FX_MAX_LONG_NAME_LEN];
- UINT fx_dir_long_name_present; /* 0 (default) => not present; 1 => present*/
- UCHAR fx_dir_entry_attributes;
- UINT fx_dir_entry_time;
- UINT fx_dir_entry_date;
- ULONG fx_dir_entry_cluster;
- ULONG fx_dir_entry_file_size;
- ULONG fx_dir_entry_log_sector;
- ULONG fx_dir_entry_byte_offset;
- } FX_DIR_ENTRY;
- /* Define the path data structure. This structure will contain
- the current path and the information for performing directory
- entry operations. */
- typedef struct FX_PATH_STRUCT
- {
- /* Define the path information. */
- FX_DIR_ENTRY fx_path_directory;
- CHAR fx_path_string[FX_MAXIMUM_PATH];
- ULONG fx_path_current_entry;
- } FX_PATH;
- typedef FX_PATH FX_LOCAL_PATH;
- /* Define the cache control data structure. There are FX_MAX_SECTOR_CACHE
- of these structures defined inside the FX_MEDIA structure. Each entry
- maintains a cache representation of a media sector. */
- typedef struct FX_CACHED_SECTOR_STRUCT
- {
- /* Define the buffer pointer associated with this cache entry. */
- UCHAR_PTR fx_cached_sector_memory_buffer;
- /* Define the sector number that is cached. */
- ULONG fx_cached_sector;
- /* Define the flag that indicates whether or not the cached sector
- has been modified and needs to be written to the media. */
- UINT fx_cached_sector_buffer_dirty;
- /* Define the next cached sector pointer. This is used to implement
- the "last used" algorithm when looking for cache entry to swap out to
- the physical media. */
- struct FX_CACHED_SECTOR_STRUCT
- *fx_cached_sector_next_used;
- } FX_CACHED_SECTOR;
- /* Define a driver function */
- //typedef VOID(*FX_DRIVER)(struct FX_MEDIA_STRUCT*);
- /* Define the media control block. All information about each open
- media device are maintained in by the FX_MEDIA data type. */
- typedef struct FX_MEDIA_STRUCT
- {
- /* Define the media ID used for error checking. */
- ULONG fx_media_id;
- /* Define the media's name. */
- CHAR_PTR fx_media_name;
- /* Define the media's protection object, which is a ThreadX semaphore.
- Only one thread is allowed to access any media or associated files
- at a time. If FX_SINGLE_THREAD is defined, the FileX services are
- going to be called from only one thread, hence the protection is
- not needed. */
- #ifndef FX_SINGLE_THREAD
- OS_SEMAPHORE fx_media_protect;
- #endif
- /* Remember the memory buffer area. */
- UCHAR_PTR fx_media_memory_buffer;
- UCHAR_PTR fx_media_memory_buffer_orig;
- ULONG fx_media_memory_size;
- /* Define the sector cache control structures for this media. */
- struct FX_CACHED_SECTOR_STRUCT
- fx_media_sector_cache[FX_MAX_SECTOR_CACHE];
- /* Define the number of sectors actually cached based on the
- user supplied buffer at media open time. */
- ULONG fx_media_sector_cache_size;
- /* Define the end of the cache area. This is used to determine
- if the I/O is for the internal memory of the media. */
- UCHAR_PTR fx_media_sector_cache_end;
- /* Define the list head of the cached sector entries. This
- pointer points to the most recenty used cache sector. */
- struct FX_CACHED_SECTOR_STRUCT
- *fx_media_sector_cache_list_ptr;
- /* Define the basic information about the associated media. */
- UINT fx_media_bytes_per_sector;
- UINT fx_media_sectors_per_track;
- UINT fx_media_heads;
- ULONG fx_media_total_sectors;
- ULONG fx_media_total_clusters;
- UINT fx_media_reserved_sectors;
- UINT fx_media_root_sector_start;
- UINT fx_media_root_sectors;
- UINT fx_media_data_sector_start;
- UINT fx_media_sectors_per_cluster;
- UINT fx_media_sectors_per_FAT;
- UINT fx_media_number_of_FATs;
- UINT fx_media_12_bit_FAT;
- UINT fx_media_32_bit_FAT;
- ULONG fx_media_hidden_sectors;
- ULONG fx_media_root_clus_32;
- UINT fx_media_root_directory_entries;
- ULONG fx_media_available_clusters;
- ULONG fx_media_cluster_search_start;
- UCHAR fx_media_type;
- /* Define the information pertinent to the I/O driver interface. */
- VOID *fx_media_driver_info;
- UINT fx_media_driver_request;
- UINT fx_media_driver_status;
- UCHAR_PTR fx_media_driver_buffer;
- ULONG fx_media_driver_logical_sector;
- ULONG fx_media_driver_sectors;
- ULONG fx_media_driver_physical_sector;
- UINT fx_media_driver_physical_track;
- UINT fx_media_driver_physical_head;
- UINT fx_media_driver_write_protect; /* The driver sets this to FX_TRUE when media is write protected. */
- UINT fx_media_driver_free_sector_update; /* The driver sets this to FX_TRUE when it needs to know freed clusters. */
- /* Define the driver entry point. */
- //FX_DRIVER fx_media_driver_entry;
- /* Define the driver entry point. */
- VOID (*fx_media_driver_entry)(struct FX_MEDIA_STRUCT *);
- /* Define the current directory information for the media. */
- FX_PATH fx_media_default_path;
- /* Define the head pointer for the open files of this media. */
- struct FX_FILE_STRUCT
- *fx_media_opened_file_list;
- /* Define the counter for keeping track of how many open files are
- present. */
- ULONG fx_media_opened_file_count;
- /* Define the next and previous link pointers for the open media list. */
- struct FX_MEDIA_STRUCT
- *fx_media_opened_next,
- *fx_media_opened_previous;
- /* Define a variable for the application's use. */
- ULONG fx_media_reserved_for_user;
- /* Media geometry structure */
- FX_GEOMETRY fx_geometry;
- #ifdef FILEX_READ_4_SECTORS //JERRYC_2005AUG9
- BYTE fx_2nd_cache_entry;
- #endif
- } 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;
- } 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;
- /* 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;
- } FX_FILE;
- /* 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_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_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, CHAR *media_name,
- VOID (*media_driver)(FX_MEDIA *), VOID *driver_info_ptr,
- VOID *memory_ptr, ULONG memory_size, UINT partition);
- #endif
- /* Determine if a C++ compiler is being used. If so, complete the standard
- C conditional started above. */
- #ifdef __cplusplus
- }
- #endif
- #endif