pike.git / src / post_modules / Nettle / hash.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/hash.cmod:1:   /* hash.cmod -*- c -*- */      #include "global.h" - RCSID("$Id: hash.cmod,v 1.16 2004/02/14 02:54:57 nilsson Exp $"); + RCSID("$Id: hash.cmod,v 1.17 2004/02/21 02:35:42 nilsson Exp $");   #include "interpret.h"   #include "svalue.h" -  + #include "threads.h"      /* For this_object() */   #include "object.h"   #include "module_support.h"      #include "nettle_config.h"      #ifdef HAVE_LIBNETTLE      #include "nettle.h"
pike.git/src/post_modules/Nettle/hash.cmod:124:    PIKEFUN object update(string data)    optflags OPT_SIDE_EFFECT;    {    const struct nettle_hash *meta =    GET_META(Pike_fp->current_object);       if (!THIS->ctx || !meta)    Pike_error("HashState not properly initialized.\n");       NO_WIDE_STRING(data); +  THREADS_ALLOW();    meta->update(THIS->ctx, data->len, data->str); -  +  THREADS_DISALLOW();       push_object(this_object());    }       /*! @decl string digest(int|void length)    *!    *! Generates a digests, and resets the hashing contents.    *!    *! @param length    *! If the length argument is provided, the digest is truncated