- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
- /*
- Author: Jerry CAI
- Zoran China
- Created on: May 19 , 2003
- Descprition: The implementation file for function FX_FOBA(file open by address, for read only)
- */
- #include "Config.h" // Global Configuration - do not remove!
- #ifdef ENABLE_FILEX
- /**************************************************************************/
- /**************************************************************************/
- /** */
- /** FileX Component */
- /** */
- /** File (FIL) */
- /** */
- /**************************************************************************/
- /**************************************************************************/
- #define FX_SOURCE_CODE
- /* Include necessary system files. */
- #include "PlaycoreFileSysFileXfx_api.h"
- #include "PlaycoreFileSysFileXfx_sys.h"
- #include "PlaycoreFileSysFileXfx_dir.h"
- #include "PlaycoreFileSysFileXfx_fil.h"
- #include "PlaycoreFileSysFileXfx_uti.h"
- /**************************************************************************/
- /* */
- /* FUNCTION RELEASE */
- /* */
- /* _fx_file_open_by_addr */
- /* */
- /* */
- /* DESCRIPTION */
- /* */
- /* This function construct a file object with the given data */
- /* */
- /* INPUT */
- /* media_ptr Media control block pointer */
- /* file_ptr File control block pointer */
- /* dwStartCluster The start cluster num */
- /* cbFileSize File size in bytes */
- /* */
- /* OUTPUT */
- /* */
- /* return status */
- /* */
- /* */
- /* CALLED BY */
- /* */
- /* Application Code */
- /* */
- /**************************************************************************/
- UINT _fx_file_open_by_addr(FX_MEDIA *media_ptr, FX_FILE * file_ptr, ULONG dwStartCluster, UINT32 cbFileSize)
- {
- /* Check the media to make sure it is open. */
- if (media_ptr -> fx_media_id != FX_MEDIA_ID)
- {
- /* Return the media not opened error. */
- return(FX_MEDIA_NOT_OPEN);
- }
- /* Protect against other threads accessing the media. */
- FX_PROTECT
- file_ptr->fx_file_id = FX_FILE_ID;
- //file_ptr->fx_file_name = NULL; //not available
- /* Define the open mode request. */
- file_ptr->fx_file_open_mode = FX_OPEN_FOR_READ;
- /* Define the file modified field. */
- file_ptr->fx_file_modified = FX_FALSE;
- /* Define the complete directory entry structure. */
- //file_ptr->fx_file_dir_entry; //not available, not used by file read.
- /* Define the data storage parameters. */
- //file_ptr->fx_file_total_clusters;
- file_ptr->fx_file_first_physical_cluster = dwStartCluster;
- file_ptr->fx_file_consecutive_cluster = 1;
- //file_ptr->fx_file_last_physical_cluster;
- file_ptr->fx_file_current_physical_cluster = file_ptr->fx_file_first_physical_cluster;
- //file_ptr->fx_file_current_logical_sector = 0;
- file_ptr->fx_file_current_logical_offset = 0;
- file_ptr->fx_file_current_relative_cluster = 0;
- file_ptr->fx_file_current_relative_sector = 0;
- file_ptr->fx_file_current_file_offset = 0;
- file_ptr->fx_file_current_file_size = cbFileSize;
- file_ptr->fx_file_current_available_size = cbFileSize;
- /* Remember the media that is associated with this file. */
- file_ptr->fx_file_media_ptr = media_ptr;
- /* Define the pointers necessary to maintain the open file on
- the list of open files. */
- //file_ptr->fx_file_opened_next;
- //file_ptr->fx_file_opened_previous;
- /* Release media protection. */
- FX_UNPROTECT
- /* Open is complete, return successful status. */
- return _fx_file_seek(file_ptr, 0); // to calculate file_ptr->fx_file_current_logical_sector.
- }
- #endif //#ifdef ENABLE_FILEX