aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2005-12-29 15:33:21 -0800
committerH. Peter Anvin <hpa@zytor.com>2005-12-29 15:33:21 -0800
commitba6096e75175b3fed31f746fc5796ee1c6ced194 (patch)
treea5e007d9581ee945a4146d6b54e701fa78d488d5
parentf524b10750a5b36f2193f609083e53a80e6f23ed (diff)
downloadlibucd-ba6096e75175b3fed31f746fc5796ee1c6ced194.tar.gz
Missing file (script which creates ucdversion.c)
-rwxr-xr-xucdversion.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/ucdversion.pl b/ucdversion.pl
new file mode 100755
index 0000000..f618c8c
--- /dev/null
+++ b/ucdversion.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+open(UCDVERSION, '<', 'ucd/version') or die;
+$line = <UCDVERSION>;
+chomp $line;
+close(UCDVERSION);
+
+@v = split(/\./, $line);
+open(GV, '>', 'gen/ucdversion.c') or die;
+print GV "#include \"ucd.h\"\n";
+print GV "int unicode_database_version(void)\n";
+print GV "{\n";
+printf GV "\treturn 0x%x;\n", ($v[0] << 16)+($v[1] << 8)+$v[2];
+print GV "}\n";
+close(GV);