FX_DNE.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. /**************************************************************************/ 
  46. /*                                                                        */ 
  47. /*  FUNCTION                                               RELEASE        */ 
  48. /*                                                                        */ 
  49. /*    _fx_directory_name_extract                          PORTABLE C      */ 
  50. /*                                                           3.0          */ 
  51. /*  AUTHOR                                                                */ 
  52. /*                                                                        */ 
  53. /*    William E. Lamie, Express Logic, Inc.                               */ 
  54. /*                                                                        */ 
  55. /*  DESCRIPTION                                                           */ 
  56. /*                                                                        */ 
  57. /*    This function extracts the file name from the supplied input        */ 
  58. /*    string.  If there is nothing left after the extracted name, a NULL  */ 
  59. /*    is returned to the caller.  Otherwise, if something is left, a      */ 
  60. /*    pointer to it is returned.                                          */ 
  61. /*                                                                        */ 
  62. /*  INPUT                                                                 */ 
  63. /*                                                                        */ 
  64. /*    source_ptr                           Source string pointer          */ 
  65. /*    dest_ptr                             Destination string pointer     */ 
  66. /*                                                                        */ 
  67. /*  OUTPUT                                                                */ 
  68. /*                                                                        */ 
  69. /*    Pointer to Next Name                 (if multiple directories)      */ 
  70. /*                                                                        */ 
  71. /*  CALLS                                                                 */ 
  72. /*                                                                        */ 
  73. /*    None                                                                */ 
  74. /*                                                                        */ 
  75. /*  CALLED BY                                                             */ 
  76. /*                                                                        */ 
  77. /*    FileX System Functions                                              */ 
  78. /*                                                                        */ 
  79. /*  RELEASE HISTORY                                                       */ 
  80. /*                                                                        */ 
  81. /*    DATE              NAME                      DESCRIPTION             */ 
  82. /*                                                                        */ 
  83. /*  01-01-1999     William E. Lamie         Initial Version 1.0           */ 
  84. /*  03-01-2000     William E. Lamie         Modified comment(s), and      */ 
  85. /*                                            added casting to remove     */ 
  86. /*                                            compiler warning message,   */ 
  87. /*                                            resulting in version 1.0b.  */ 
  88. /*  01-28-2001     William E. Lamie         Modified comment(s),          */ 
  89. /*                                            resulting in version 2.0.   */ 
  90. /*  03-01-2002     William E. Lamie         Modified comment(s), and added*/ 
  91. /*                                            long file name support,     */ 
  92. /*                                            resulting in version 3.0.   */ 
  93. /*                                                                        */ 
  94. /**************************************************************************/ 
  95. CHAR  *_fx_directory_name_extract(CHAR_PTR source_ptr, CHAR_PTR dest_ptr)
  96. {
  97. int     i;
  98.     dest_ptr[0] = 0;
  99.     if (*source_ptr == '\')
  100.         source_ptr++;
  101.     i = 0;
  102.     while (*source_ptr)
  103.     {
  104.         if (*source_ptr == '\')
  105.             break;
  106.         /* Long name can be at most 255 characters.  */
  107.         if (i == FX_MAX_LONG_NAME_LEN - 1) break;  
  108. #if 0
  109.         /* Check for lower case letters.  */
  110.         if ((*source_ptr >= 'a') && (*source_ptr <= 'z'))
  111.         {
  112.              /* Store the character - converted to upper case.  */
  113.               dest_ptr[i] =  (CHAR) (((UINT) (*source_ptr++)) - ((UINT) 0x20));
  114.         }
  115.         else
  116. #endif
  117.         {
  118.              /* Store the character.  */
  119.              dest_ptr[i] =  *source_ptr++;
  120.         }
  121.         i++;
  122.     }
  123.     dest_ptr[i] = 0;
  124.     if (*source_ptr == 0)
  125.         source_ptr = FX_NULL;
  126.     /* Return the last pointer position in the source.  */
  127.     return(source_ptr);
  128. }
  129. #endif