Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

camellia-set-encrypt-key.c

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    error.c 10.72 KiB
    /*\
    ||| This file a part of Pike, and is copyright by Fredrik Hubinette
    ||| Pike is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    /**/
    #include "global.h"
    #include "pike_macros.h"
    #include "error.h"
    #include "interpret.h"
    #include "stralloc.h"
    #include "builtin_functions.h"
    #include "array.h"
    #include "object.h"
    #include "main.h"
    #include "builtin_functions.h"
    #include "backend.h"
    #include "operators.h"
    #include "module_support.h"
    #include "threads.h"
    
    RCSID("$Id: error.c,v 1.39 1999/10/06 15:30:05 grubba Exp $");
    
    #undef ATTRIBUTE
    #define ATTRIBUTE(X)
    
    JMP_BUF *recoveries=0;
    
    #ifdef PIKE_DEBUG
    void check_recovery_context(void)
    {
      char foo;
    #define TESTILITEST ((((char *)recoveries)-((char *)&foo))*STACK_DIRECTION)
      if(recoveries && TESTILITEST > 0)
        fatal("Recoveries is out biking (recoveries=%p, sp=%p, %d)!\n",recoveries, &foo,TESTILITEST);
    
      /* Add more stuff here when required */
    }
    #endif
    
    JMP_BUF *init_recovery(JMP_BUF *r DEBUG_LINE_ARGS)
    {
      check_recovery_context();
    #ifdef PIKE_DEBUG
      r->line=line;
      r->file=file;
      OED_FPRINTF((stderr, "init_recovery(%p) %s:%d\n", r, file, line));
    #endif
      r->fp=fp;
      r->sp=sp-evaluator_stack;
      r->mark_sp=mark_sp - mark_stack;
      r->previous=recoveries;
      r->onerror=0;
      r->severity=THROW_ERROR;
      recoveries=r;
      check_recovery_context();
      return r;
    }
    
    void pike_throw(void) ATTRIBUTE((noreturn))
    {
      while(recoveries && throw_severity > recoveries->severity)
      {
        while(recoveries->onerror)
        {
          (*recoveries->onerror->func)(recoveries->onerror->arg);
          recoveries->onerror=recoveries->onerror->previous;
        }
        
        recoveries=recoveries->previous;