pc_unicd.c

来自「nucleus file NUCLEUS的文件系统源代码」· C语言 代码 · 共 109 行

C
109
字号
/************************************************************************
*                                                                       
*       Copyright (c) 2001 by Accelerated Technology, Inc.              
*                                                                       
*  PROPRIETARY RIGHTS of Accelerated Technology are  involved in        
*  the subject matter of this material.  All manufacturing,             
*  reproduction, use, and sales rights pertaining to this subject       
*  matter are  governed by the license agreement.  The recipient of     
*     this software implicitly accepts the terms of the license.        
*                                                                       
*                                                                       
*************************************************************************

*************************************************************************
* FILE NAME                                     VERSION                 
*                                                                       
*       PC_UNICD.C                              FILE  2.3
*                                                                       
* COMPONENT                                                             
*                                                                       
*       Nucleus File                                                    
*                                                                       
* DESCRIPTION                                                           
*                                                                       
*       Convert unicode.                                                
*                                                                       
* DATA STRUCTURES                                                       
*                                                                       
*       None.                                                           
*                                                                       
* FUNCTIONS                                                             
*                                                                       
*       uni2asc                             Unicode to ascii.           
*       asc2uni                             Ascii to unicode.           
*                                                                       
* DEPENDENCIES                                                          
*                                                                       
*       pcdisk.h                            File common definitions     
*                                                                       
*************************************************************************/

#include        "file\pcdisk.h"


/************************************************************************
* FUNCTION                                                              
*                                                                       
*       uni2asc                                                         
*                                                                       
* DESCRIPTION                                                           
*                                                                       
*       Each long filename entry has Unicode character strings. This    
*       routine convert unicode to ascii code.                          
*       byte order.                                                     
*                                                                       
* AUTHOR                                                                
*                                                                       
*       Takahiro Takahashi
*                                                                       
* INPUTS                                                                
*                                                                       
*       ptr                                 Pointer to unicode          
*                                                                       
* OUTPUTS                                                               
*                                                                       
*       Ascii byte.                                                     
*                                                                       
*************************************************************************/
UINT8 uni2asc(UINT8 *ptr)
{

    return(*ptr);
}


/************************************************************************
* FUNCTION                                                              
*                                                                       
*       asc2uni                                                         
*                                                                       
* DESCRIPTION                                                           
*                                                                       
*       Each long filename entry has Unicode character strings. This    
*       routine convert ascii to unicode.                               
*       byte order.                                                     
*                                                                       
* AUTHOR                                                                
*                                                                       
*       Takahiro Takahashi
*                                                                       
* INPUTS                                                                
*                                                                       
*       ptr                                 Pointer to unicode          
*       asc                                 Ascii character             
*                                                                       
* OUTPUTS                                                               
*                                                                       
*       Ascii byte.                                                     
*                                                                       
*************************************************************************/
UINT8 asc2uni(UINT8 *ptr, UINT8 ascii)
{

    *ptr = ascii;
    *(ptr+1) = 0;

    return(*ptr);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?