Add an internal-representation no-op function.
[u/mdw/catacomb] / dsarand.c
index 146a20f..4f12b98 100644 (file)
--- a/dsarand.c
+++ b/dsarand.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: dsarand.c,v 1.2 2000/06/17 10:54:00 mdw Exp $
+ * $Id: dsarand.c,v 1.3 2001/02/03 16:08:56 mdw Exp $
  *
  * Random number generator for DSA
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: dsarand.c,v $
+ * Revision 1.3  2001/02/03 16:08:56  mdw
+ * Give generic random objects separate namespaces for their supported misc
+ * ops.  Add operations for reading the current seed value.
+ *
  * Revision 1.2  2000/06/17 10:54:00  mdw
  * Typesetting fixes.  Arena support.
  *
@@ -277,6 +281,8 @@ static int gmisc(grand *r, unsigned op, ...)
        case GRAND_SEEDBLOCK:
        case GRAND_SEEDRAND:
        case DSARAND_PASSES:
+       case DSARAND_SEEDSZ:
+       case DSARAND_GETSEED:
          rc = 1;
          break;
        default:
@@ -296,6 +302,12 @@ static int gmisc(grand *r, unsigned op, ...)
     case DSARAND_PASSES:
       g->d.passes = va_arg(ap, unsigned);
       break;
+    case DSARAND_SEEDSZ:
+      rc = g->d.sz;
+      break;
+    case DSARAND_GETSEED:
+      memcpy(va_arg(ap, void *), g->d.p, g->d.sz);
+      break;
     default:
       GRAND_BADOP;
       break;