memory(3) CLIX memory(3)
NAME
memory: memccpy, memchr, memcmp, memcpy, memset - Memory operations
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <memory.h>
char *memccpy(
char *s1 ,
char *s2 ,
int c ,
int n );
char *memchr(
char *s ,
int c ,
int n );
int memcmp(
char *s1 ,
char *s2 ,
int n );
char *memcpy(
char *s1 ,
char *s2 ,
int n );
char *memset(
char *s ,
int c ,
int n );
DESCRIPTION
These functions operate as efficiently as possible on memory areas (arrays
of characters bounded by a count, not terminated by a null character).
They do not check for the overflow of any receiving memory area.
The memccpy() function copies characters from memory area s2 into s1,
stopping after the first occurrence of character c has been copied, or
after n characters have been copied, whichever comes first. It returns a
pointer to the character after the copy of c in s1, or a pointer if c was
not found in the first n characters of s2.
The memchr() function returns a pointer to the first occurrence of
2/94 - Intergraph Corporation 1
memory(3) CLIX memory(3)
character c in the first n characters of memory area s, or a pointer if c
does not occur.
The memcmp() function compares its arguments, looking at the first n
characters only, and returns an integer less than, equal to, or greater
than 0, according as s1 is lexicographically less than, equal to, or
greater than s2.
The memcpy() function copies n characters from memory area s2 to s1. It
returns s1.
The memset() function sets the first n characters in memory area s to the
value of character c. It returns s.
For user convenience, all these functions are declared in the optional
<memory.h> header file.
The memcmp() is implemented by using the most natural character comparison
on the machine. Thus the sign of the value returned when one of the
characters has its high order bit set is not the same in all
implementations and should not be relied upon.
Character movement is performed differently in different implementations.
Thus overlapping moves may yield surprises.
2 Intergraph Corporation - 2/94