Refresh seldom used C generating scripts to current C standard
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
eb334f73a8
commit
f5d3117d4e
2 changed files with 67 additions and 63 deletions
|
@ -76,17 +76,19 @@ $arr[ord("?")] |= $PSTRING_CHAR;
|
|||
# Now generate the C code
|
||||
|
||||
print <<EOF;
|
||||
/* Auto generated with chartype.pl script.
|
||||
* Mask of various character properties
|
||||
/*
|
||||
* Auto generated with chartype.pl script. Mask of various character
|
||||
* properties
|
||||
*/
|
||||
|
||||
static unsigned short char_type[] = {
|
||||
static const unsigned short char_type[] = {
|
||||
EOF
|
||||
|
||||
print " ";
|
||||
for($i = 0; $i < 128; $i++) {
|
||||
print("\n") if($i && (($i % 16) == 0));
|
||||
printf("%2d", $arr[$i]);
|
||||
print("\n ") if($i && (($i % 16) == 0));
|
||||
printf(" %d", $arr[$i]);
|
||||
print(",") if ($i != 127);
|
||||
}
|
||||
print("\n};\n\n");
|
||||
print("\n};\n");
|
||||
|
||||
|
|
|
@ -110,8 +110,10 @@ print <<"EOF";
|
|||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
/* THIS FILE WAS AUTOMAGICALLY GENERATED!
|
||||
Please modify and use keysets.pl to regenerate it. */
|
||||
/*
|
||||
* THIS FILE WAS AUTOMAGICALLY GENERATED! Please modify and use keysets.pl to
|
||||
* regenerate it.
|
||||
*/
|
||||
|
||||
#define CONF_NUMBER $NUMBER
|
||||
#define CONF_UPPER $UPPER
|
||||
|
@ -133,53 +135,53 @@ print <<"EOF";
|
|||
|
||||
#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
|
||||
#ifndef CHARSET_EBCDIC
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
|
||||
# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
|
||||
# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
|
||||
# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
|
||||
# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
|
||||
# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
|
||||
# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
|
||||
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
|
||||
# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
|
||||
# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
|
||||
# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
|
||||
|
||||
#else /*CHARSET_EBCDIC*/
|
||||
|
||||
#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
|
||||
#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
|
||||
#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
|
||||
#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
|
||||
#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
|
||||
#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
|
||||
#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
|
||||
#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT)
|
||||
# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT)
|
||||
# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF)
|
||||
# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC)
|
||||
# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER)
|
||||
# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS)
|
||||
# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC)
|
||||
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
||||
(KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
||||
#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
|
||||
#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
|
||||
#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
|
||||
# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE)
|
||||
# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE)
|
||||
# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT)
|
||||
#endif /*CHARSET_EBCDIC*/
|
||||
|
||||
EOF
|
||||
|
||||
print "static unsigned short CONF_type_default[256]={";
|
||||
print "static unsigned short CONF_type_default[256] = {";
|
||||
|
||||
for ($i=0; $i<256; $i++)
|
||||
{
|
||||
print "\n\t" if ($i % 8) == 0;
|
||||
printf "0x%04X,",$V_def[$i];
|
||||
print "\n " if ($i % 8) == 0;
|
||||
printf " 0x%04X,",$V_def[$i];
|
||||
}
|
||||
|
||||
print "\n\t};\n\n";
|
||||
print "\n};\n\n";
|
||||
|
||||
print "static unsigned short CONF_type_win32[256]={";
|
||||
print "static unsigned short CONF_type_win32[256] = {";
|
||||
|
||||
for ($i=0; $i<256; $i++)
|
||||
{
|
||||
print "\n\t" if ($i % 8) == 0;
|
||||
printf "0x%04X,",$V_w32[$i];
|
||||
print "\n " if ($i % 8) == 0;
|
||||
printf " 0x%04X,",$V_w32[$i];
|
||||
}
|
||||
|
||||
print "\n\t};\n\n";
|
||||
print "\n};\n";
|
||||
|
|
Loading…
Reference in a new issue