Skip to content
Snippets Groups Projects
Select Git revision
  • 1989e827df834d89c4f20c90756aee02d8debc33
  • master default protected
  • streebog
  • gost28147
  • master-updates
  • ed448
  • shake256
  • curve448
  • ecc-sqrt
  • gosthash94cp
  • cmac64
  • block16-refactor
  • siv-mode
  • cmac-layout
  • delete-des-compat
  • delete-rsa_blind
  • aes-struct-layout
  • release-3.4-fixes
  • struct-layout
  • attribute-deprecated
  • rename-data-symbols
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
  • nettle_3.5rc1
  • nettle_3.4.1_release_20181204
  • nettle_3.4.1rc1
  • nettle_3.4_release_20171119
  • nettle_3.4rc2
  • nettle_3.4rc1
  • nettle_3.3_release_20161001
  • nettle_3.2_release_20160128
  • nettle_3.1.1_release_20150424
  • nettle_3.1_release_20150407
  • nettle_3.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
  • nettle_2.7.1_release_20130528
  • nettle_2.7_release_20130424
  • nettle_2.6_release_20130116
  • nettle_2.5_release_20120707
41 results

md2.h

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    • Niels Möller's avatar
      121313f4
      * nettle-types.h: New (generated) file, to be used instead of including · 121313f4
      Niels Möller authored
      <inttypes.h> directly. Updated all users of inttypes.h.
      
      Rev: src/nettle/aes.h:1.7
      Rev: src/nettle/aesdata.c:1.3
      Rev: src/nettle/arcfour.h:1.5
      Rev: src/nettle/base16.h:1.3
      Rev: src/nettle/base64.h:1.14
      Rev: src/nettle/bignum.h:1.8
      Rev: src/nettle/blowfish.h:1.9
      Rev: src/nettle/cast128.h:1.5
      Rev: src/nettle/cbc.h:1.5
      Rev: src/nettle/des.h:1.9
      Rev: src/nettle/dsa.h:1.9
      Rev: src/nettle/knuth-lfib.h:1.3
      Rev: src/nettle/md2.h:1.3
      Rev: src/nettle/md4.h:1.3
      Rev: src/nettle/md5.h:1.7
      Rev: src/nettle/memxor.h:1.3
      Rev: src/nettle/nettle-meta.h:1.11
      Rev: src/nettle/pkcs1.h:1.3
      Rev: src/nettle/realloc.h:1.2
      Rev: src/nettle/rsa.h:1.24
      Rev: src/nettle/serpent.h:1.7
      Rev: src/nettle/sexp.h:1.16
      Rev: src/nettle/sha.h:1.4
      Rev: src/nettle/twofish.h:1.6
      121313f4
      History
      * nettle-types.h: New (generated) file, to be used instead of including
      Niels Möller authored
      <inttypes.h> directly. Updated all users of inttypes.h.
      
      Rev: src/nettle/aes.h:1.7
      Rev: src/nettle/aesdata.c:1.3
      Rev: src/nettle/arcfour.h:1.5
      Rev: src/nettle/base16.h:1.3
      Rev: src/nettle/base64.h:1.14
      Rev: src/nettle/bignum.h:1.8
      Rev: src/nettle/blowfish.h:1.9
      Rev: src/nettle/cast128.h:1.5
      Rev: src/nettle/cbc.h:1.5
      Rev: src/nettle/des.h:1.9
      Rev: src/nettle/dsa.h:1.9
      Rev: src/nettle/knuth-lfib.h:1.3
      Rev: src/nettle/md2.h:1.3
      Rev: src/nettle/md4.h:1.3
      Rev: src/nettle/md5.h:1.7
      Rev: src/nettle/memxor.h:1.3
      Rev: src/nettle/nettle-meta.h:1.11
      Rev: src/nettle/pkcs1.h:1.3
      Rev: src/nettle/realloc.h:1.2
      Rev: src/nettle/rsa.h:1.24
      Rev: src/nettle/serpent.h:1.7
      Rev: src/nettle/sexp.h:1.16
      Rev: src/nettle/sha.h:1.4
      Rev: src/nettle/twofish.h:1.6
    main.c 4.01 KiB
    /*\
    ||| This file a part of uLPC, and is copyright by Fredrik Hubinette
    ||| uLPC is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    #include <stdio.h>
    #include <stdlib.h>
    #include "global.h"
    #include "types.h"
    
    #ifdef HAVE_SYS_TIME_H
    #include <sys/time.h>
    #endif
    
    #include "backend.h"
    #include "module.h"
    #include "object.h"
    #include "lex.h"
    #include "lpc_types.h"
    #include "builtin_efuns.h"
    #include "array.h"
    #include "stralloc.h"
    #include "interpret.h"
    #include "error.h"
    #include "macros.h"
    #include "callback.h"
    #include "lpc_signal.h"
    
    #ifdef HAVE_LOCALE_H
    #include <locale.h>
    #endif
    #ifdef HAVE_SYS_RESOURCE_H
    #include <sys/resource.h>
    #endif
    
    char *master_file;
    
    int d_flag=0;
    int c_flag=0;
    int t_flag=0;
    int a_flag=0;
    int l_flag=0;
    
    static struct callback_list *post_master_callbacks =0;
    
    struct callback_list *add_post_master_callback(struct array *a)
    {
      return add_to_callback_list(&post_master_callbacks, a);
    }
    
    
    void main(int argc, char **argv, char **env)
    {
      JMP_BUF back;
      int e, num;
      char *p;
      struct array *a;
    
    #ifdef HAVE_SETLOCALE
      setlocale(LC_ALL, "");
    #endif  
      init_backend();
      master_file = 0;
    #ifdef HAVE_GETENV
      master_file = getenv("LPC_MASTER");
    #endif
      if(!master_file) master_file = DEFAULT_MASTER;
    
      for(e=1; e<argc; e++)
      {
        if(argv[e][0]=='-')
        {
          for(p=argv[e]+1; *p;)
          {
    	switch(*p)
    	{
    	case 'D':
    	  add_predefine(p+1);
    	  p+=strlen(p);
    	  break;
    	  
    	case 'm':
    	  if(p[1])
    	  {
    	    master_file=p+1;
    	    p+=strlen(p);
    	  }else{
    	    e++;
    	    if(e >= argc)
    	    {
    	      fprintf(stderr,"Missing argument to -m\n");
    	      exit(1);
    	    }
    	    master_file=argv[e];
    	    p+=strlen(p);
    	  }
    	  break;
    
    	case 'd':
    	  if(p[1]>='0' && p[1]<='9')
    	    d_flag+=STRTOL(p+1,&p,10);
    	  else
    	    d_flag++,p++;
    	  break;
    
    	case 'a':
    	  if(p[1]>='0' && p[1]<='9')
    	    a_flag+=STRTOL(p+1,&p,10);
    	  else
    	    a_flag++,p++;
    	  break;
    
    	case 't':
    	  if(p[1]>='0' && p[1]<='9')
    	    t_flag+=STRTOL(p+1,&p,10);
    	  else
    	    t_flag++,p++;
    	  break;
    
    	case 'l':
    	  if(p[1]>='0' && p[1]<='9')
    	    l_flag+=STRTOL(p+1,&p,10);
    	  else
    	    l_flag++,p++;
    	  break;
    
    	default:
    	  fprintf(stderr,"Uknown flag '%c'\n",*p);
    	  exit(1);
    	}
          }
        }else{
          break;
        }
      }
    
    #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE)
    #define RLIMIT_NOFILE RLIMIT_OFILE
    #endif
    #ifndef RLIM_INFINITY 
    #define RLIM_INFINITY 0x7fffffff
    #endif
    
    #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
      {
        struct rlimit lim;
        long tmp;
        if(!getrlimit(RLIMIT_NOFILE, &lim))
        {
          if(lim.rlim_max == RLIM_INFINITY) tmp=0x7fffffff;
          tmp=MINIMUM(lim.rlim_max, MAX_OPEN_FILEDESCRIPTORS);
          lim.rlim_cur=tmp;
          setrlimit(RLIMIT_NOFILE, &lim);
        }
      }
    #endif
    
      current_time = get_current_time();
    
      init_modules_efuns();
      master();
      call_and_free_callback_list(& post_master_callbacks);
      init_modules_programs();
    
      a=allocate_array_no_init(argc-e,0,T_STRING);
      for(num=0;e<argc;e++)
        SHORT_ITEM(a)[num++].string=make_shared_string(argv[e]);
      push_array(a);
    
      for(num=0;env[num];num++);
      a=allocate_array_no_init(num,0,T_STRING);
      for(num=0;env[num];num++)
        SHORT_ITEM(a)[num].string=make_shared_string(env[num]);
      push_array(a);
    
      if(SETJMP(back))
      {
        automatic_fatal="Error in handle_error, previous error (in _main): ";
        assign_svalue_no_free(sp++, & throw_value);
        APPLY_MASTER("handle_error", 1);
        pop_stack();
        exit(10);
      }
    
      apply(master(),"_main",2);
      pop_stack();
    
      UNSETJMP(back);
    
      backend();
    
      push_int(0);
      f_exit(1);
    }
    
    
    void init_main_efuns()
    {
      init_lex();
      init_types();
      init_builtin_efuns();
      init_signals();
    }
    
    void init_main_programs()
    {
    }
    
    
    void exit_main()
    {
      void cleanup_added_efuns();
      void free_all_call_outs();
      void cleanup_lpc_types();
      void cleanup_program();
    
      automatic_fatal="uLPC is exiting: ";
      exit_signals();
      exit_lex();
      cleanup_objects();
      cleanup_interpret();
      cleanup_added_efuns();
      free_all_call_outs();
      cleanup_lpc_types();
      cleanup_shared_string_table();
      cleanup_program();
    }