Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

bcmp(3) [osf1 man page]

bcopy(3)						     Library Functions Manual							  bcopy(3)

NAME
bcopy, bcmp, bzero - Perform memory operations LIBRARY
Standard C Library (libc) SYNOPSIS
#include <strings.h> void bcopy( const void *source, void *destination, size_t length); int bcmp( const void *string1, const void *string2, size_t length); void bzero( void *string, size_t length); The following function definitions do not conform to current standards and are supported only for backward compatibility: #include <string.h> void bcopy( const char *source, char *destination, int length); int bcmp( const char *string1, const char *string2, int length); void bzero( char *string, int length); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: bcopy(), bcmp(), bzero(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the original string for the bcopy() function. Points to the destination string for the bcopy() function. Specifies the byte string to be compared to the string2 parameter by the bcmp() function. Specifies the byte string to be compared to the string1 parameter by the bcmp() function. Specifies the length (in bytes) of the string. DESCRIPTION
The bcopy(), bcmp(), and bzero() functions operate on variable length strings of bytes. Unlike the string functions, they do not check for null bytes. The bcopy() function copies the value of the length parameter in bytes from the string in the source parameter to the string in the desti- nation parameter. The bcmp() function compares the byte string in the string1 parameter against the byte string of the string2 parameter, returning a 0 (zero) value if the two strings are identical and a nonzero value otherwise. The bzero() function nulls the string in the string parameter, for the value of the length parameter in bytes. NOTES
[Tru64 UNIX] The bcopy() function is similar to the memcpy() function except that the first two parameters are reversed. RELATED INFORMATION
Functions: memccpy(3), memcpy(3), string(3), swab(3) Standards: standards(5) delim off bcopy(3)

Check Out this Related Man Page

memccpy(3)						     Library Functions Manual							memccpy(3)

NAME
memccpy, memchr, memcmp, memcpy, memmove, memset - Perform memory operations LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <string.h> void *memccpy( void *s1, const void *s2, int c, size_t n); void *memchr( const void *s, int c, size_t n); int memcmp( const void *s1, const void *s2, size_t n); void *memcpy( void *s1, const void *s2, size_t n); void *memmove( void *s1, const void *s2, size_t n); void *memset( void *s, int c, size_t n); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: memchr(), memcmp(), memcpy(), memmove(), memset(): ISO C, XPG4, XPG4-UNIX memccpy(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the location of a string. Points to the location of a destination string. Points to the location of a source string. Specifies a character for which to search (except for memset(), in which c is the target of the copy). Specifies the number of characters to search. DESCRIPTION
The memccpy(), memchr(), memcmp(), memcpy(), memmove(), and memset() functions operate on strings in memory areas. A memory area is a group of contiguous characters bound by a count and not terminated by a null character. These memory functions do not check for overflow of the receiving memory area. All of the functions are declared in the string.h header file. The memccpy() function sequentially copies bytes from the location pointed to by the s2 parameter into the location pointed to by the s1 parameter until one of the following occurs: The character specified by the c parameter, which is converted to an unsigned char, is copied. The number of characters specified by the n parameter has been copied to the string at location s1. The memccpy() function returns a pointer to the character that follows character c in the string pointed to by s1. If character c is not encountered after n characters have been copied to the string at location s1, this function returns a null pointer. The memchr() function returns a pointer to the first occurrence of character (byte) c in the string pointed to by s. If character c is not encountered after n bytes have been copied to the string at location s, this function returns a null pointer. The memcmp() function compares the first n characters (bytes), which are converted to unsigned char, of the string pointed to by the s1 parameter with the first n characters (also interpreted as unsigned char) of the string pointed to by the s2 parameter. The memcmp() function returns 0 (zero) or a nonzero value to indicate the results of the comparison operation. The sign of a nonzero value is determined by the sign of the difference between the values of the first pair of bytes that differ in the strings being compared. Possi- ble return values and their meanings follow: When s1 is less than s2 When s1 is equal to s2 When s1 is greater than s2 The memcpy() function copies n bytes from the string pointed to by the s2 parameter into the location pointed to by the s1 parameter. When copying overlapping strings, the behavior of this function is unreliable. The memmove() function copies n bytes from the string at the location pointed to by the s2 parameter to the string at the location pointed to by the s1 parameter. Copying takes place as though the n number of bytes from string s2 were first copied into a temporary location having n bytes that do not overlap either of the strings pointed to by s1 and s2. Then, n number of bytes from the temporary location is copied to the string pointed to by s1. Consequently, this operation is nondestructive and proceeds from left to right. The memset() function copies the value of the byte specified by the c parameter, which is converted to an unsigned char, into each of the first n locations of the string pointed to by the s parameter. RETURN VALUES
The memccpy() function returns a pointer to the byte following the character (byte) specified by the c parameter in the string pointed to by the s1 parameter. If character c is not found after the number of bytes specified by the n parameter are scanned, the function returns a null pointer. The memchr() function returns a pointer to the character (byte) specified by the c parameter. If character c does not occur after n bytes in the string pointed to by the s parameter are scanned, the function returns a null pointer. The memcmp() function returns a value greater than, equal to, or less than 0 (zero), according to whether the string pointed to by the s1 parameter has a value greater than, equal to, or less than the string pointed to by the s2 parameter. The memcpy() and memmove() functions return the string pointed to by the s1 parameter. No return value is reserved to indicate an error. The memset() function returns the string pointed to by the s parameter. RELATED INFORMATION
Functions: bcopy(3), string(3), swab(3), wmemcpy(3) Standards: standards(5) delim off memccpy(3)
Man Page