Initialize Tizen 2.3
[external/nettle.git] / tools / misc.c
1 /* misc.c */
2
3 /* nettle, low-level cryptographics library
4  *
5  * Copyright (C) 2002, 2003 Niels Möller
6  *  
7  * The nettle library is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published by
9  * the Free Software Foundation; either version 2.1 of the License, or (at your
10  * option) any later version.
11  * 
12  * The nettle library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15  * License for more details.
16  * 
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the nettle library; see the file COPYING.LIB.  If not, write to
19  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA 02111-1307, USA.
21  */
22
23 #if HAVE_CONFIG_H
24 # include "config.h"
25 #endif
26
27 #include <stdarg.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30
31 #include "misc.h"
32
33 void
34 die(const char *format, ...)
35 {
36   va_list args;
37   va_start(args, format);
38   vfprintf(stderr, format, args);
39   va_end(args);
40
41   exit(EXIT_FAILURE);
42 }
43
44 void
45 werror(const char *format, ...)
46 {
47   va_list args;
48   va_start(args, format);
49   vfprintf(stderr, format, args);
50   va_end(args);
51
52   exit(EXIT_FAILURE);
53 }
54
55 const char
56 sexp_token_chars[0x80] =
57   {
58     /* 0, ... 0x1f */
59     0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
60     0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
61 /* SPC ! " # $ % & ' ( ) * + , - . / */
62     0,0,0,0,0,0,0,0, 0,0,1,1,0,1,1,1,
63  /* 0 1 2 3 4 5 6 7  8 9 : ; < = > ? */
64     1,1,1,1,1,1,1,1, 1,1,1,0,0,1,0,0,
65     /* @ A ... O */
66     0,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,   
67     /* P ...             Z [ \ ] ^ _ */
68     1,1,1,1,1,1,1,1, 1,1,1,0,0,0,0,1,
69     /* ` a, ... o */
70     0,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,   
71     /* p ...             z { | } ~ DEL */
72     1,1,1,1,1,1,1,1, 1,1,1,0,0,0,0,0,
73   };