jgetmoji.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 89 行

C
89
字号
/****************************************************************************
*
*                            Open Watcom Project
*
*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
*  ========================================================================
*
*    This file contains Original Code and/or Modifications of Original
*    Code as defined in and that are subject to the Sybase Open Watcom
*    Public License version 1.0 (the 'License'). You may not use this file
*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
*    provided with the Original Code and Modifications, and is also
*    available at www.sybase.com/developer/opensource.
*
*    The Original Code and all software distributed under the License are
*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
*    NON-INFRINGEMENT. Please see the License for the specific language
*    governing rights and limitations under the License.
*
*  ========================================================================
*
* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
*               DESCRIBE IT HERE!
*
****************************************************************************/


#include "variety.h"
#include <jctype.h>
#include <jstring.h>

/**
*
*  Name:        jgetmoji        侾暥帤庢傝弌偡
*
*  Synopsis:    newp = jgetmoji( p, moji );
*
*               JSTRING newp;   師偺億僀儞僞
*               JSTRING p;      暥帤楍
*               JMOJI *moji;    暥帤
*
*  Description: 暥帤楍偐傜愭摢偺侾暥帤傪庢傝弌偡丅
*               戞侾僶僀僩偑娍帤僐乕僪偱戞俀僶僀僩偑僰儖暥帤偺帪偼
*               僰儖暥帤偲傒側偟丄戞侾僶僀僩傪僰儖暥帤偵彂偒姺偊傞丅
*
*  Return:      師偺暥帤偺億僀儞僞傪曉偡丅
*               僰儖暥帤偺帪偼僰儖暥帤帺懱偺億僀儞僞傪曉偡丅
*
*
*  Name:        jgetmoji        Get one character
*
*  Synopsis:    newp = jgetmoji( p, moji );
*
*               JSTRING newp;   Pointer to the next character to
*                               gotten character
*               JSTRING p;      String
*               JMOJI *moji;    Character
*
*  Description: Get one character from the head of the string
*               If the first byte is KANJI code and the second is NULL,
*               this function treats it as NULL character and changes the
*               first byte to NULL.
*
*  Return:      Return a pointer to the next character to the gotten
*               character. If the head of the string is NULL, return a pointer
*               to the NULL character.
*
**/

_WCRTLINK JSTRING jgetmoji( const JCHAR *p, JMOJI *moji )
{
    if( *moji = *p ) {
        p++;
        if( iskanji( *moji ) ) {
            if( *p )
                *moji = ( *moji << 8 ) | *p++;
            else
//              *--p = '\0';        // JBS 92/09/30
                *moji = '\0';       // JBS 92/09/30
        }
    }
    return( (JSTRING) p );
}

⌨️ 快捷键说明

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