From 421d796e9b462939de9e9e116e09e9384a8ba5bc Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 22 Jun 2020 10:49:34 +0100 Subject: split tools and utils --- utils/idna-derived-props-gen.pl | 182 ---------------------------------------- 1 file changed, 182 deletions(-) delete mode 100644 utils/idna-derived-props-gen.pl (limited to 'utils/idna-derived-props-gen.pl') diff --git a/utils/idna-derived-props-gen.pl b/utils/idna-derived-props-gen.pl deleted file mode 100644 index a9e9b4b53..000000000 --- a/utils/idna-derived-props-gen.pl +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/perl -# -# Copyright 2014 Chris Young -# -# This file is part of NetSurf, http://www.netsurf-browser.org/ -# -# NetSurf is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# NetSurf is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -use strict; - -use Getopt::Long (); -use Fcntl qw( O_CREAT O_EXCL O_WRONLY O_APPEND O_RDONLY O_WRONLY ); - -use constant GETOPT_OPTS => qw( auto_abbrev no_getopt_compat bundling ); -use constant GETOPT_SPEC => - qw( output|o=s - properties|p=s - joining|j=s - help|h|? ); - -# default option values: -my %opt = qw(properties "idna-tables-properties.csv" joining "DerivedJoiningType.txt"); - -sub usage -{ - my @fmt = map { s/::$//; $_ } keys(%{$::{'msgfmt::'}}); - print(STDERR <; # discard header line - - while($line = <$properties>) { - my @items = split(/\,/, $line); - my @codepoints = split(/-/, $items[0]); - if($#codepoints == 0) { - $codepoints[1] = $codepoints[0]; - } - print { $output } "\t{ 0x" . $codepoints[0] . ", 0x" . $codepoints[1] . ", .p.property = IDNA_P_" . $items[1] . " },\n"; - } - - close($properties); - - print { $output } <) { - chop($line); - if(substr($line, 0, 1) eq '#') {next;} - if(length($line) == 0) {next;} - my @items = split(/;/, $line); - my @codepoints = split(/\./, $items[0]); - if($#codepoints == 0) { - $codepoints[2] = $codepoints[0]; - } - print { $output } "\t{ 0x" . $codepoints[0] . ", 0x" . $codepoints[2] . ", .p.jt = IDNA_UNICODE_JT_" . substr($items[1], 1, 1) . " },\n"; - } - - close($joining); - - print { $output } <