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.17 2004/02/21 02:35:42 nilsson Exp $"); + RCSID("$Id: hash.cmod,v 1.18 2004/02/21 18:36:06 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"   
pike.git/src/post_modules/Nettle/hash.cmod:118:    /* FIXME: Create should copy state from the other object, if    * provided. */       /*! @decl HashState update(string data)    *!    *! Hashes more data.    */    PIKEFUN object update(string data)    optflags OPT_SIDE_EFFECT;    { +  const void *ctx = THIS->ctx;    const struct nettle_hash *meta =    GET_META(Pike_fp->current_object);    -  if (!THIS->ctx || !meta) +  if (!ctx || !meta)    Pike_error("HashState not properly initialized.\n");       NO_WIDE_STRING(data);    THREADS_ALLOW(); -  meta->update(THIS->ctx, data->len, data->str); +  meta->update(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