Skip to content
Snippets Groups Projects
Select Git revision
  • f2b218bcaba3b7d50cfbad1b1029c954c54a0df6
  • master default
  • wip-slh-dsa-sha2-128s
  • master-updates
  • release-3.10-fixes
  • getopt-prototype
  • fix-bcrypt-warning
  • refactor-hmac
  • wip-use-alignas
  • trim-sha3-context
  • fix-gitlab-ci
  • check-fat-emulate
  • delete-digest_func-size
  • slh-dsa-shake-128f-nettle
  • slh-dsa-shake-128s-nettle
  • slh-dsa-shake-128s
  • delete-openpgp
  • ppc64-sha512
  • delete-md5-compat
  • cleanup-hmac-tests
  • ppc64-sha256
  • nettle_3.10.2_release_20250626
  • nettle_3.10.1_release_20241230
  • nettle_3.10_release_20240616
  • nettle_3.10rc2
  • nettle_3.10rc1
  • nettle_3.9.1_release_20230601
  • nettle_3.9_release_20230514
  • nettle_3.8.1_release_20220727
  • nettle_3.8_release_20220602
  • nettle_3.7.3_release_20210606
  • nettle_3.7.2_release_20210321
  • nettle_3.7.1_release_20210217
  • nettle_3.7_release_20210104
  • nettle_3.7rc1
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
41 results

cbc.h

Blame
  • module.c 2.33 KiB
    /*
    || This file is part of Pike. For copyright information see COPYRIGHT.
    || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
    || for more information.
    || $Id: module.c,v 1.23 2003/04/02 19:17:50 nilsson Exp $
    */
    
    #include "global.h"
    #include "module.h"
    #include "pike_macros.h"
    #include "pike_error.h"
    #include "builtin_functions.h"
    #include "main.h"
    #include "svalue.h"
    #include "interpret.h"
    #include "stralloc.h"
    #include "object.h"
    #include "mapping.h"
    #include "program_id.h"
    #include "language.h"
    #include "lex.h"
    
    #include "modules/modlist_headers.h"
    #include "post_modules/modlist_headers.h"
    
    RCSID("$Id: module.c,v 1.23 2003/04/02 19:17:50 nilsson Exp $");
    
    /* Define this to trace the initialization and cleanup of static modules. */
    /* #define TRACE_MODULE */
    
    #if defined(TRACE_MAIN) || defined(TRACE_MODULE)
    #define TRACE(X)	fprintf X
    #else /* !TRACE_MAIN */
    #define TRACE(X)
    #endif /* TRACE_MAIN */
    
    typedef void (*modfun)(void);
    
    struct static_module
    {
      char *name;
      modfun init;
      modfun exit;
    };
    
    static struct static_module module_list[] = {
      { "Builtin", low_init_main, low_exit_main }
    #include "modules/modlist.h"
    #include "post_modules/modlist.h"
    };
    
    void init_modules(void)
    {
      struct program *p;
      unsigned int e;
      struct lex save_lex;
    
      save_lex = lex;
      lex.current_line=1;
      lex.current_file=make_shared_string("-");
    
      start_new_program();
      Pike_compiler->new_program->id=PROG___BUILTIN_ID;
    
      for(e=0;e<NELEM(module_list);e++)
      {
        JMP_BUF recovery;
        start_new_program();
        if(SETJMP(recovery)) {
          free_program(end_program());
          call_handle_error();
        } else {
          TRACE((stderr, "Initializing static module #%d: \"%s\"...\n",
    	     e, module_list[e].name));
          module_list[e].init();
          debug_end_class(module_list[e].name,strlen(module_list[e].name),0);
        }
        UNSETJMP(recovery);
      }
      push_text("_static_modules");
      push_object(low_clone(p=end_program()));
      f_add_constant(2);
      free_program(p);
      free_string(lex.current_file);
      lex = save_lex;
    
      init_main();
    }
    
    void exit_modules(void)
    {
      JMP_BUF recovery;
      int e;
    
      exit_main();
    
      for(e=NELEM(module_list)-1;e>=0;e--)
      {
        if(SETJMP(recovery))
          call_handle_error();
        else {
          TRACE((stderr, "Exiting static module #%d: \"%s\"...\n",
    	     e, module_list[e].name));
          module_list[e].exit();
        }
        UNSETJMP(recovery);
      }
    }