File: wmempcpy.c

package info (click to toggle)
picolibc 1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 31,616 kB
  • sloc: ansic: 312,308; asm: 22,739; perl: 2,414; sh: 1,619; python: 1,019; pascal: 329; exp: 287; makefile: 164; xml: 40; cpp: 10
file content (43 lines) | stat: -rw-r--r-- 1,170 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyright (c) 2017 Yaakov Selkowitz <yselkowi@redhat.com> */
/*
FUNCTION
	<<wmempcpy>>---copy wide characters in memory and return end pointer

SYNOPSIS
	#define _GNU_SOURCE
	#include <wchar.h>
	wchar_t *wmempcpy(wchar_t *<[d]>,
			 const wchar_t *<[s]>, size_t <[n]>);

DESCRIPTION
	The <<wmemcpy>> function copies <[n]> wide characters from the object
	pointed to by <[s]> to the object pointed to be <[d]>. This function
	is not affected by locale and all wchar_t values are treated
	identically.  The null wide character and wchar_t values not
	corresponding to valid characters are not treated specially.

	If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
	function copies zero wide characters.

RETURNS
	<<wmempcpy>> returns a pointer to the wide character following the
	last wide character copied to the <[out]> region.

PORTABILITY
<<wmempcpy>> is a GNU extension.

No supporting OS subroutines are required.
*/

#define _GNU_SOURCE
#include <_ansi.h>
#include <string.h>
#include <wchar.h>

wchar_t *
wmempcpy (wchar_t *__restrict d,
	const wchar_t *__restrict s,
	size_t n)
{
  return (wchar_t *) mempcpy (d, s, n * sizeof (wchar_t));
}