jstrskip.c

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

C
90
字号
/****************************************************************************
*
*                            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 <jstring.h>


/**
*
*  Name:        jstrskip        巜掕暥帤埲奜傪専嶕偡傞
*
*  Synopsis:    p = jstrskip( s, b );
*
*               JSTRING p;      暥帤偺億僀儞僞
*               JSTRING s;      暥帤楍
*               JSTRING b;      巜掕暥帤偺暥帤楍
*
*  Description: 倞倱倲倰倣倎倲們倛偼丄暥帤楍倱傪侾暥帤偯偮専嶕偟偰
*               嵟弶偵暥帤楍倐偵娷傑傟傞暥帤偲堦抳偟偨埵抲偺億僀儞
*               僞傪曉偡丅倞倱倲倰倱倠倝倫偼斀懳偵丄嵟弶偵暥帤楍倐
*               偵娷傑傟側偄暥帤偑尰傟偨埵抲偺億僀儞僞傪曉偡丅
*
*  Returns:     専嶕拞偵僰儖暥帤乮暥帤偺廔抂乯偵払偟偨応崌偼僰儖億
*               僀儞僞傪曉偡丅
*
*
*  Name:        jstrskip        compute the initial position of searching
*                               letter not occur in string
*
*  Synopsis:    p = jstrskip( s, b );
*
*               JSTRING p;      pointer to the initial position of searching
*                               letter not occur in string
*               JSTRING s;      pointer to the string for reference
*               JSTRING b;      pointer to the searching letters
*
*  Description: The jstrmatch function compute the initial position of the
*               string pointed to by s where occur the letters from the string
*               pointed to by b.  jstrskip function have the opposite
*               specification to jstrmatch, at the view of initial position
*               where not occur the searching letter.
*
*  Returns:     This function will return the NULL pointer if there is no the
*               other letters in the string "s".
**/


_WCRTLINK JSTRING jstrskip( const JCHAR *s, const JCHAR *b )
{
    const JCHAR *st, *bp;       /* add "bp" by M/M Mar/15/87 */
    JMOJI ss, bb;

    for( ; st = jgetmoji( s, &ss ), ss; s = st )
        for( bp = b;; ) {  /* reset the head pointer of character-set */
            bp = jgetmoji( bp, &bb ); /* by M/M Mar/15/87 */
            if( ss == bb ) break;
            if( bb == 0 ) return( (JSTRING) s );
        }
    return( (JSTRING) NULL );
}

⌨️ 快捷键说明

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