Debian Codegraph @

texmf-dist/tex/latex/graphics/keyval.sty

raw
1 %%
2 %% This is file `keyval.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% keyval.dtx (with options: `package')
8 %%
9 %% The source is maintained by the LaTeX Project team and bug
10 %% reports for it can be opened at https://latex-project.org/bugs/
11 %% (but please observe conditions on bug reports sent to that address!)
12 %%
13 %%
14 %% keyval.dtx Copyright (C) 1993 1994 1995 1997 1998 1999 David Carlisle
15 %% Copyright (C) 2000-2025 David Carlisle, LaTeX Project
16 %% The LaTeX Project and any individual authors listed elsewhere
17 %% in this file.
18 %%
19 %% This file is part of the Standard LaTeX `Graphics Bundle'.
20 %% It may be distributed under the terms of the LaTeX Project Public
21 %% License, as described in lppl.txt in the base LaTeX distribution.
22 %% Either version 1.3c or, at your option, any later version.
23 %%
24 \NeedsTeXFormat{LaTeX2e}
25 \ProvidesPackage{keyval}
26 [2022/05/29 v1.15 key=value parser (DPC)]
27 \long\def\setkeys#1#2{%
28 \def\KV@prefix{KV@#1@}%
29 \let\@tempc\relax
30 \KV@do#2,\relax,}
31 \long\def\KV@do#1,{%
32 \ifx\relax#1\@empty\else
33 \KV@split#1==\relax
34 \expandafter\KV@do\fi}
35 \long\def\KV@split#1=#2=#3\relax{%
36 \KV@@sp@def\@tempa{#1}%
37 \ifx\@tempa\@empty\else
38 \expandafter\let\expandafter\@tempc
39 \csname\KV@prefix\@tempa\endcsname
40 \ifx\@tempc\relax
41 \KV@errx
42 {\@tempa\space undefined}%
43 \else
44 \ifx\@empty#3\@empty
45 \KV@default
46 \else
47 \KV@@sp@def\@tempb{#2}%
48 \expandafter\@tempc\expandafter{\@tempb}\relax
49 \fi
50 \fi
51 \fi}
52 \def\KV@default{%
53 \expandafter\let\expandafter\@tempb
54 \csname\KV@prefix\@tempa @default\endcsname
55 \ifx\@tempb\relax
56 \KV@err{No value specified for \@tempa}%
57 \else
58 \@tempb\relax
59 \fi}
60 \DeclareOption{unknownkeysallowed}{%
61 \def\KV@errx#1{\PackageInfo{keyval}{#1}}}
62 \DeclareOption{unknownkeyserror}{%
63 \def\KV@errx#1{\PackageError{keyval}{#1}\@ehc}}
64 \ExecuteOptions{unknownkeyserror}
65 \let\KV@err\KV@errx
66 \ProcessOptions
67 \def\@tempa#1{%
68 \long\def\KV@@sp@def##1##2{%
69 \futurelet\KV@tempa\KV@@sp@d##2\@nil\@nil#1\@nil\relax##1}%
70 \def\KV@@sp@d{%
71 \ifx\KV@tempa\@sptoken
72 \expandafter\KV@@sp@b
73 \else
74 \expandafter\KV@@sp@b\expandafter#1%
75 \fi}%
76 \long\def\KV@@sp@b#1##1 \@nil{\KV@@sp@c##1}%
77 }
78 \@tempa{ }
79 \long\def\KV@@sp@c#1\@nil#2\relax#3{\KV@toks@{#1}\edef#3{\the\KV@toks@}}
80 \newtoks\KV@toks@
81 \def\define@key#1#2{%
82 \@ifnextchar[{\KV@def{#1}{#2}}{\long\@namedef{KV@#1@#2}####1}}
83 \def\KV@def#1#2[#3]{%
84 \long\@namedef{KV@#1@#2@default\expandafter}\expandafter
85 {\csname KV@#1@#2\endcsname{#3}}%
86 \long\@namedef{KV@#1@#2}##1}
87 \endinput
88 %%
89 %% End of file `keyval.sty'.