Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Casanowow Life for love
VLC-Android
Commits
d7cb6254
Commit
d7cb6254
authored
Aug 06, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wchar functions for 2.1/2.2
parent
2931e46c
Changes
31
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1638 additions
and
0 deletions
+1638
-0
vlc-android/jni/Android.mk
vlc-android/jni/Android.mk
+31
-0
vlc-android/jni/wchar/wcpcpy.c
vlc-android/jni/wchar/wcpcpy.c
+46
-0
vlc-android/jni/wchar/wcpncpy.c
vlc-android/jni/wchar/wcpncpy.c
+45
-0
vlc-android/jni/wchar/wcscasecmp.c
vlc-android/jni/wchar/wcscasecmp.c
+45
-0
vlc-android/jni/wchar/wcscat.c
vlc-android/jni/wchar/wcscat.c
+51
-0
vlc-android/jni/wchar/wcschr.c
vlc-android/jni/wchar/wcschr.c
+41
-0
vlc-android/jni/wchar/wcscmp.c
vlc-android/jni/wchar/wcscmp.c
+56
-0
vlc-android/jni/wchar/wcscoll.c
vlc-android/jni/wchar/wcscoll.c
+39
-0
vlc-android/jni/wchar/wcscpy.c
vlc-android/jni/wchar/wcscpy.c
+49
-0
vlc-android/jni/wchar/wcscspn.c
vlc-android/jni/wchar/wcscspn.c
+58
-0
vlc-android/jni/wchar/wcsdup.c
vlc-android/jni/wchar/wcsdup.c
+43
-0
vlc-android/jni/wchar/wcslcat.c
vlc-android/jni/wchar/wcslcat.c
+74
-0
vlc-android/jni/wchar/wcslcpy.c
vlc-android/jni/wchar/wcslcpy.c
+70
-0
vlc-android/jni/wchar/wcslen.c
vlc-android/jni/wchar/wcslen.c
+49
-0
vlc-android/jni/wchar/wcsncasecmp.c
vlc-android/jni/wchar/wcsncasecmp.c
+49
-0
vlc-android/jni/wchar/wcsncat.c
vlc-android/jni/wchar/wcsncat.c
+57
-0
vlc-android/jni/wchar/wcsncmp.c
vlc-android/jni/wchar/wcsncmp.c
+57
-0
vlc-android/jni/wchar/wcsncpy.c
vlc-android/jni/wchar/wcsncpy.c
+64
-0
vlc-android/jni/wchar/wcsnlen.c
vlc-android/jni/wchar/wcsnlen.c
+42
-0
vlc-android/jni/wchar/wcspbrk.c
vlc-android/jni/wchar/wcspbrk.c
+58
-0
vlc-android/jni/wchar/wcsrchr.c
vlc-android/jni/wchar/wcsrchr.c
+47
-0
vlc-android/jni/wchar/wcsspn.c
vlc-android/jni/wchar/wcsspn.c
+60
-0
vlc-android/jni/wchar/wcsstr.c
vlc-android/jni/wchar/wcsstr.c
+63
-0
vlc-android/jni/wchar/wcstok.c
vlc-android/jni/wchar/wcstok.c
+86
-0
vlc-android/jni/wchar/wcswidth.c
vlc-android/jni/wchar/wcswidth.c
+57
-0
vlc-android/jni/wchar/wcsxfrm.c
vlc-android/jni/wchar/wcsxfrm.c
+57
-0
vlc-android/jni/wchar/wmemchr.c
vlc-android/jni/wchar/wmemchr.c
+52
-0
vlc-android/jni/wchar/wmemcmp.c
vlc-android/jni/wchar/wmemcmp.c
+53
-0
vlc-android/jni/wchar/wmemcpy.c
vlc-android/jni/wchar/wmemcpy.c
+44
-0
vlc-android/jni/wchar/wmemmove.c
vlc-android/jni/wchar/wmemmove.c
+44
-0
vlc-android/jni/wchar/wmemset.c
vlc-android/jni/wchar/wmemset.c
+51
-0
No files found.
vlc-android/jni/Android.mk
View file @
d7cb6254
...
...
@@ -4,6 +4,37 @@ include $(CLEAR_VARS)
LOCAL_MODULE
:=
libvlcjni
LOCAL_SRC_FILES
:=
libvlcjni.c aout.c thumbnailer.c pthread-condattr.c pthread-rwlocks.c pthread-once.c eventfd.c sem.c
LOCAL_SRC_FILES
+=
wchar/wcpcpy.c
LOCAL_SRC_FILES
+=
wchar/wcpncpy.c
LOCAL_SRC_FILES
+=
wchar/wcscasecmp.c
LOCAL_SRC_FILES
+=
wchar/wcscat.c
LOCAL_SRC_FILES
+=
wchar/wcschr.c
LOCAL_SRC_FILES
+=
wchar/wcscmp.c
LOCAL_SRC_FILES
+=
wchar/wcscoll.c
LOCAL_SRC_FILES
+=
wchar/wcscpy.c
LOCAL_SRC_FILES
+=
wchar/wcscspn.c
LOCAL_SRC_FILES
+=
wchar/wcsdup.c
LOCAL_SRC_FILES
+=
wchar/wcslcat.c
LOCAL_SRC_FILES
+=
wchar/wcslcpy.c
LOCAL_SRC_FILES
+=
wchar/wcslen.c
LOCAL_SRC_FILES
+=
wchar/wcsncasecmp.c
LOCAL_SRC_FILES
+=
wchar/wcsncat.c
LOCAL_SRC_FILES
+=
wchar/wcsncmp.c
LOCAL_SRC_FILES
+=
wchar/wcsncpy.c
LOCAL_SRC_FILES
+=
wchar/wcsnlen.c
LOCAL_SRC_FILES
+=
wchar/wcspbrk.c
LOCAL_SRC_FILES
+=
wchar/wcsrchr.c
LOCAL_SRC_FILES
+=
wchar/wcsspn.c
LOCAL_SRC_FILES
+=
wchar/wcsstr.c
LOCAL_SRC_FILES
+=
wchar/wcstok.c
LOCAL_SRC_FILES
+=
wchar/wcswidth.c
LOCAL_SRC_FILES
+=
wchar/wcsxfrm.c
LOCAL_SRC_FILES
+=
wchar/wmemchr.c
LOCAL_SRC_FILES
+=
wchar/wmemcmp.c
LOCAL_SRC_FILES
+=
wchar/wmemcpy.c
LOCAL_SRC_FILES
+=
wchar/wmemmove.c
LOCAL_SRC_FILES
+=
wchar/wmemset.c
LOCAL_C_INCLUDES
:=
$(VLC_SRC_DIR)
/include
...
...
vlc-android/jni/wchar/wcpcpy.c
0 → 100644
View file @
d7cb6254
/*
* Copyright (c) 1999
* David E. O'Brien
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static
char
sccsid
[]
=
"@(#)strcpy.c 8.1 (Berkeley) 6/4/93"
;
#endif
/* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
wchar_t
*
wcpcpy
(
wchar_t
*
__restrict
to
,
const
wchar_t
*
__restrict
from
)
{
for
(;
(
*
to
=
*
from
);
++
from
,
++
to
);
return
(
to
);
}
vlc-android/jni/wchar/wcpncpy.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
wchar_t
*
wcpncpy
(
wchar_t
*
__restrict
dst
,
const
wchar_t
*
__restrict
src
,
size_t
n
)
{
for
(;
n
--
;
dst
++
,
src
++
)
{
if
(
!
(
*
dst
=
*
src
))
{
wchar_t
*
ret
=
dst
;
while
(
n
--
)
*++
dst
=
L'\0'
;
return
(
ret
);
}
}
return
(
dst
);
}
vlc-android/jni/wchar/wcscasecmp.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c) 2009 David Schultz <das@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
#include <wctype.h>
int
wcscasecmp
(
const
wchar_t
*
s1
,
const
wchar_t
*
s2
)
{
wchar_t
c1
,
c2
;
for
(;
*
s1
;
s1
++
,
s2
++
)
{
c1
=
towlower
(
*
s1
);
c2
=
towlower
(
*
s2
);
if
(
c1
!=
c2
)
return
((
int
)
c1
-
c2
);
}
return
(
-*
s2
);
}
vlc-android/jni/wchar/wcscat.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* citrus Id: wcscat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
*/
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
wchar_t
*
wcscat
(
wchar_t
*
__restrict
s1
,
const
wchar_t
*
__restrict
s2
)
{
wchar_t
*
cp
;
cp
=
s1
;
while
(
*
cp
!=
L'\0'
)
cp
++
;
while
((
*
cp
++
=
*
s2
++
)
!=
L'\0'
)
;
return
(
s1
);
}
vlc-android/jni/wchar/wcschr.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c) 2002 Tim J. Robbins
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
wchar_t
*
wcschr
(
const
wchar_t
*
s
,
wchar_t
c
)
{
while
(
*
s
!=
c
&&
*
s
!=
L'\0'
)
s
++
;
if
(
*
s
==
c
)
return
((
wchar_t
*
)
s
);
return
(
NULL
);
}
vlc-android/jni/wchar/wcscmp.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
static
char
sccsid
[]
=
"@(#)strcmp.c 8.1 (Berkeley) 6/4/93"
;
#if 0
__RCSID("$NetBSD: wcscmp.c,v 1.3 2001/01/05 12:13:12 itojun Exp $");
#endif
#endif
/* LIBC_SCCS and not lint */
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
/*
* Compare strings.
*/
int
wcscmp
(
const
wchar_t
*
s1
,
const
wchar_t
*
s2
)
{
while
(
*
s1
==
*
s2
++
)
if
(
*
s1
++
==
'\0'
)
return
(
0
);
/* XXX assumes wchar_t = int */
return
(
*
(
const
unsigned
int
*
)
s1
-
*
(
const
unsigned
int
*
)
--
s2
);
}
vlc-android/jni/wchar/wcscoll.c
0 → 100644
View file @
d7cb6254
/*
* Copyright (C) 2010 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <wchar.h>
/*
* Compare strings using the current locale. Since Bionic really does not
* support locales, we assume we always use the C locale and call wcscmp.
*
* This function is provided to make libstdc++-v3 usable.
*/
int
wcscoll
(
const
wchar_t
*
ws1
,
const
wchar_t
*
ws2
)
{
return
wcscmp
(
ws1
,
ws2
);
}
vlc-android/jni/wchar/wcscpy.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* citrus Id: wcscpy.c,v 1.2 2000/12/21 04:51:09 itojun Exp
*/
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
wchar_t
*
wcscpy
(
wchar_t
*
__restrict
s1
,
const
wchar_t
*
__restrict
s2
)
{
wchar_t
*
cp
;
cp
=
s1
;
while
((
*
cp
++
=
*
s2
++
)
!=
L'\0'
)
;
return
(
s1
);
}
vlc-android/jni/wchar/wcscspn.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* citrus Id: wcscspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
*/
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID
(
"$FreeBSD$"
);
#include <wchar.h>
size_t
wcscspn
(
const
wchar_t
*
s
,
const
wchar_t
*
set
)
{
const
wchar_t
*
p
;
const
wchar_t
*
q
;
p
=
s
;
while
(
*
p
)
{
q
=
set
;
while
(
*
q
)
{
if
(
*
p
==
*
q
)
goto
done
;
q
++
;
}
p
++
;
}
done:
return
(
p
-
s
);
}
vlc-android/jni/wchar/wcsdup.c
0 → 100644
View file @
d7cb6254
/*-
* Copyright (c) 2005 Tim J. Robbins.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <stdlib.h>
#include <wchar.h>
wchar_t
*
wcsdup
(
const
wchar_t
*
s
)
{
wchar_t
*
copy
;
size_t
len
;
len
=
wcslen
(
s
)
+
1
;
if
((
copy
=
malloc
(
len
*
sizeof
(
wchar_t
)))
==
NULL
)
return
(
NULL
);
return
(
wmemcpy
(
copy
,
s
,
len
));
}
vlc-android/jni/wchar/wcslcat.c
0 → 100644
View file @
d7cb6254
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp
*/
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcslcat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID
(
"$FreeBSD$"
);
#include <sys/types.h>
#include <wchar.h>
/*
* Appends src to string dst of size siz (unlike wcsncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns wcslen(initial dst) + wcslen(src); if retval >= siz,
* truncation occurred.
*/
size_t
wcslcat
(
wchar_t
*
dst
,
const
wchar_t
*
src
,
size_t
siz
)
{
wchar_t
*
d
=
dst
;
const
wchar_t
*
s
=
src
;
size_t
n
=
siz
;
size_t
dlen
;
/* Find the end of dst and adjust bytes left but don't go past end */
while
(
*
d
!=
'\0'
&&
n
--
!=
0
)
d
++
;
dlen
=
d
-
dst
;
n
=
siz
-
dlen
;
if
(
n
==
0
)
return
(
dlen
+
wcslen
(
s
));
while
(
*
s
!=
'\0'
)
{
if
(
n
!=
1
)
{
*
d
++
=
*
s
;
n
--
;
}
s
++
;
}
*
d
=
'\0'
;
return
(
dlen
+
(
s
-
src
));
/* count does not include NUL */
}
vlc-android/jni/wchar/wcslcpy.c
0 → 100644
View file @
d7cb6254
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
*/
#include <sys/cdefs.h>
#if 0
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: wcslcpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $");
#endif /* LIBC_SCCS and not lint */
#endif
__FBSDID
(
"$FreeBSD$"
);
#include <sys/types.h>
#include <wchar.h>
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns wcslen(src); if retval >= siz, truncation occurred.
*/
size_t
wcslcpy
(
wchar_t
*
dst
,
const
wchar_t
*
src
,
size_t
siz
)
{
wchar_t
*
d
=
dst
;