source: trunk/libs/newlib/src/newlib/libc/string/wcspbrk.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.5 KB
Line 
1/*
2FUNCTION
3        <<wcspbrk>>----scan wide-character string for a wide-character code
4
5SYNOPSIS
6        #include <wchar.h>
7        wchar_t *wcspbrk(const wchar_t *<[s]>, const wchar_t *<[set]>);
8
9DESCRIPTION
10        The <<wcspbrk>> function locates the first occurrence in the
11        wide-character string pointed to by <[s]> of any wide-character code
12        from the wide-character string pointed to by <[set]>.
13
14RETURNS
15        Upon successful completion, <<wcspbrk>> returns a pointer to the
16        wide-character code or a null pointer if no wide-character code from
17        <[set]> occurs in <[s]>.
18
19PORTABILITY
20<<wcspbrk>> is ISO/IEC 9899/AMD1:1995 (ISO C).
21
22No supporting OS subroutines are required.
23*/
24
25/*      $NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $       */
26
27/*-
28 * Copyright (c)1999 Citrus Project,
29 * All rights reserved.
30 *
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
33 * are met:
34 * 1. Redistributions of source code must retain the above copyright
35 *    notice, this list of conditions and the following disclaimer.
36 * 2. Redistributions in binary form must reproduce the above copyright
37 *    notice, this list of conditions and the following disclaimer in the
38 *    documentation and/or other materials provided with the distribution.
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
41 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 *
52 *      citrus Id: wcspbrk.c,v 1.2 2000/12/21 05:07:25 itojun Exp
53 */
54
55#include <_ansi.h>
56#include <stddef.h>
57#include <wchar.h>
58
59wchar_t *
60wcspbrk (const wchar_t * s,
61        const wchar_t * set)
62{
63  const wchar_t *p;
64  const wchar_t *q;
65
66  p = s;
67  while (*p)
68    {
69      q = set;
70      while (*q)
71        {
72          if (*p == *q)
73            {
74              /* LINTED interface specification */
75              return (wchar_t *) p;
76            }
77          q++;
78        }
79      p++;
80    }
81  return NULL;
82}
Note: See TracBrowser for help on using the repository browser.