From 042e43247f396a9000fead59d9bff87bf12806d6 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 30 Oct 2024 01:51:14 +0100 Subject: Completely revamp the grab source code Some of the (many) few changes are: - Multithreading for significantly faster performance - The -p/--predicate flag - Byte offsets as the default - No customizable colors (maybe this will come back later) - Newer edition of mlib (formerly librune) --- vendor/librune/gen/gbrk | 114 ------------------------------------- vendor/librune/gen/mkfile | 37 ------------ vendor/librune/gen/rtype-cat | 104 ---------------------------------- vendor/librune/gen/rtype-prop | 116 -------------------------------------- vendor/librune/gen/rtype-prop.awk | 61 -------------------- 5 files changed, 432 deletions(-) delete mode 100755 vendor/librune/gen/gbrk delete mode 100755 vendor/librune/gen/mkfile delete mode 100755 vendor/librune/gen/rtype-cat delete mode 100755 vendor/librune/gen/rtype-prop delete mode 100644 vendor/librune/gen/rtype-prop.awk (limited to 'vendor/librune/gen') diff --git a/vendor/librune/gen/gbrk b/vendor/librune/gen/gbrk deleted file mode 100755 index 1146327..0000000 --- a/vendor/librune/gen/gbrk +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh - -cache() -{ - name="/tmp/librune/gbrk/$(basename "$1")" - if test ! -f "$name" - then - mkdir -p /tmp/librune/gbrk - wget -q "$1" -O "$name" - fi -} - -set -e -cd "${0%/*}/.." -exec >include/internal/gbrk_lookup.h - -readonly URL1='https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt' -readonly URL2='https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt' -readonly URL3='https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt' - -cache "$URL1" & -cache "$URL2" & -cache "$URL3" & -wait - -cat <Makefile - -cat <&2 -make diff --git a/vendor/librune/gen/rtype-cat b/vendor/librune/gen/rtype-cat deleted file mode 100755 index e35fb77..0000000 --- a/vendor/librune/gen/rtype-cat +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh - -cache() -{ - name="/tmp/librune/rtype/$(basename "$1")" - if test ! -f "$name" - then - mkdir -p /tmp/librune/rtype - wget -q "$1" -O "$name" - fi -} - -set -e -cd "${0%/*}/.." -exec >include/internal/rtype/cat.h - -readonly URL='https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt' -cache "$URL" - -cat <&2 - - gawk -M -v prop=$prop -f gen/rtype-prop.awk \ - /tmp/librune/rtype/PropList.txt \ - >lib/rtype/rune_has_prop_$lprop.c - - echo "[[unsequenced]] bool rune_has_prop_$lprop(rune);" - echo ' DONE' >&2 - done - - for prop in $props2 - do - lprop=$(echo $prop | tr A-Z a-z) - - printf 'rune_has_prop_%s…' $lprop >&2 - - gawk -M -v prop=$prop -f gen/rtype-prop.awk \ - /tmp/librune/rtype/DerivedCoreProperties.txt \ - >lib/rtype/rune_has_prop_$lprop.c - - echo "[[unsequenced]] bool rune_has_prop_$lprop(rune);" - echo ' DONE' >&2 - done -} | gawk ' - /PROP PREDICATES END/ { no = 0 } - FILENAME != "-" && !no { print } - FILENAME == "-" { funcs[++i] = $0 } - - /PROP PREDICATES START/ { - no = 1 - asort(funcs) - for (i = 1; i <= length(funcs); i++) - print funcs[i] - } -' - include/rtype.h \ -| sponge include/rtype.h diff --git a/vendor/librune/gen/rtype-prop.awk b/vendor/librune/gen/rtype-prop.awk deleted file mode 100644 index 59b4a99..0000000 --- a/vendor/librune/gen/rtype-prop.awk +++ /dev/null @@ -1,61 +0,0 @@ -BEGIN { - FS = "( *#.*| +; +)" - - print "/* This file is autogenerated by gen/rtype-prop; DO NOT EDIT. */" - print "" - print "#include \"rtype.h\"" - print "" - print "#include \"internal/common.h\"" - print "" -} - -$2 == prop || (prop == "Indic_Conjunct_Break" && $2 ~ /InCB;/) { - n = split($1, a, /\.\./) - lo = strtonum("0x" a[1]) - hi = strtonum("0x" a[n]) - - for (i = lo; i <= hi; i++) - xs[i] = 1 -} - -END { - for (i = 0; i <= 0xFF; i++) { - if (xs[i]) - mask = or(mask, lshift(1, i)) - } - print "#if BIT_LOOKUP" - printf "static const unsigned _BitInt(LATIN1_MAX + 1) mask = 0x%Xuwb;\n", \ - mask - print "#endif" - print "" - print "static const struct {" - print "\trune lo, hi;" - print "} lookup_tbl[] = {" - - for (i = 0; i <= 0x10FFFF; i++) { - if (!xs[i]) - continue - lo = i - while (xs[i + 1]) - i++ - printf "\t{0x%06X, 0x%06X},\n", lo, i - } - - print "};" - print "" - print "#define TYPE bool" - print "#define TABLE lookup_tbl" - print "#define DEFAULT false" - print "#define HAS_VALUE 0" - print "#include \"internal/rtype/lookup-func.h\"" - print "" - print "bool" - printf "rune_has_prop_%s(rune ch)\n", tolower(prop) - print "{" - print "\treturn" - print "#if BIT_LOOKUP" - print "\t\tch <= LATIN1_MAX ? (mask & ch) :" - print "#endif" - print "\t\tlookup(ch);" - print "}" -} -- cgit v1.2.3