FX_DFEF.C
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:8k
源码类别:

DVD

开发平台:

Others

  1. /**************************************************************************/ 
  2. /*                                                                        */ 
  3. /*            Copyright (c) 1996-2002 by Express Logic Inc.               */ 
  4. /*                                                                        */ 
  5. /*  This software is copyrighted by and is the sole property of Express   */ 
  6. /*  Logic, Inc.  All rights, title, ownership, or other interests         */ 
  7. /*  in the software remain the property of Express Logic, Inc.  This      */ 
  8. /*  software may only be used in accordance with the corresponding        */ 
  9. /*  license agreement.  Any unauthorized use, duplication, transmission,  */ 
  10. /*  distribution, or disclosure of this software is expressly forbidden.  */ 
  11. /*                                                                        */
  12. /*  This Copyright notice may not be removed or modified without prior    */ 
  13. /*  written consent of Express Logic, Inc.                                */ 
  14. /*                                                                        */ 
  15. /*  Express Logic, Inc. reserves the right to modify this software        */ 
  16. /*  without notice.                                                       */ 
  17. /*                                                                        */ 
  18. /*  Express Logic, Inc.                     info@expresslogic.com         */
  19. /*  11423 West Bernardo Court               http://www.expresslogic.com   */
  20. /*  San Diego, CA  92127                                                  */
  21. /*                                                                        */
  22. /**************************************************************************/
  23. /**************************************************************************/
  24. /**************************************************************************/
  25. /**                                                                       */ 
  26. /** FileX Component                                                       */ 
  27. /**                                                                       */
  28. /**   Directory (DIR)                                                     */
  29. /**                                                                       */
  30. /**************************************************************************/
  31. /**************************************************************************/
  32. #include "Config.h" // Global Configuration - do not remove!
  33. #ifdef ENABLE_FILEX
  34. #ifdef _DEBUG
  35. #undef IFTRACE
  36. #define IFTRACE if (gTraceFileSys)
  37. #include "DebugDbgMain.h"
  38. #endif //_DEBUG
  39. #define FX_SOURCE_CODE
  40. /* Include necessary system files.  */
  41. #include "PlaycoreFileSysFileXfx_api.h"
  42. #include "PlaycoreFileSysFileXfx_sys.h"
  43. #include "PlaycoreFileSysFileXfx_dir.h"
  44. #include "PlaycoreFileSysFileXfx_uti.h"
  45. #ifndef FX_NO_LOCAL_PATH
  46. extern TX_THREAD *_tx_thread_current_ptr;
  47. #endif
  48. /**************************************************************************/ 
  49. /*                                                                        */ 
  50. /*  FUNCTION                                               RELEASE        */ 
  51. /*                                                                        */ 
  52. /*    _fx_directory_first_entry_find                      PORTABLE C      */ 
  53. /*                                                           3.0          */ 
  54. /*  AUTHOR                                                                */ 
  55. /*                                                                        */ 
  56. /*    William E. Lamie, Express Logic, Inc.                               */ 
  57. /*                                                                        */ 
  58. /*  DESCRIPTION                                                           */ 
  59. /*                                                                        */ 
  60. /*    This function returns the first directory entry of the current      */ 
  61. /*    working directory.                                                  */ 
  62. /*                                                                        */ 
  63. /*  INPUT                                                                 */ 
  64. /*                                                                        */ 
  65. /*    media_ptr                             Media control block pointer   */ 
  66. /*    directory_name                        Destination for directory     */ 
  67. /*                                            name                        */ 
  68. /*                                                                        */ 
  69. /*  OUTPUT                                                                */ 
  70. /*                                                                        */ 
  71. /*    return status                                                       */ 
  72. /*                                                                        */ 
  73. /*  CALLS                                                                 */ 
  74. /*                                                                        */ 
  75. /*    _fx_directory_next_entry_find         Find next directory entry     */ 
  76. /*                                                                        */ 
  77. /*  CALLED BY                                                             */ 
  78. /*                                                                        */ 
  79. /*    FileX System Functions                                              */ 
  80. /*                                                                        */ 
  81. /*  RELEASE HISTORY                                                       */ 
  82. /*                                                                        */ 
  83. /*    DATE              NAME                      DESCRIPTION             */ 
  84. /*                                                                        */ 
  85. /*  01-01-1999     William E. Lamie         Initial Version 1.0           */ 
  86. /*  03-01-2000     William E. Lamie         Modified comment(s),          */ 
  87. /*                                            resulting in version 1.0b.  */ 
  88. /*  01-28-2001     William E. Lamie         Modified comment(s) and added */ 
  89. /*                                            logic to use internal path  */ 
  90. /*                                            or local path, resulting    */ 
  91. /*                                            in version 2.0.             */ 
  92. /*  03-01-2002     William E. Lamie         Modified comment(s),          */ 
  93. /*                                            resulting in version 3.0.   */ 
  94. /*                                                                        */ 
  95. /**************************************************************************/ 
  96. UINT  _fx_directory_first_entry_find(FX_MEDIA *media_ptr, CHAR *directory_name)
  97. {
  98. UINT            status;
  99.     /* Check the media to make sure it is open.  */
  100.     if (media_ptr -> fx_media_id != FX_MEDIA_ID)
  101.     {
  102.         /* Return the media not opened error.  */
  103.         return(FX_MEDIA_NOT_OPEN);
  104.     }
  105.     /* Protect against other threads accessing the media.  */
  106.     FX_PROTECT
  107.     /* Determine if a local path is in effect at this point.  */
  108. #ifndef FX_NO_LOCAL_PATH
  109.         if (_tx_thread_current_ptr -> tx_filex_ptr)
  110.         {
  111.             /* Yes, there is a local path.  Set the current entry to zero.  */
  112.             ((FX_PATH *) _tx_thread_current_ptr -> tx_filex_ptr) -> fx_path_current_entry =  0;
  113.         } 
  114.         else
  115.         {
  116.             /* Use global default directory.  Set the current entry to 0 in 
  117.                order to pickup the first entry.  */
  118.             media_ptr -> fx_media_default_path.fx_path_current_entry =  0;
  119.         }
  120. #else
  121.     
  122.     /* Set the current entry to 0 in order to pickup the first entry.  */
  123.     media_ptr -> fx_media_default_path.fx_path_current_entry =  0;
  124. #endif
  125.     /* Release media protection.  */
  126.     FX_UNPROTECT
  127.     /* Call the next directory entry to pickup the first entry.  */
  128.     status =  _fx_directory_next_entry_find(media_ptr, directory_name);
  129.     /* Return status to the caller.  */
  130.     return(status);
  131. }
  132. #endif