2005-10-05 Simon Josefsson <jas@extundo.com>
+ * modules/memxor: New file.
+
* modules/iconv (Files): Move config.rpath to havelib, it is used
there.
2005-10-05 Simon Josefsson <jas@extundo.com>
+ * memxor.h, memxor.c: New files.
+
* getaddrinfo.h: Don't protect sys/types.h with HAVE_SYS_TYPES_H,
we assume all systems have it, suggested by Jim Meyering
<jim@meyering.net>. Remove HAVE_SYS_SOCKET_H test too, to see if
--- /dev/null
+/* memxor.c -- perform binary exclusive OR operation of two memory blocks.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Written by Simon Josefsson. The interface was inspired by memxor
+ in Niels Möller's Nettle. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "memxor.h"
+
+void *
+memxor (void *restrict dest, const void *restrict src, size_t n)
+{
+ char *d = dest;
+
+ for (; n > 0; n--)
+ *d++ ^= *src++;
+
+ return dest;
+}
--- /dev/null
+/* memxor.h -- perform binary exclusive OR operation on memory blocks.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Written by Simon Josefsson. The interface was inspired by memxor
+ in Niels Möller's Nettle. */
+
+#ifndef MEMXOR_H
+# define MEMXOR_H
+
+#include <stddef.h>
+
+/* Compute binary exclusive OR of memory areas DEST and SRC, putting
+ the result in DEST, of length N bytes. Returns a pointer to
+ DEST. */
+void *memxor (void *restrict dest, const void *restrict src, size_t n);
+
+#endif /* MEMXOR_H */
+2005-10-05 Simon Josefsson <jas@extundo.com>
+
+ * memxor.m4: New file.
+
2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
Sync from coreutils.
--- /dev/null
+# memxor.m4 serial 1
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MEMXOR],
+[
+ AC_LIBSOURCES([memxor.h, memxor.c])
+ AC_LIBOBJ([memxor])
+])
--- /dev/null
+Description:
+memxor() function: binary exclusive or operation on two memory blocks
+
+Files:
+lib/memxor.h
+lib/memxor.c
+m4/memxor.m4
+
+Depends-on:
+restrict
+
+configure.ac:
+gl_MEMXOR
+
+Makefile.am:
+
+Include:
+"memxor.h"
+
+License:
+LGPL
+
+Maintainer:
+Simon Josefsson