pike.git
/
src
/
post_modules
/
Nettle
/
nettle.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/nettle.cmod:1:
/* nettle.cmod -*- c -*- */
-
/* $Id: nettle.cmod,v 1.
38
2004/10/
07
22:
19
:
11
nilsson Exp $ */
+
/* $Id: nettle.cmod,v 1.
39
2004/10/
22
22:
42
:
10
nilsson Exp $ */
#include "global.h" #include "interpret.h" #include "svalue.h" /* For this_object() */ #include "object.h" #include "operators.h" #include "module_support.h" #include "threads.h"
pike.git/src/post_modules/Nettle/nettle.cmod:47:
CVAR struct yarrow_source *sources; /*! @decl void create(void|int sources) *! The number of entropy sources that will feed entropy to the *! random number generator is given as an argument to Yarrow *! during instantiation. *! @seealso *! @[update] */ PIKEFUN void create(void|int arg)
+
flags ID_STATIC;
{ INT32 num = 0; if(arg) { if (arg->type != PIKE_T_INT) Pike_error("Bad argument type.\n"); num = arg->u.integer; if(num < 0) Pike_error("Invalid number of sources.\n"); free (THIS->sources);
pike.git/src/post_modules/Nettle/nettle.cmod:807:
THIS->ctx = xalloc(sizeof(struct knuth_lfib_ctx)); } EXIT { free(THIS->ctx); } /* @decl void create(int seed) * The Lfib generator must be seeded with a number. */
-
PIKEFUN void create(int seed) {
+
PIKEFUN void create(int seed)
+
flags ID_STATIC;
+
{
knuth_lfib_init(THIS->ctx, seed); } /* @decl this_program reseed(int s) * Reseed this object with seed @[s]. * @return * Returns the current object. */ PIKEFUN object reseed(int s) { knuth_lfib_init(THIS->ctx, s);