From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 usergrps/uktug/baskervi/5_5/hhqueue.sty | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 usergrps/uktug/baskervi/5_5/hhqueue.sty

(limited to 'usergrps/uktug/baskervi/5_5/hhqueue.sty')

diff --git a/usergrps/uktug/baskervi/5_5/hhqueue.sty b/usergrps/uktug/baskervi/5_5/hhqueue.sty
new file mode 100644
index 0000000000..8adc2e076b
--- /dev/null
+++ b/usergrps/uktug/baskervi/5_5/hhqueue.sty
@@ -0,0 +1,62 @@
+% QUEUE MACROS for LaTeX2e, version 1.01,
+% written by Herman Haverkort, 14 february 1995
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hhqueue}[1995/02/14]
+
+% The \h@@@getfirst and \h@@@enqueue macro's which are defined below are
+% modifications of \lop and \rightappenditem which are found in
+% Computers & Typesetting by Donald Knuth. The representation of queues
+% and lists is like his.
+
+\newtoks\@temptokenb
+
+\def\h@getfirst#1{\expandafter\h@@getfirst\csname #1\endcsname}
+\def\h@@getfirst#1#2{%
+  \expandafter\h@@@getfirst\expandafter #1\csname hq@#2\endcsname}
+\def\h@@@getfirst#1#2{\expandafter\h@@@@getfirst #2\h@qend#2#1}
+\def\h@@@@getfirst\\#1#2\h@qend#3#4{\gdef#4{#1}\gdef#3{#2}}
+
+\def\h@delete#1{\expandafter\h@@delete\csname #1\endcsname}
+\def\h@@delete#1#2{%
+  \expandafter \expandafter
+  \expandafter \h@@@delete
+  \expandafter \expandafter
+  \expandafter {%
+  \expandafter #1%
+  \expandafter }%
+  \csname hq@#2\endcsname}
+\def\h@@@delete#1#2{{%
+  \let\tempa=#2%
+  \def\tempb{#1}%
+  \h@@@initqueue#2{}%
+  \def\\##1{\def\tempc{##1}\ifx\tempb\tempc\else\h@@@enqueue{##1}#2\fi}%
+  \tempa}}
+% Some rather tricky macro which is said to be efficient can be found
+% in the TeXbook by Donald Knuth, appendix D, section 2.
+
+\def\h@enqueue#1{\expandafter\h@@enqueue\csname #1\endcsname}
+\def\h@@enqueue#1#2{%
+  \expandafter \expandafter
+  \expandafter \h@@@enqueue
+  \expandafter \expandafter
+  \expandafter {%
+  \expandafter #1%
+  \expandafter }%
+  \csname hq@#2\endcsname}
+\def\h@@@enqueue#1#2{%
+  \@temptokena=\expandafter{#2}%
+  \@temptokenb={\\{#1}}%
+  \xdef#2{\the\@temptokena\the\@temptokenb}}
+
+\def\h@ifqempty#1{\expandafter\h@@@ifqempty\csname hq@#1\endcsname}
+\def\h@@@ifqempty#1#2#3{\ifx#1\@empty#2\else#3\fi}
+
+\def\h@ifqnonempty#1{\expandafter\h@@@ifqnonempty\csname hq@#1\endcsname}
+\def\h@@@ifqnonempty#1#2{\ifx#1\@empty\else#2\fi}
+
+\def\h@initqueue#1{\expandafter\h@@@initqueue\csname hq@#1\endcsname}
+\def\h@@@initqueue#1{\gdef#1}
+
+\def\h@processq#1{\@nameuse{hq@#1}}
+
-- 
cgit v1.2.3

