/* $Id: memfn.c,v 1.1 1994/02/03 04:10:27 tf Exp $ */

#ifndef lint
static char vcid[]= "$Id: memfn.c,v 1.1 1994/02/03 04:10:27 tf Exp $";
#endif /* lint */

#define DEF_BITWISE_MEM_FUNCTION( NAME, FUNC )  \
char *                                          \
NAME(to,from,n)                                 \
char *to, *from;                                \
unsigned n;                                     \
{                                               \
  for(;n;n--)                                   \
    *to++ FUNC *from++;                         \
                                                \
  return to;                                    \
}

DEF_BITWISE_MEM_FUNCTION(memand,&=)
DEF_BITWISE_MEM_FUNCTION(memor,|=)
DEF_BITWISE_MEM_FUNCTION(memandnot,&=~)

char *
memnot(to,n)
char *to;
unsigned n;
{
  for(;n;n--)
    *to++ ^= ~0L;

  return to;
}
