Re: slave.c -- bcopy()??

From: Steve (quickey@cyberverse.com)
Date: 07/03/96


On Wed, 3 Jul 1996, Leeman Strout wrote:
> In the slave.c file that Jeremy sent across the list, there's a function 
> called bcopy()... and well, aside from not having my references with me, 
> I can't seem to figure out whether that's standard C or not.  Also can't 
> figure out what it's supposed to do.  Anyone looked at the code and have 
> a clue to hand out?
Here's the Linux man page on bcopy:

BCOPY(3)            LINUX Programmer's Manual            BCOPY(3)

NAME
       bcopy - copy byte strings

SYNOPSIS
       #include <string.h>

       void bcopy (const void *src, void *dest, int n);

DESCRIPTION
       The  bcopy()  function  copies  the  first  n bytes of the
       source string src to the destination string dest.  If n is
       zero, no bytes are copied.

RETURN VALUE
       The bcopy() function returns no value.

CONFORMING TO
       BSD 4.3

SEE ALSO
       memccpy(3), memcpy(3), memmove(3), strcpy(3), strncpy(3)

GNU                       April 9, 1993                         1


And Here is the SunOS manpage on bcopy:
BSTRING(3)             C LIBRARY FUNCTIONS             BSTRING(3)



NAME
     bstring, bcopy, bcmp, bzero,  ffs  -  bit  and  byte  string
     operations

SYNOPSIS
     void
     bcopy(b1, b2, length)
     char *b1, *b2;
     int length;

     int bcmp(b1, b2, length)
     char *b1, *b2;
     int length;

     void
     bzero(b, length)
     char *b;
     int length;

     int ffs(i)
     int i;

DESCRIPTION
     The functions bcopy, bcmp, and bzero() operate  on  variable
     length  strings  of bytes.  They do not check for null bytes
     as the routines in string(3) do.

     bcopy() copies length bytes from string b1 to the string b2.
     Overlapping strings are handled correctly.

     bcmp() compares byte  string  b1  against  byte  string  b2,
     returning  zero  if  they are identical, non-zero otherwise.
     Both strings are assumed to be length bytes long.  bcmp() of
     length zero bytes always returns zero.

     bzero() places length 0 bytes in the string b.

     ffs() finds the first bit set in the argument passed it  and
     returns  the  index of that bit.  Bits are numbered starting
     at 1 from the right.  A return value of zero indicates  that
     the value passed is zero.

NOTES
     The bcmp() and bcopy() routines  take  parameters  backwards
     from strcmp() and strcpy().

SEE ALSO
     string(3)







Sun Release 4.1   Last change: 23 November 1987                 1


From jelson@blaze.cs.jhu.edu Wed, 03 Jul 96 17:39:39 EDT
X-SystemInfo: MyE-Mail: EMail
X-ReplyTo-No: 1891 (There are more replies.)
X-Message-No: 1892 (database)
From: Jeremy Elson <jelson@blaze.cs.jhu.edu>
To: Steve <quickey@cyberverse.com>
Subject: Re: slave.c -- bcopy()?? 
Date: Wed, 3 Jul 96 17:39:00
Message-ID: <199607032139.XAA11833@flipper.pvv.ntnu.no>
X-POP3-Rcpt: lk4150@per
Return-Path: owner-circle@pvv.ntnu.no
Received: from flipper.pvv.ntnu.no (43@flipper.pvv.ntnu.no [129.241.210.200]) by per.cybercity.dk (8.6.12/8.6.12) with ESMTP id XAA28039 for <lk4150@krull.dk>; Wed, 3 Jul 1996 23:21:17 +0200
Received: (from majordomo@localhost) by flipper.pvv.ntnu.no (8.7.5/8.6.12) id XAA11838 for circle-outgoing; Wed, 3 Jul 1996 23:40:02 +0200
Received: from blaze.cs.jhu.edu (root@blaze.cs.jhu.edu [128.220.13.50]) by flipper.pvv.ntnu.no (8.7.5/8.6.12) with ESMTP id XAA11833 for <circle@pvv.ntnu.no>; Wed, 3 Jul 1996 23:39:52 +0200
Received: from mail-clientby blaze.cs.jhu.edu with SMTP; Wed, 3 Jul 1996 21:39:40 GMT
Received: by mail-client (4.1) id AA05261; Wed, 3 Jul 96 17:39:39 EDT
Cc: Leeman Strout <leeman@redrose.net>, CircleMUD <circle@pvv.ntnu.no>,jelson@pvv.ntnu.no
Sender: owner-circle@pvv.ntnu.no
Precedence: bulk

> On Wed, 3 Jul 1996, Leeman Strout wrote:
> > In the slave.c file that Jeremy sent across the list, there's a function 
> > called bcopy()... and well, aside from not having my references with me, 
> > I can't seem to figure out whether that's standard C or not.  Also can't 
> > figure out what it's supposed to do.  Anyone looked at the code and have 
> > a clue to hand out?
> Here's the Linux man page on bcopy:

bcopy() is considered old and unportable.  Use memcpy() instead...



This archive was generated by hypermail 2b30 : 12/07/00 PST