FX_DNE.C
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:8k
- /**************************************************************************/
- /* */
- /* 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 */
- /** */
- /** Directory (DIR) */
- /** */
- /**************************************************************************/
- /**************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifdef ENABLE_FILEX
- #ifdef _DEBUG
- #undef IFTRACE
- #define IFTRACE if (gTraceFileSys)
- #include "DebugDbgMain.h"
- #endif //_DEBUG
- #define FX_SOURCE_CODE
- /* Include necessary system files. */
- #include "PlaycoreFileSysFileXfx_api.h"
- #include "PlaycoreFileSysFileXfx_sys.h"
- #include "PlaycoreFileSysFileXfx_dir.h"
- #include "PlaycoreFileSysFileXfx_uti.h"
- /**************************************************************************/
- /* */
- /* FUNCTION RELEASE */
- /* */
- /* _fx_directory_name_extract PORTABLE C */
- /* 3.0 */
- /* AUTHOR */
- /* */
- /* William E. Lamie, Express Logic, Inc. */
- /* */
- /* DESCRIPTION */
- /* */
- /* This function extracts the file name from the supplied input */
- /* string. If there is nothing left after the extracted name, a NULL */
- /* is returned to the caller. Otherwise, if something is left, a */
- /* pointer to it is returned. */
- /* */
- /* INPUT */
- /* */
- /* source_ptr Source string pointer */
- /* dest_ptr Destination string pointer */
- /* */
- /* OUTPUT */
- /* */
- /* Pointer to Next Name (if multiple directories) */
- /* */
- /* CALLS */
- /* */
- /* None */
- /* */
- /* CALLED BY */
- /* */
- /* FileX System Functions */
- /* */
- /* RELEASE HISTORY */
- /* */
- /* DATE NAME DESCRIPTION */
- /* */
- /* 01-01-1999 William E. Lamie Initial Version 1.0 */
- /* 03-01-2000 William E. Lamie Modified comment(s), and */
- /* added casting to remove */
- /* compiler warning message, */
- /* resulting in version 1.0b. */
- /* 01-28-2001 William E. Lamie Modified comment(s), */
- /* resulting in version 2.0. */
- /* 03-01-2002 William E. Lamie Modified comment(s), and added*/
- /* long file name support, */
- /* resulting in version 3.0. */
- /* */
- /**************************************************************************/
- CHAR *_fx_directory_name_extract(CHAR_PTR source_ptr, CHAR_PTR dest_ptr)
- {
- int i;
- dest_ptr[0] = 0;
- if (*source_ptr == '\')
- source_ptr++;
- i = 0;
- while (*source_ptr)
- {
- if (*source_ptr == '\')
- break;
- /* Long name can be at most 255 characters. */
- if (i == FX_MAX_LONG_NAME_LEN - 1) break;
- #if 0
- /* Check for lower case letters. */
- if ((*source_ptr >= 'a') && (*source_ptr <= 'z'))
- {
- /* Store the character - converted to upper case. */
- dest_ptr[i] = (CHAR) (((UINT) (*source_ptr++)) - ((UINT) 0x20));
- }
- else
- #endif
- {
- /* Store the character. */
- dest_ptr[i] = *source_ptr++;
- }
- i++;
- }
- dest_ptr[i] = 0;
- if (*source_ptr == 0)
- source_ptr = FX_NULL;
- /* Return the last pointer position in the source. */
- return(source_ptr);
- }
- #endif