Add some simple bitwise operations so that Perl can use them.
[u/mdw/catacomb] / mp.h
diff --git a/mp.h b/mp.h
index 5b54513..dcf4349 100644 (file)
--- a/mp.h
+++ b/mp.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: mp.h,v 1.10 2000/10/08 12:03:16 mdw Exp $
+ * $Id: mp.h,v 1.11 2001/04/03 19:36:05 mdw Exp $
  *
  * Simple multiprecision arithmetic
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: mp.h,v $
+ * Revision 1.11  2001/04/03 19:36:05  mdw
+ * Add some simple bitwise operations so that Perl can use them.
+ *
  * Revision 1.10  2000/10/08 12:03:16  mdw
  * Provide @mp_eq@ and @MP_EQ@ for rapidly testing equality of two
  * integers.
@@ -625,6 +628,19 @@ extern int mp_cmp(const mp */*a*/, const mp */*b*/);
 
 #define MP_CMP(a, op, b) (mp_cmp((a), (b)) op 0)
 
+/* --- @mpx_and@, @mpx_or@, @mpx_xor@, @mpx_not@ --- *
+ *
+ * Arguments:  @mp *d@ = destination
+ *             @mp *a, *b@ = sources
+ *
+ * Returns:    The result of the obvious bitwise operation.
+ */
+
+extern mp *mp_and(mp */*d*/, mp */*a*/, mp */*b*/);
+extern mp *mp_or(mp */*d*/, mp */*a*/, mp */*b*/);
+extern mp *mp_xor(mp */*d*/, mp */*a*/, mp */*b*/);
+extern mp *mp_not(mp */*d*/, mp */*a*/);
+
 /* --- @mp_add@ --- *
  *
  * Arguments:  @mp *d@ = destination