Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ memory(3C) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

string(3C)

string(5)

wchar(5)

memory(3C)                                                       memory(3C)

NAME
     memory: memccpy, memchr, memcmp, memcpy, memmove, memset, wmemchr,
     wmemcmp, wmemcpy, wmemmove, wmemset - memory operations

SYNOPSIS
     #include <string.h>

     void *memccpy(void *s1, const void *s2, int c, sizet n);

     void *memchr(const void *s, int c, sizet n);

     int memcmp(const void *s1, const void *s2, sizet n);

     void *memcpy(void *s1, const void *s2, sizet n);

     void *memmove(void *s1, const void *s2, sizet n);

     void *memset(void *s, int c, sizet n);

     cc [flag ...] file ... -lw [library ...]

     #include <string.h>
     #include <wchar.h>

     wchart *wmemchr(const wchart *s, wchart c, sizet n);

     int wmemcmp(const wchart *s1, const wchart *s2, sizet n);

     wchart *wmemcpy(wchart *s1, const wchart *s2, sizet n);

     wchart *wmemmove(wchart *s1, const wchart *s2, sizet n);

     wchart *wmemset(wchart *s, wchart c, sizet n);

DESCRIPTION
     These functions enable memory areas to be efficiently processed.
     Memory areas are arrays of bytes which are bounded by a count, not
     terminated by a null character. The specified memory areas are not
     checked for the overflow.

     memccpy() copies bytes from memory area s2 into s1, and stops either
     after the first occurrence of c has been copied (which converts it to
     an unsigned char), or after n bytes have been copied. memccpy()
     returns a pointer to the byte after the copy of c in s1, or a null
     pointer if c was not found in the first n bytes of s2.

     memchr() returns a pointer to the first occurrence of c in the first n
     bytes (each interpreted as an unsigned char) of memory area s, or a
     null pointer if c does not occur.






Page 1                       Reliant UNIX 5.44                Printed 11/98

memory(3C)                                                       memory(3C)

     memcmp() compares the arguments s1 and s2, comparing only the first n
     bytes (each interpreted as an unsigned char), and returns an integer
     less than, equal to, or greater than 0, according to whether s1 is
     lexicographically less than, equal to, or greater than s2.

     memcpy() copies n bytes from memory area s2 to s1. It returns s1.

     memmove() copies n bytes from memory areas s2 to s1. Copying between
     objects that overlap will take place correctly. It returns s1.

     memset() sets the first n bytes in memory area s to the value of c
     (converted to an unsigned char). It returns s.

     The wmemchr() function locates the first occurrence of c in the ini-
     tial n wide-characters of the object pointed to by s.

     The wmemchr() function returns a pointer to the located wide-charac-
     ter, or a null pointer if the wide-character does not occur in the
     object.

     The wmemcmp() function compares the first n wide-characters of the
     object pointed to by s1 to the first n wide-characters of the object
     pointed to by s2.

     The wmemcmp() function returns an integer greater than, equal to, or
     less than zero, accordingly as the object pointed to by s1 is greater
     than, equal to, or less than the object pointed to by s2.

     The wmemcpy() function copies n wide-characters from the object
     pointed to by s2 to the object pointed to by s1.

     The wmemcpy() function returns the value of s1.

     The wmemmove() function copies n wide-characters from the object
     pointed to by s2 to the object pointed to by s1. Copying takes place
     as if the n wide-characters from the object pointed to by c are first
     copied into a temporary array of n wide-characters that does not over-
     lap the objects pointed to by s1 or s2, and then the n wide-characters
     from the temporary array are copied into the object pointed to by s1.

     The wmemmove() function returns the value of s1.

     The wmemset() function copies the value of c into each of the first n
     wide-characters of the object pointed to by s.

     The wmemset() function returns the value of s.

SEE ALSO
     string(3C), string(5), wchar(5).





Page 2                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026