summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-con.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2004-06-10 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2004-06-10 00:00:00 +0200
commit51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725 (patch)
treea902c3c67fe2272ee9e2325d6a6f28f0fd15d9d8 /tex/context/base/syst-con.tex
parentab3f887feadf929129087cd2cbc3783064507565 (diff)
downloadcontext-51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725.tar.gz
stable 2004.06.10
Diffstat (limited to 'tex/context/base/syst-con.tex')
-rw-r--r--tex/context/base/syst-con.tex30
1 files changed, 27 insertions, 3 deletions
diff --git a/tex/context/base/syst-con.tex b/tex/context/base/syst-con.tex
index 0ce6ea579..473be7a9f 100644
--- a/tex/context/base/syst-con.tex
+++ b/tex/context/base/syst-con.tex
@@ -20,6 +20,8 @@
%D defining these in \type {font-ini}, we now have a dedicated
%D module.
+\catcode127=12 % \@@letter
+
%D \macros
%D {lchexnumber,uchexnumber,lchexnumbers,uchexnumbers}
%D
@@ -30,7 +32,7 @@
%D The ugly indirectness is needed to get rid of \TEX\
%D induced spaces and \type {\relax}'s.
%D
-%D \starttypen
+%D \starttyping
%D [\uchexnumber{0}]
%D [\uchexnumber\scratchcounter]
%D [\uchexnumber\zerocount]
@@ -44,7 +46,7 @@
%D [\expandafter\uchexnumber\expandafter{\number\zerocount}]
%D [\expandafter\uchexnumber\expandafter{\the\scratchcounter}]
%D [\expandafter\uchexnumber\expandafter{\the\zerocount}]
-%D \stoptypen
+%D \stoptyping
\def\lchexnumber#1%
{\@EA\dolchexnumber\number#1\relax}
@@ -150,6 +152,28 @@
370\or 371\or 372\or 373\or 374\or 375\or 376\or 377\fi}
%D \macros
+%D {hexstringtonumber}
+%D
+%D This macro converts a two character hexadecimal number into
+%D a decimal number, thereby taking care of lowercase characters
+%D as well.
+
+\dostepwiserecurse{0}{9}{1}{\setevalue{@@uc@@\recurselevel}{\recurselevel}}
+
+\setvalue{@@uc@@a}{A} \setvalue{@@uc@@A}{A}
+\setvalue{@@uc@@b}{B} \setvalue{@@uc@@B}{B}
+\setvalue{@@uc@@c}{C} \setvalue{@@uc@@C}{C}
+\setvalue{@@uc@@d}{D} \setvalue{@@uc@@D}{D}
+\setvalue{@@uc@@e}{E} \setvalue{@@uc@@E}{E}
+\setvalue{@@uc@@f}{F} \setvalue{@@uc@@F}{F}
+
+\def\hexstringtonumber#1% {FF}
+ {\dohexstringtonumber#1}
+
+\def\dohexstringtonumber#1#2% FF
+ {"\csname @@uc@@#1\endcsname\csname @@uc@@#2\endcsname}
+
+%D \macros
%D {rawcharacter}
%D
%D This conversion macro produces raw characters. We have to
@@ -175,4 +199,4 @@
\egroup
-\protect \endinput \ No newline at end of file
+\protect \endinput