Debian Codegraph @

texmf-dist/tex/generic/xkeyval/keyval.tex

raw
1 %%
2 %% This is file `keyval.tex',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% xkeyval.dtx (with options: `xkvkeyval')
8 %%
9 %% ---------------------------------------
10 %% Copyright (C) 2004-2022 Hendri Adriaens
11 %% 2025 David Carlisle for latex-package-repositories
12 %% ---------------------------------------
13 %%
14 %% This work may be distributed and/or modified under the
15 %% conditions of the LaTeX Project Public License, either version 1.3
16 %% of this license or (at your option) any later version.
17 %% The latest version of this license is in
18 %% http://www.latex-project.org/lppl.txt
19 %% and version 1.3 or later is part of all distributions of LaTeX
20 %% version 2003/12/01 or later.
21 %%
22 %% This work has the LPPL maintenance status "maintained".
23 %%
24 %% This Current Maintainer of this work is Hendri Adriaens.
25 %%
26 %% This work consists of the file xkeyval.dtx and derived files
27 %% keyval.tex, xkvtxhdr.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
28 %% xkvltxp.sty, xkvutils.tex, pst-xkey.tex, pst-xkey.sty, xkveca.cls,
29 %% xkvecb.cls, xkvesa.sty, xkvesb.sty, xkvesc.sty, xkvex1.tex,
30 %% xkvex2.tex, xkvex3.tex and xkvex4.tex.
31 %%
32 %% The following files constitute the xkeyval bundle and must be
33 %% distributed as a whole: readme, xkeyval.pdf, keyval.tex,
34 %% pst-xkey.sty, pst-xkey.tex, xkeyval.sty, xkeyval.tex, xkvview.sty,
35 %% xkvltxp.sty, xkvtxhdr.tex, xkvutils.tex, pst-xkey.dtx and xkeyval.dtx.
36 %%
37 %%
38 %% Based on keyval.sty.
39 %%
40 \def\XKV@tempa#1{%
41 \long\def\KV@@sp@def##1##2{%
42 \futurelet\XKV@resa\KV@@sp@d##2\@nil\@nil#1\@nil\relax##1}%
43 \long\def\KV@@sp@d{%
44 \ifx\XKV@resa\@sptoken
45 \expandafter\KV@@sp@b
46 \else
47 \expandafter\KV@@sp@b\expandafter#1%
48 \fi}%
49 \long\def\KV@@sp@b#1##1 \@nil{\KV@@sp@c##1}%
50 }
51 \XKV@tempa{ }
52 \long\def\KV@@sp@c#1\@nil#2\relax#3{\XKV@toks{#1}\edef#3{\the\XKV@toks}}
53 \long\def\KV@do#1,{%
54 \ifx\relax#1\@empty\else
55 \KV@split#1==\relax
56 \expandafter\KV@do\fi}
57 \long\def\KV@split#1=#2=#3\relax{%
58 \KV@@sp@def\XKV@tempa{#1}%
59 \ifx\XKV@tempa\@empty\else
60 \expandafter\let\expandafter\XKV@tempc
61 \csname\KV@prefix\XKV@tempa\endcsname
62 \ifx\XKV@tempc\relax
63 \XKV@err{`\XKV@tempa' undefined}%
64 \else
65 \ifx\@empty#3\@empty
66 \KV@default
67 \else
68 \KV@@sp@def\XKV@tempb{#2}%
69 \expandafter\XKV@tempc\expandafter{\XKV@tempb}\relax
70 \fi
71 \fi
72 \fi}
73 \def\KV@default{%
74 \expandafter\let\expandafter\XKV@tempb
75 \csname\KV@prefix\XKV@tempa @default\endcsname
76 \ifx\XKV@tempb\relax
77 \XKV@err{No value specified for key `\XKV@tempa'}%
78 \else
79 \XKV@tempb\relax
80 \fi}
81 \def\KV@def#1#2[#3]{%
82 \long\@namedef{KV@#1@#2@default\expandafter}\expandafter
83 {\csname KV@#1@#2\endcsname{#3}}%
84 \long\@namedef{KV@#1@#2}##1}
85 \endinput
86 %%
87 %% End of file `keyval.tex'.