2 # Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
16 my $PUNCTUATION = 0x0200;
22 my $FCOMMENT = 0x0800;
31 $c = sprintf("%c", $_);
33 $v |= $NUMBER if $c =~ /[0-9]/;
34 $v |= $UPPER if $c =~ /[A-Z]/;
35 $v |= $LOWER if $c =~ /[a-z]/;
36 $v |= $UNDER if $c =~ /_/;
37 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
38 $v |= $WS if $c =~ /[ \t\r\n]/;
39 $v |= $ESC if $c =~ /\\/;
40 $v |= $QUOTE if $c =~ /['`"]/; # for emacs: "`'
41 $v |= $COMMENT if $c =~ /\#/;
42 $v |= $EOF if $c =~ /\0/;
43 $v |= $HIGHBIT if $c =~ /[\x80-\xff]/;
47 $v |= $NUMBER if $c =~ /[0-9]/;
48 $v |= $UPPER if $c =~ /[A-Z]/;
49 $v |= $LOWER if $c =~ /[a-z]/;
50 $v |= $UNDER if $c =~ /_/;
51 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
52 $v |= $WS if $c =~ /[ \t\r\n]/;
53 $v |= $DQUOTE if $c =~ /["]/; # for emacs: "
54 $v |= $FCOMMENT if $c =~ /;/;
55 $v |= $EOF if $c =~ /\0/;
56 $v |= $HIGHBIT if $c =~ /[\x80-\xff]/;
60 # Output year depends on the year of the script.
61 my $YEAR = [localtime([stat($0)]->[9])]->[5] + 1900;
65 * WARNING: do not edit!
66 * Generated by crypto/conf/keysets.pl
68 * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
69 * Licensed under the OpenSSL license (the "License"). You may not use
70 * this file except in compliance with the License. You can obtain a copy
71 * in the file LICENSE in the source distribution or at
72 * https://www.openssl.org/source/license.html
75 #define CONF_NUMBER $NUMBER
76 #define CONF_UPPER $UPPER
77 #define CONF_LOWER $LOWER
78 #define CONF_UNDER $UNDER
79 #define CONF_PUNCT $PUNCTUATION
82 #define CONF_QUOTE $QUOTE
83 #define CONF_DQUOTE $DQUOTE
84 #define CONF_COMMENT $COMMENT
85 #define CONF_FCOMMENT $FCOMMENT
87 #define CONF_HIGHBIT $HIGHBIT
88 #define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
89 #define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
90 #define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
92 #define KEYTYPES(c) ((const unsigned short *)((c)->meth_data))
94 #ifndef CHARSET_EBCDIC
95 # define CVT(a) ((a) & 0xFF)
97 # define CVT(a) os_toascci[(a) & 0FF]
100 #define IS_COMMENT(c,a) (KEYTYPES(c)[CVT(a)] & CONF_COMMENT)
101 #define IS_FCOMMENT(c,a) (KEYTYPES(c)[CVT(a)] & CONF_FCOMMENT)
102 #define IS_EOF(c,a) (KEYTYPES(c)[CVT(a)] & CONF_EOF)
103 #define IS_ESC(c,a) (KEYTYPES(c)[CVT(a)] & CONF_ESC)
104 #define IS_NUMBER(c,a) (KEYTYPES(c)[CVT(a)] & CONF_NUMBER)
105 #define IS_WS(c,a) (KEYTYPES(c)[CVT(a)] & CONF_WS)
106 #define IS_ALNUM(c,a) (KEYTYPES(c)[CVT(a)] & CONF_ALNUM)
107 #define IS_ALNUM_PUNCT(c,a) (KEYTYPES(c)[CVT(a)] & CONF_ALNUM_PUNCT)
108 #define IS_QUOTE(c,a) (KEYTYPES(c)[CVT(a)] & CONF_QUOTE)
109 #define IS_DQUOTE(c,a) (KEYTYPES(c)[CVT(a)] & CONF_DQUOTE)
110 #define IS_HIGHBIT(c,a) (KEYTYPES(c)[CVT(a)] & CONF_HIGHBIT)
116 print "static const unsigned short CONF_type_default[256] = {";
117 for ($i = 0; $i < 256; $i++) {
118 print "\n " if ($i % 8) == 0;
119 printf " 0x%04X,", $V_def[$i];
123 print "static const unsigned short CONF_type_win32[256] = {";
124 for ($i = 0; $i < 256; $i++) {
125 print "\n " if ($i % 8) == 0;
126 printf " 0x%04X,", $V_w32[$i];